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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
834
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
1 // $HeadURL$
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
2 // $Date$
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
3 // $Author$
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
4
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
5 // @author@ Nick <Nick_member@pathlink.com>
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
6 // @date@ 2006-02-15
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 1091
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6267
834
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
8
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
9 module dstress.run.d.delete_12_D;
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
10
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
11 int status;
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
12
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
13 class Foo{
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
14 int i;
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
15
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
16 new(size_t sz){
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
17 void* p;
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
18
889
b3da1b510a19 div. memory management
thomask
parents: 834
diff changeset
19 p = (new byte[sz]).ptr;
1091
9dcac8d4e97f post DMD-0.163 review
thomask
parents: 889
diff changeset
20
834
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
21 if(status++ != 1){
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
22 assert(0);
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
23 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
24
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
25 return p;
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
26 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
27
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
28 delete(void* p){
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
29 if(status++ != 2){
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
30 assert(0);
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
31 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
32 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
33 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
34
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
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
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
37 delete f;
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
38 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
39
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
40 int main(){
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
41 if(status++ != 0){
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
42 assert(0);
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
43 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
44
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
45 test();
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
46
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
47 if(status++ != 3){
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
48 assert(0);
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
49 }
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
50
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
51 return 0;
4a37bb21b9a1 Nick <Nick_member@pathlink.com>
thomask
parents:
diff changeset
52 }