Rev | Line | |
---|
[4] | 1 | module checNoNestedAltStatements { |
---|
| 2 | altstep as_0 () |
---|
| 3 | runs on myComponent { |
---|
| 4 | |
---|
| 5 | //nesting within an altstep |
---|
| 6 | [] p2.receive ( msg_b ) { |
---|
| 7 | } |
---|
| 8 | [] p2.receive ( msg_c ) { |
---|
| 9 | setverdict ( pass ); |
---|
| 10 | |
---|
| 11 | // nested alt, level 1 |
---|
| 12 | alt { |
---|
| 13 | [] p2.receive ( msg_b ) { |
---|
| 14 | } |
---|
| 15 | [] p2.receive ( msg_c ) { |
---|
| 16 | setverdict ( pass ); |
---|
| 17 | } |
---|
| 18 | [] p2.receive { |
---|
| 19 | } |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | [] p2.receive { |
---|
| 23 | |
---|
| 24 | // nested alt, level 1 |
---|
| 25 | alt { |
---|
| 26 | [] p2.receive ( msg_b ) { |
---|
| 27 | } |
---|
| 28 | [] p2.receive ( msg_c ) { |
---|
| 29 | setverdict ( pass ); |
---|
| 30 | } |
---|
| 31 | [] p2.receive { |
---|
| 32 | |
---|
| 33 | // nested alt, level 2 |
---|
| 34 | alt { |
---|
| 35 | [] p2.receive ( msg_b ) { |
---|
| 36 | } |
---|
| 37 | [] p2.receive ( msg_c ) { |
---|
| 38 | setverdict ( pass ); |
---|
| 39 | } |
---|
| 40 | [] p2.receive { |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | testcase t_sendMsg () |
---|
| 49 | runs on myComponent { |
---|
| 50 | |
---|
| 51 | //nesting within alt statement |
---|
| 52 | p1.send ( msg_a ); |
---|
| 53 | alt { |
---|
| 54 | [] p2.receive ( msg_b ) { |
---|
| 55 | } |
---|
| 56 | [] p2.receive ( msg_c ) { |
---|
| 57 | setverdict ( pass ); |
---|
| 58 | |
---|
| 59 | // nested alt, level 1 |
---|
| 60 | alt { |
---|
| 61 | [] p2.receive ( msg_b ) { |
---|
| 62 | } |
---|
| 63 | [] p2.receive ( msg_c ) { |
---|
| 64 | setverdict ( pass ); |
---|
| 65 | } |
---|
| 66 | [] p2.receive { |
---|
| 67 | } |
---|
| 68 | } |
---|
| 69 | } |
---|
| 70 | [] p2.receive { |
---|
| 71 | |
---|
| 72 | // nested alt, level 1 |
---|
| 73 | alt { |
---|
| 74 | [] p2.receive ( msg_b ) { |
---|
| 75 | } |
---|
| 76 | [] p2.receive ( msg_c ) { |
---|
| 77 | setverdict ( pass ); |
---|
| 78 | } |
---|
| 79 | [] p2.receive { |
---|
| 80 | |
---|
| 81 | // nested alt level 2 |
---|
| 82 | alt { |
---|
| 83 | [] p2.receive ( msg_b ) { |
---|
| 84 | } |
---|
| 85 | [] p2.receive ( msg_c ) { |
---|
| 86 | setverdict ( pass ); |
---|
| 87 | } |
---|
| 88 | [] p2.receive { |
---|
| 89 | } |
---|
| 90 | } |
---|
| 91 | } |
---|
| 92 | } |
---|
| 93 | } |
---|
| 94 | } |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.