annotate run/t/throw_07_B.d @ 1025:8516fcb66401

Exception handling is broken for delegates on Linux <mclysenk@mtu.edu> 2006-05-11 news:e3u2au$2l0c$1@digitaldaemon.com
author thomask
date Wed, 24 May 2006 16:23:57 +0000
parents
children b8c0195059d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1025
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
1 // $HeadURL$
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
2 // $Date$
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
3 // $Author$
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
4
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
5 // @author@ <mclysenk@mtu.edu>
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
6 // @date@ 2006-05-11
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
7 // @uri@ news:e3u2au$2l0c$1@digitaldaemon.com
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
8
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
9 module dstress.run.t.throw_07_B;
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
10
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
11 int status;
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
12
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
13 class XException : Exception{
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
14 this(char[] msg){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
15 super(msg);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
16 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
17 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
18
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
19 class Tester{
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
20 this(void function() dg_){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
21 if(status++ != 0){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
22 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
23 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
24 dg = dg_;
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
25 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
26
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
27 void function() dg;
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
28
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
29 void test() {
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
30 if(status++ != 1){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
31 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
32 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
33 dg();
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
34
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
35 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
36 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
37 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
38
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
39 void foo(){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
40 try{
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
41 if(status++ != 2){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
42 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
43 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
44 throw new XException("test2");
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
45
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
46 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
47 }catch(XException e){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
48 if(status++ != 3){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
49 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
50 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
51 throw e;
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
52 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
53 }finally{
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
54 if(status++ != 4){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
55 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
56 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
57 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
58 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
59 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
60
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
61 int main(){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
62
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
63 Tester t = new Tester(&foo);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
64
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
65 try{
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
66 if(status++ != 5){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
67 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
68 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
69 t.test();
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
70 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
71 }catch(XException e){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
72 if(status++ != 6){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
73 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
74 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
75 }finally{
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
76 if(status++ != 7){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
77 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
78 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
79 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
80
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
81 if(status != 8){
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
82 assert(0);
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
83 }
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
84 return 0;
8516fcb66401 Exception handling is broken for delegates on Linux
thomask
parents:
diff changeset
85 }