Mercurial > projects > dstress
annotate run/overload_03.d @ 0:3269e4627918
init dstress
author | svnowner |
---|---|
date | Sat, 25 Sep 2004 22:33:30 +0000 |
parents | |
children | 3414705c41ac |
rev | line source |
---|---|
0 | 1 // $Header: /home/th/Dokumente/Entwicklung/MEIN_CVS/MiniD/src/run/overload_03.d,v 1.1 2004/08/20 23:42:53 th Exp $ |
2 | |
3 int status; | |
4 | |
5 void check( byte b){ | |
6 status+=b; | |
7 } | |
8 | |
9 void check( short s ){ | |
10 status-=s; | |
11 } | |
12 | |
13 void check( int i ){ | |
14 status+= i*2; | |
15 } | |
16 | |
17 int main(){ | |
18 | |
19 byte b = 2; | |
20 short s = 3; | |
21 int i = 4; | |
22 | |
23 assert(status == 0); | |
24 check(b); | |
25 assert(status == 2); | |
26 check(s); | |
27 assert(status == -1); | |
28 check(i); | |
29 assert(status == 7 ); | |
30 return 0; | |
31 } | |
32 |