Mercurial > projects > dstress
annotate run/destructor_03.d @ 1487:6e4063f99377
changed nntp: URLs to http: URLs
author | thomask |
---|---|
date | Mon, 09 Apr 2007 12:29:15 +0000 |
parents | 52c9e86b6486 |
children | 7b7967dd4203 |
rev | line source |
---|---|
140 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
0 | 5 // @author@ Ilya Zaitseff <sark7@mail333.com> |
6 // @date@ 2004-08-06 | |
140 | 7 // @uri@ news:opscahl7ddaaezs2@ilya.tec.amursk.ru |
1487 | 8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=1284 |
70
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
18
diff
changeset
|
9 |
5f98d4a33d49
1) review of all test cases with unexpected results (except encoding and html/xml)
thomask
parents:
18
diff
changeset
|
10 module dstress.run.destructor_03; |
0 | 11 |
12 int status; | |
13 | |
14 class MyClass{ | |
15 this(){ | |
16 status++; | |
17 } | |
18 | |
19 ~this(){ | |
18 | 20 status--; |
0 | 21 throw new Exception("E2"); |
22 } | |
23 } | |
24 | |
25 int main(){ | |
26 try{ | |
27 auto MyClass m = new MyClass(); | |
28 assert(status == 1); | |
29 delete m; | |
30 }catch(Exception e){ | |
18 | 31 assert(status == 0); |
32 status--; | |
0 | 33 } |
34 | |
18 | 35 assert( status == -1 ); |
0 | 36 return 0; |
37 } |