374
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
756
|
5 // __DSTRESS_TORTURE_BLOCK__ -release
|
|
6
|
374
|
7 module dstress.run.line_token_11;
|
|
8
|
|
9 # line __LINE__
|
|
10
|
|
11 int main(){
|
|
12 try{
|
|
13 assert(0);
|
|
14 }catch(Exception e){
|
|
15 checkLineNumber(e);
|
|
16 return 0;
|
|
17 }
|
|
18
|
756
|
19 assert(0);
|
374
|
20 }
|
|
21
|
|
22 /*
|
|
23 * @WARNING@ this code depends on the phobos implementation.
|
|
24 * char[]s returned by wrong assertions have to look like:
|
|
25 * "blah blah (linenumber) blah blah"
|
|
26 */
|
|
27 void checkLineNumber(Object o){
|
1560
|
28 string x=o.toString();
|
374
|
29
|
|
30 int start;
|
1560
|
31 for(start=0; start<x.length; start++){
|
|
32 if(x[start]=='('){
|
374
|
33 break;
|
|
34 }
|
|
35 }
|
|
36
|
|
37 int end;
|
1560
|
38 for(end=x.length-1; end>start; end--){
|
|
39 if(x[end]==')'){
|
374
|
40 break;
|
|
41 }
|
|
42 }
|
|
43
|
|
44 assert(end-start==3);
|
1560
|
45 assert(x[start+1]=='1');
|
|
46 assert(x[start+2]=='2');
|
374
|
47 }
|