Changes in tests/exceptions/defaults.cfa [3bf9d10:c3b9d639]
- File:
-
- 1 edited
-
tests/exceptions/defaults.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/defaults.cfa
r3bf9d10 rc3b9d639 1 1 // Tests for providing new default operations. 2 2 3 #include <fstream.hfa>4 3 #include <string.h> 5 4 … … 36 35 throwResume (log_message){&log_vt, "Should be printed.\n"}; 37 36 } catchResume (log_message * this) { 38 sout | this->virtual_table->msg(this) | nonl;37 printf("%s", this->virtual_table->msg(this)); 39 38 } 40 39 // But we don't have to: … … 45 44 exception jump {}; 46 45 void defaultTerminationHandler(jump &) { 47 sout | "jump default handler.";46 printf("jump default handler.\n"); 48 47 } 49 48 … … 54 53 throw (jump){&jump_vt}; 55 54 } catch (jump * this) { 56 sout | "jump catch handler.";55 printf("jump catch handler.\n"); 57 56 } 58 57 throw (jump){&jump_vt}; … … 76 75 throw (first){&first_vt}; 77 76 } catch (unhandled_exception * t) { 78 sout | "Catch unhandled_exception.";77 printf("Catch unhandled_exception.\n"); 79 78 } 80 79 } … … 85 84 void cross_test(void) { 86 85 void defaultTerminationHandler(first &) { 87 sout | "cross terminate default";86 printf("cross terminate default\n"); 88 87 throw (second){&second_vt}; 89 88 } 90 89 void defaultResumptionHandler(first &) { 91 sout | "cross resume default";90 printf("cross resume default\n"); 92 91 throwResume (second){&second_vt}; 93 92 } 94 93 try { 95 sout | "cross terminate throw";94 printf("cross terminate throw\n"); 96 95 throw (first){&first_vt}; 97 96 } catch (second *) { 98 sout | "cross terminate catch";97 printf("cross terminate catch\n"); 99 98 } 100 99 try { 101 sout | "cross resume throw";100 printf("cross resume throw\n"); 102 101 throwResume (first){&first_vt}; 103 102 } catchResume (second *) { 104 sout | "cross resume catch";103 printf("cross resume catch\n"); 105 104 } 106 105 }
Note:
See TracChangeset
for help on using the changeset viewer.