Mercurial > projects > dstress
annotate run/auto_04.d @ 1559:ec5e144583ea
D1 -> D2 : 1/N
author | thomask |
---|---|
date | Sun, 19 Aug 2007 19:11:54 +0000 |
parents | 6e4063f99377 |
children |
rev | line source |
---|---|
140 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
0 | 5 // @author@ Sean Kelly <sean@f4.ca> |
6 // @date@ 2004-09-11 | |
140 | 7 // @uri@ news:chtj6t$24bm$1@digitaldaemon.com |
1487 | 8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=1821 |
70
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
1
diff
changeset
|
9 |
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
1
diff
changeset
|
10 module dstress.run.auto_04; |
0 | 11 |
12 int status; | |
13 | |
14 auto class AutoClass{ | |
15 this(){ | |
1559 | 16 if(0 != status){ |
17 assert(0); | |
18 } | |
0 | 19 status+=2; |
20 } | |
21 ~this(){ | |
1559 | 22 if(2 != status){ |
23 assert(0); | |
24 } | |
0 | 25 status--; |
26 throw new Exception("error msg"); | |
27 } | |
28 } | |
29 | |
30 void check(){ | |
31 auto AutoClass ac = new AutoClass(); | |
32 throw new Exception("check error"); | |
33 } | |
34 | |
35 int main(){ | |
1559 | 36 if(0 != status){ assert(0); } |
0 | 37 try{ |
38 check(); | |
39 }catch{ | |
1559 | 40 if(1 != status){ assert(0); } |
0 | 41 status-=5; |
42 } | |
799 | 43 |
44 if(status==-4){ | |
45 return 0; | |
46 } | |
47 assert(0); | |
0 | 48 } |