Added some tests for replicated indexes in parallel

This commit is contained in:
Neil Brown 2008-01-16 12:14:09 +00:00
parent bc2ffc59be
commit af130291fc
2 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,47 @@
-- This file tests array uses with replication
-- Four unknown variables are available; x, y, z.
-- Two arrays are automatically declared; a (size 10) and b (size 12)
-- The automatic replication is i = [0..8]
PROC p(INT x, y, z)
[10]INT a:
[20]INT b:
PAR i = 0 FOR 9
%%
:
PROC m()
SKIP
:
%FAIL Constant in replication
a[0] := 3
%PASS Replicated index
a[i] := 2
%FAIL Replicated index, twice
a[i] := 2
a[i] := 2
%PASS Replicated index plus one
a[i + 1] := 2
%FAIL Replicated index, modulo low number
a[i REM 8] := 3
%PASS Replicated index, modulo ok number
a[i REM 9] := 3
%PASS Replicated index plus a few, modulo ok number
a[(i + 4) REM 9] := 3
%PASS Safe nested replication
PAR j = 0 FOR 2
b[(j * 10) + i] := 3
%PASS Unsafe nested replication
PAR j = 0 FOR 2
b[(j * 8) + i] := 3
%

View File

@ -714,14 +714,16 @@ qcOmegaPrune = [scaleQC (100,1000,10000,50000) prop]
qcTests :: IO (Test, [QuickCheckTest])
qcTests
= do usageCheckTest <- automaticTest "testcases/automatic/usage-check-1.occ.test"
= do usageCheckTest1 <- automaticTest "testcases/automatic/usage-check-1.occ.test"
usageCheckTest2 <- automaticTest "testcases/automatic/usage-check-2.occ.test"
return
(TestList
[
testArrayCheck
,testIndexes
,testMakeEquations
,usageCheckTest
,usageCheckTest1
,usageCheckTest2
]
,qcOmegaEquality ++ qcOmegaPrune)