Mercurial > projects > dstress
annotate run/auto_04.d @ 799:c67acdbaf88e
Sean Kelly <sean@f4.ca>
2006-01-24
news:dr5uqg$2hn7$1@digitaldaemon.com
author | thomask |
---|---|
date | Wed, 25 Jan 2006 08:03:40 +0000 |
parents | a33ad7189d21 |
children | 52c9e86b6486 |
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 |
8 // @url@ nntp://digitalmars.com/digitalmars.D.bugs/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(){ | |
16 assert(status==0); | |
17 status+=2; | |
18 } | |
19 ~this(){ | |
20 assert(status==2); | |
21 status--; | |
22 throw new Exception("error msg"); | |
23 } | |
24 } | |
25 | |
26 void check(){ | |
27 auto AutoClass ac = new AutoClass(); | |
28 throw new Exception("check error"); | |
29 } | |
30 | |
31 int main(){ | |
32 assert(status==0); | |
33 try{ | |
34 check(); | |
35 }catch{ | |
36 assert(status==1); | |
37 status-=5; | |
38 } | |
799 | 39 |
40 if(status==-4){ | |
41 return 0; | |
42 } | |
43 assert(0); | |
0 | 44 } |