From bdcdbddb0941b6d06a28b33e628bc62e27682caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=CC=81onard=20Ge=CC=81rard?= Date: Fri, 8 Oct 2010 14:43:59 +0200 Subject: [PATCH] Added initialization bad tests and correct good/t1 --- test/bad/t10-initialization.ept | 12 ++++++++++++ test/bad/t11-initialization.ept | 11 +++++++++++ test/bad/t9-initialization.ept | 6 ++++++ test/good/t1.ept | 4 ++-- 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 test/bad/t10-initialization.ept create mode 100644 test/bad/t11-initialization.ept create mode 100644 test/bad/t9-initialization.ept diff --git a/test/bad/t10-initialization.ept b/test/bad/t10-initialization.ept new file mode 100644 index 0000000..0d9ec34 --- /dev/null +++ b/test/bad/t10-initialization.ept @@ -0,0 +1,12 @@ +node toto() returns (o : int) +var last x : int; y,z : int; +let + y = 0; + automaton + state S1 + do x = pre y; z = 0 -> x until true then S2 + state S2 + do x = last x; z = x until false then S1 + end; + o = z; +tel diff --git a/test/bad/t11-initialization.ept b/test/bad/t11-initialization.ept new file mode 100644 index 0000000..76ece05 --- /dev/null +++ b/test/bad/t11-initialization.ept @@ -0,0 +1,11 @@ +node mmm(x: int) returns (o': int) + var last m: int; o: int; + let + automaton + state I + do m = 1; o = last m + 2 until (o = 1) then J + state J + do m = last m + 1; o = 0 + end; + o' = 1 -> pre o + tel diff --git a/test/bad/t9-initialization.ept b/test/bad/t9-initialization.ept new file mode 100644 index 0000000..fe4e40b --- /dev/null +++ b/test/bad/t9-initialization.ept @@ -0,0 +1,6 @@ +node toto() returns (o : int) +var last x : int; +let + o = x; + x = last x; +tel diff --git a/test/good/t1.ept b/test/good/t1.ept index 069bce3..d078cf8 100644 --- a/test/good/t1.ept +++ b/test/good/t1.ept @@ -18,11 +18,11 @@ node mm(x: int) returns (o: int) tel node mmm(x: int) returns (o': int) - var last m: int; o: int; + var last m: int = 1; o: int; let automaton state I - do m = 1; o = last m + 2 until (o = 1) then J + do m = 0; o = last m + 1 until (o = 1) then J state J do m = last m + 1; o = 0 end;