Rev | Line | |
---|
[4] | 1 | module checkLocalDefinitionsComeFirst { |
---|
| 2 | //the good ones |
---|
| 3 | function f_sample0() { |
---|
| 4 | var integer a; |
---|
| 5 | var charstring b; |
---|
| 6 | as_sample0(); |
---|
| 7 | if (b) { |
---|
| 8 | |
---|
| 9 | } |
---|
| 10 | } |
---|
| 11 | |
---|
| 12 | altstep as_sample2() { |
---|
| 13 | var integer a; |
---|
| 14 | var charstring b; |
---|
| 15 | []t.timeout{ |
---|
| 16 | |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | testcase tc_sample0() runs on sampleComponent { |
---|
| 23 | var integer a; |
---|
| 24 | var charstring b; |
---|
| 25 | f_sample1(); |
---|
| 26 | if (a){ |
---|
| 27 | |
---|
| 28 | } else { |
---|
| 29 | alt{ |
---|
| 30 | []t.timeout{ |
---|
| 31 | } |
---|
| 32 | []as_sample2() |
---|
| 33 | } |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | //the bad ones |
---|
| 39 | function f_sample1() { |
---|
| 40 | |
---|
| 41 | var integer a; |
---|
| 42 | timer t1; |
---|
| 43 | var charstring b; |
---|
| 44 | as_sample0(); |
---|
| 45 | if (b) { |
---|
| 46 | var charstring c; |
---|
| 47 | } |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | altstep as_sample1() { |
---|
| 51 | |
---|
| 52 | timer t1; |
---|
| 53 | const integer x:=1; |
---|
| 54 | var integer a; |
---|
| 55 | var charstring b; |
---|
| 56 | []t.timeout{ |
---|
| 57 | |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | altstep as_sample0() runs on sampleComponent{ |
---|
| 65 | var integer a; |
---|
| 66 | var charstring b; |
---|
| 67 | []t.timeout{ |
---|
| 68 | timer xt; |
---|
| 69 | var charstring c; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | testcase tc_sample1() runs on sampleComponent { |
---|
| 76 | var integer a; |
---|
| 77 | var charstring b; |
---|
| 78 | f_sample0(); |
---|
| 79 | if (a){ |
---|
| 80 | var charstring d; |
---|
| 81 | |
---|
| 82 | } else { |
---|
| 83 | alt{ |
---|
| 84 | []t.timeout{ |
---|
| 85 | timer xx; |
---|
| 86 | var charstring e; |
---|
| 87 | } |
---|
| 88 | []as_sample1() |
---|
| 89 | } |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | type component sampleComponent { |
---|
| 95 | |
---|
| 96 | var integer x; |
---|
| 97 | const integer cx:=4; |
---|
| 98 | port portType instance; |
---|
| 99 | timer tx; |
---|
| 100 | |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | control { |
---|
| 104 | var integer controlVar; |
---|
| 105 | const integer cx:=4; |
---|
| 106 | for (var integer x:=1; x< 5; x:=x+1){ |
---|
| 107 | } |
---|
| 108 | } |
---|
| 109 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.