Mercurial > projects > dstress
annotate run/d/delete_12_D.d @ 1615:8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 12 Jul 2009 16:44:52 +0200 |
parents | b8c0195059d9 |
children |
rev | line source |
---|---|
834 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Nick <Nick_member@pathlink.com> | |
6 // @date@ 2006-02-15 | |
1489 | 7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6267 |
834 | 8 |
9 module dstress.run.d.delete_12_D; | |
10 | |
11 int status; | |
12 | |
13 class Foo{ | |
14 int i; | |
15 | |
16 new(size_t sz){ | |
17 void* p; | |
18 | |
889 | 19 p = (new byte[sz]).ptr; |
1091 | 20 |
834 | 21 if(status++ != 1){ |
22 assert(0); | |
23 } | |
24 | |
25 return p; | |
26 } | |
27 | |
28 delete(void* p){ | |
29 if(status++ != 2){ | |
30 assert(0); | |
31 } | |
32 } | |
33 } | |
34 | |
35 void test(){ | |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1489
diff
changeset
|
36 scope Foo f = new Foo(); |
834 | 37 delete f; |
38 } | |
39 | |
40 int main(){ | |
41 if(status++ != 0){ | |
42 assert(0); | |
43 } | |
44 | |
45 test(); | |
46 | |
47 if(status++ != 3){ | |
48 assert(0); | |
49 } | |
50 | |
51 return 0; | |
52 } |