Changes in tests/exceptions/terminate.cfa [e68d092:7f9968ad]
- File:
-
- 1 edited
-
tests/exceptions/terminate.cfa (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/terminate.cfa
re68d092 r7f9968ad 9 9 TRIVIAL_EXCEPTION(moment_of, zen); 10 10 11 void in_void(void); 12 11 13 int main(int argc, char * argv[]) { 12 14 // The simple throw catch test. … … 14 16 loud_exit a = "simple try clause"; 15 17 printf("simple throw\n"); 16 throw &(zen){};18 throw (zen){}; 17 19 printf("end of try clause\n"); 18 20 } catch (zen * error) { 19 loud_exit a = "simple catch clause";21 loud_exit a = "simple catch clause"; 20 22 printf("simple catch\n"); 23 } 24 printf("\n"); 25 26 // Throw catch-all test. 27 try { 28 throw (zen){}; 29 } catch (exception_t * error) { 30 printf("catch-all\n"); 21 31 } 22 32 printf("\n"); … … 25 35 try { 26 36 printf("throwing child exception\n"); 27 throw &(moment_of){};37 throw (moment_of){}; 28 38 } catch (zen *) { 29 39 printf("inner parent match\n"); … … 36 46 try { 37 47 try { 38 throw &(yin){};48 throw (yin){}; 39 49 } catch (zen *) { 40 50 printf("caught yin as zen\n"); … … 52 62 loud_exit a = "rethrow inner try"; 53 63 printf("rethrow inner try\n"); 54 throw &(zen){};64 throw (zen){}; 55 65 } catch (zen *) { 56 66 loud_exit a = "rethrowing catch clause"; … … 67 77 try { 68 78 try { 69 throw &(yin){};79 throw (yin){}; 70 80 } catch (yin *) { 71 81 printf("caught yin, will throw yang\n"); 72 throw &(yang){};82 throw (yang){}; 73 83 } catch (yang *) { 74 84 printf("caught exception from same try\n"); … … 83 93 try { 84 94 printf("throwing first exception\n"); 85 throw &(yin){};95 throw (yin){}; 86 96 } catch (yin *) { 87 97 printf("caught first exception\n"); 88 98 try { 89 99 printf("throwing second exception\n"); 90 throw &(yang){};100 throw (yang){}; 91 101 } catch (yang *) { 92 102 printf("caught second exception\n"); … … 104 114 try { 105 115 try { 106 throw &(zen){};107 throw &(zen){};116 throw (zen){}; 117 throw (zen){}; 108 118 } catch (zen *) { 109 119 printf("inner catch\n"); 110 120 } 111 throw &(zen){};121 throw (zen){}; 112 122 } catch (zen *) { 113 123 printf("outer catch\n"); 114 124 } 125 printf("\n"); 126 127 in_void(); 115 128 } 129 130 // Do a throw and rethrow in a void function. 131 void in_void(void) { 132 try { 133 try { 134 printf("throw\n"); 135 throw (zen){}; 136 } catch (zen *) { 137 printf("rethrow\n"); 138 throw; 139 } 140 } catch (zen *) { 141 printf("handle\n"); 142 } 143 } 144
Note:
See TracChangeset
for help on using the changeset viewer.