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