Last change
on this file since 48 was
26,
checked in by phdmakk, 14 years ago
|
+ initial testing examples for extension packages
|
File size:
1.2 KB
|
Rev | Line | |
---|
[26] | 1 | module ec_modes language "EC:2010" { |
---|
| 2 | testcase tc0() runs on c1 { |
---|
| 3 | label b0 |
---|
| 4 | cont{ |
---|
| 5 | onentry{ //OK, need to apply restrictions |
---|
| 6 | A:=2.0; |
---|
| 7 | } |
---|
| 8 | inv{ |
---|
| 9 | A > C //DOES THIS MAKE SENSE? |
---|
| 10 | } //OK |
---|
| 11 | // |
---|
| 12 | // |
---|
| 13 | A := 5.0; |
---|
| 14 | B := 4.0; |
---|
| 15 | wait(200); |
---|
| 16 | onexit{ //OK, need to apply restrictions |
---|
| 17 | A := 1.0; |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | } |
---|
| 21 | until{ |
---|
| 22 | [notinv]{log("bla"); goto b1} |
---|
| 23 | [A > 1 and B < 2] {log("blablabla"); continue; repeat;} |
---|
| 24 | []p.receive(1) {log("blabla"); goto b0} |
---|
| 25 | [finished]{log("finished!")} |
---|
| 26 | } //OK |
---|
| 27 | |
---|
| 28 | cont {} until {} //OK with option UntilGuardList |
---|
| 29 | cont {} until{(a>b)} //OK |
---|
| 30 | //cont {} until{()} //this is absurd and should not be accepted |
---|
| 31 | cont {} until{[notinv]{log("bla");}} //OK |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | //TODO: need further examples with until blocks and guards |
---|
| 35 | |
---|
| 36 | label b1; |
---|
| 37 | cont {} until {(A>now)}; //ok |
---|
| 38 | |
---|
| 39 | cont {} until {(A>duration)}; //ok |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | testcase tc1() runs on c1 { |
---|
| 43 | cont { |
---|
| 44 | seq { |
---|
| 45 | cont {} until {(A==B)} |
---|
| 46 | cont {} |
---|
| 47 | cont {} |
---|
| 48 | par { |
---|
| 49 | cont {} |
---|
| 50 | cont {} |
---|
| 51 | } until {(A>X)} |
---|
| 52 | } until { (X == Y) } |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | mode ModeType mode1 (in float p1, in integer p2, in ModeType m3) runs on c1 { |
---|
| 57 | m3(p1, p2, m3); |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | type mode ModeType (in float p1, in integer p2, in ModeType m3); |
---|
| 61 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.