annotate run/new_12.d @ 1597:8b9d4d2f925a

Fix typos in complex tests. See D bug 614.
author Christian Kamm <kamm incasoftware de>
date Tue, 09 Sep 2008 16:53:58 +0200
parents b3da1b510a19
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
378
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
1 // $HeadURL$
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
2 // $Date$
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
3 // $Author$
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
4
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
5 module dstress.run.new_12;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
6
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
7 int counter;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
8
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
9 struct MyStruct{
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
10 int x;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
11
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
12 new(size_t size){
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
13 counter++;
889
b3da1b510a19 div. memory management
thomask
parents: 528
diff changeset
14 return (new byte[size]).ptr;
378
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
15 }
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
16 }
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
17
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
18 int main(){
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
19 assert(counter==0);
528
9e0847cf535a pre DMD-0.123 review
thomask
parents: 435
diff changeset
20 MyStruct* m=new MyStruct;
378
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
21 m.x=1;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
22 assert(counter==1);
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
23 return 0;
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
24 }
e555e1460d7e added tests for custom allocators
thomask
parents:
diff changeset
25