Mercurial > projects > dstress
annotate run/scope_04.d @ 1619:bebc7472a832
Fix #7.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 07 Nov 2009 18:55:30 +0100 |
parents | 8d5c55d163fd |
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 |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1559
diff
changeset
|
10 module dstress.run.scope_04; |
0 | 11 |
12 int status; | |
13 | |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1559
diff
changeset
|
14 scope class ScopeClass{ |
0 | 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(){ | |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1559
diff
changeset
|
31 scope ScopeClass ac = new ScopeClass(); |
0 | 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 } |