summaryrefslogtreecommitdiff
path: root/tests/source
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ansys.com>2014-06-13 17:47:26 +0200
committerAlex Auvolat <alex.auvolat@ansys.com>2014-06-13 17:47:26 +0200
commita1eb0c8e58495358e96d864c72613de162a32f38 (patch)
treeb6c2cef67a07a6a3ac7d6dce856690ddf6589827 /tests/source
parent617231f214ace1bc3a2aa48e18db319575166047 (diff)
downloadscade-analyzer-a1eb0c8e58495358e96d864c72613de162a32f38.tar.gz
scade-analyzer-a1eb0c8e58495358e96d864c72613de162a32f38.zip
Add fail updown test (using pre instead of last).
Diffstat (limited to 'tests/source')
-rw-r--r--tests/source/updown_fail.scade23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/source/updown_fail.scade b/tests/source/updown_fail.scade
new file mode 100644
index 0000000..b6280ef
--- /dev/null
+++ b/tests/source/updown_fail.scade
@@ -0,0 +1,23 @@
+const bound: int = 7;
+
+node updown() returns(probe x: int)
+let
+ automaton
+ initial state UP
+ let x = (0 -> pre x) + 1; tel
+ until if x >= bound resume DOWN;
+
+ state DOWN
+ let x = (0 -> pre x) - 1; tel
+ until if x <= -bound resume UP;
+
+ returns x;
+tel
+
+node test(i: int) returns(a, b, c: int; exit: bool)
+let
+ exit = i >= 30;
+ a = updown();
+ b = 0;
+ c = 0;
+tel