374
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
0
|
4
|
|
5 // @author@ Sean Kelly <sean@f4.ca>
|
|
6 // @date@ 2004-09-11
|
|
7
|
374
|
8 module dstress.run.auto_02;
|
|
9
|
0
|
10 int status;
|
|
11
|
|
12 auto class AutoClass{
|
|
13 void bad(){
|
|
14 throw new Exception("error msg");
|
|
15 }
|
1559
|
16
|
0
|
17 ~this(){
|
799
|
18 if(status == 0){
|
|
19 status--;
|
|
20 }else{
|
|
21 status = -100;
|
|
22 }
|
0
|
23 }
|
|
24 }
|
|
25
|
|
26 void test(){
|
|
27 try{
|
|
28 auto AutoClass ac = new AutoClass();
|
|
29 ac.bad();
|
|
30 }catch{
|
799
|
31 if(status == -1){
|
|
32 status = 20;
|
|
33 }
|
|
34 }
|
|
35
|
|
36 if(status != 20){
|
|
37 throw new Exception("dtor not called");
|
0
|
38 }
|
|
39 }
|
|
40
|
|
41 int main(){
|
799
|
42 assert(status == 0);
|
|
43
|
0
|
44 test();
|
799
|
45
|
|
46 if(status == 20){
|
|
47 return 0;
|
|
48 }
|
0
|
49 }
|