Mercurial > projects > dstress
comparison run/break_08.d @ 1559:ec5e144583ea
D1 -> D2 : 1/N
author | thomask |
---|---|
date | Sun, 19 Aug 2007 19:11:54 +0000 |
parents | 85ed61918ae4 |
children |
comparison
equal
deleted
inserted
replaced
1558:d40d75fcd5c5 | 1559:ec5e144583ea |
---|---|
4 | 4 |
5 module dstress.run.break_08; | 5 module dstress.run.break_08; |
6 | 6 |
7 int status; | 7 int status; |
8 | 8 |
9 int test(char[][] args){ | 9 int test(string[] args){ |
10 loop: while(1){ | 10 loop: while(1){ |
11 try{ | 11 try{ |
12 try{ | 12 try{ |
13 if(args.length==1){ | 13 if(args.length==1){ |
14 break loop; | 14 break loop; |
15 } | 15 } |
16 }finally{ | 16 }finally{ |
17 assert(status==0); | 17 if(0 != status){ |
18 assert(0); | |
19 } | |
18 status+=2; | 20 status+=2; |
19 } | 21 } |
20 | 22 |
21 try{ | 23 try{ |
22 assert(0); | 24 assert(0); |
23 }finally{ | 25 }finally{ |
24 assert(0); | 26 assert(0); |
25 } | 27 } |
26 }finally{ | 28 }finally{ |
27 assert(status==2); | 29 if(2 != status){ |
30 assert(0); | |
31 } | |
28 status+=3; | 32 status+=3; |
29 } | 33 } |
30 assert(0); | 34 assert(0); |
31 return 0; | 35 return 0; |
32 } | 36 } |
33 return -1; | 37 return -1; |
34 } | 38 } |
35 | 39 |
36 int main(char[][] args){ | 40 int main(string[] args){ |
37 assert(status == 0); | 41 if(0 != status ){ |
38 assert(args.length == 1); | 42 assert(0); |
39 assert(test(args) == -1); | 43 } |
40 assert(status == 5); | 44 if(1 != args.length ){ |
45 assert(0); | |
46 } | |
47 if(-1 != test(args) ){ | |
48 assert(0); | |
49 } | |
50 if(5 != status ){ | |
51 assert(0); | |
52 } | |
41 return 0; | 53 return 0; |
42 } | 54 } |