11
|
1 <html>
|
|
2 <head><title>dstress: html_line_ending_linux</title></head>
|
|
3 <body><pre><CODE>
|
756
|
4 // __DSTRESS_TORTURE_BLOCK__ -release
|
|
5
|
11
|
6 int main(){
|
|
7 try{
|
|
8 assert(0);
|
|
9 }catch(Exception e){
|
|
10 checkLineNumber(e);
|
|
11 return 0;
|
|
12 }
|
|
13
|
|
14 assert(-1);
|
|
15 return 1;
|
|
16 }
|
|
17
|
111
|
18 /*
|
|
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();
|
111
|
25
|
11
|
26 int start;
|
1560
|
27 for(start=0; start<x.length; start++){if(x[start]=='('){break;}
|
11
|
28 }
|
|
29
|
|
30 int end;
|
1560
|
31 for(end=x.length-1; end>start; end--){if(x[end]==')'){break;}}
|
11
|
32
|
|
33 assert(end-start==2);
|
1560
|
34 assert(x[start+1]=='8');
|
11
|
35 }
|
|
36 </CODE></pre></body>
|
|
37 </html>
|