11
|
1 <html>
|
|
2 <head><title>dstress: html_line_ending_linux</title></head>
|
|
3 <body><pre><CODE>
|
|
4 int main(){
|
|
5 try{
|
|
6 assert(0);
|
|
7 }catch(Exception e){
|
|
8 checkLineNumber(e);
|
|
9 return 0;
|
|
10 }
|
|
11
|
|
12 assert(-1);
|
|
13 return 1;
|
|
14 }
|
|
15
|
111
|
16 /*
|
|
17 * @WARNING@ this code depends on the phobos implementation.
|
11
|
18 * char[]s returned by wrong assertions have to look like:
|
|
19 * "blah blah (linenumber) blah blah"
|
|
20 */
|
|
21 void checkLineNumber(Object o){
|
|
22 char[] string=o.toString();
|
111
|
23
|
11
|
24 int start;
|
|
25 for(start=0; start<string.length; start++){if(string[start]=='('){break;}
|
|
26 }
|
|
27
|
|
28 int end;
|
|
29 for(end=string.length-1; end>start; end--){if(string[end]==')'){break;}}
|
|
30
|
|
31 assert(end-start==2);
|
|
32 assert(string[start+1]=='6');
|
|
33 }
|
|
34 </CODE></pre></body>
|
|
35 </html>
|