Added tests with multi-dimensional arrays

This commit is contained in:
Neil Brown 2008-01-25 16:16:16 +00:00
parent 86b8185b1f
commit 10493717aa
2 changed files with 44 additions and 12 deletions

View File

@ -0,0 +1,34 @@
-- This file tests simple array uses without replication
-- Four unknown variables are available; x, y, z.
-- Two arrays are automatically declared; a (size 10*6) and b (size 12*12)
PROC p(INT x, y, z)
[10][6]INT a:
[12][12]INT b:
PAR
%%
:
PROC m()
SKIP
:
%PASS Distinct constants
a[0][0] := 3
a[1][0] := 4
a[0][1] := 5
a[1][1] := 6
%FAIL Identical constants
a[0][0] := 3
a[0][0] := 4
%FAIL Identical constants, PAR assign
a[0][0],a[0][0] := 3,4
%PASS Same constant, different array
a[0][0] := 3
b[0][0] := 4
-- TODO add replication and such
%

View File

@ -765,20 +765,18 @@ qcOmegaPrune = [scaleQC (100,1000,10000,50000) prop]
ioqcTests :: IO (Test, [QuickCheckTest])
ioqcTests
= do usageCheckTest1 <- automaticTest "testcases/automatic/usage-check-1.occ.test"
usageCheckTest2 <- automaticTest "testcases/automatic/usage-check-2.occ.test"
usageCheckTest3 <- automaticTest "testcases/automatic/usage-check-3.occ.test"
return
(TestList
= seqPair
(liftM TestList $ sequence
[
testArrayCheck
,testIndexes
,testMakeEquations
,usageCheckTest1
,usageCheckTest2
,usageCheckTest3
return testArrayCheck
,return testIndexes
,return testMakeEquations
,automaticTest "testcases/automatic/usage-check-1.occ.test"
,automaticTest "testcases/automatic/usage-check-2.occ.test"
,automaticTest "testcases/automatic/usage-check-3.occ.test"
,automaticTest "testcases/automatic/usage-check-4.occ.test"
]
,qcOmegaEquality ++ qcOmegaPrune)
,return $ qcOmegaEquality ++ qcOmegaPrune)