c2db7499a82f4e99eca4562cc0a4fcb1e5a22cbb
[IRC.git] / Robust / src / Tests / OptionalArgsTest / TestRuntime / TestRuntime3 / Willy.java
1 //Same as the previous test but object is not optional
2 //for task two. Implies multiple entering flags
3 // (tricky part we spoke about, Brian and William)
4
5 task Startup(StartupObject s {initialstate}){
6     
7     Test o = new Test() {A};
8     
9     taskexit(s {!initialstate});
10     
11 }
12
13 task ONE(Test o{A}){
14     o.decrease();
15     System.printString("Inside ONE\n");
16     int i = 100/o.getNumber();
17     taskexit(o {!A, B});
18     taskexit(o {!A, B});
19 }
20
21 task TWO(Test o{B}){
22  System.printString("Inside TWO\n");   
23  if(false) taskexit(o {!B, C});
24  else taskexit(o {!B, D});
25   
26 }
27
28 /*task THREE(Test o{B}){
29
30     taskexit(o {!B, D});
31     }*/
32
33 task FOUR(Test o{C}){
34 System.printString("Inside FOUR\n");
35     taskexit(o {!C, E});
36     
37     
38 }
39
40 task FIVE(optional Test o{D}){
41   System.printString("Inside FIVE\n");
42     taskexit(o {!D, F});
43
44 }
45
46 task SIX(Test o{E}){
47   System.printString("Inside SIX\n");
48     taskexit(o {!E, G, J});
49
50 }
51
52 task SEVEN(optional Test o{F}){
53   System.printString("Inside SEVEN\n");
54     taskexit(o {!F, G, K});
55
56 }
57
58 task EIGHT(optional Test o{G}){
59   System.printString("Inside EIGHT\n");
60     
61     if(false) taskexit(o {!G, H}); 
62     else taskexit(o {!G, I});
63
64 }
65
66 task NINE(optional Test o{H}){
67 System.printString("Inside NINE\n");
68 taskexit(o {!H}); 
69 }
70 task TEN(optional Test o{I}){
71 System.printString("Inside TEN\n");
72  if(true) taskexit(o {!I,L }); 
73  else taskexit(o {!I,M });
74 }