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