Changeset 3bf9d10 for tests/exceptions/finally.cfa
- Timestamp:
- Jun 21, 2023, 9:45:08 PM (11 months ago)
- Branches:
- master
- Children:
- 6065281f
- Parents:
- 2de175ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/finally.cfa
r2de175ce r3bf9d10 1 1 // Finally Clause Tests 2 2 3 #include <fstream.hfa> 3 4 #include "except-io.hfa" 4 5 … … 12 13 try { 13 14 try { 14 printf("termination throw\n");15 sout | "termination throw"; 15 16 throw exc; 16 17 } finally { 17 18 loud_exit a = "termination inner finally"; 18 printf("finally during unwind\n");19 sout | "finally during unwind"; 19 20 } 20 21 } catch (myth * error) { 21 printf("termination catch\n");22 sout | "termination catch"; 22 23 } finally { 23 24 loud_exit a = "termination outer finally"; 24 printf("finally after catch\n");25 sout | "finally after catch"; 25 26 } 26 printf("\n");27 sout | nl; 27 28 28 29 try { 29 30 try { 30 printf("resumption throw\n");31 sout | "resumption throw"; 31 32 throwResume exc; 32 33 } finally { 33 34 loud_exit a = "resumption inner finally"; 34 printf("finally after resume\n");35 sout | "finally after resume"; 35 36 } 36 37 } catchResume (myth * error) { 37 printf("resumption catch\n");38 sout | "resumption catch"; 38 39 } finally { 39 40 loud_exit a = "resumption outer finally"; 40 printf("finally after catch\n");41 sout | "finally after catch"; 41 42 } 42 printf("\n");43 sout | ""; 43 44 44 45 try { 45 printf("walking out of try\n");46 sout | "walking out of try"; 46 47 } finally { 47 48 loud_exit a = "walking finally"; 48 printf("walking through finally\n");49 sout | "walking through finally"; 49 50 } 50 printf("\n");51 sout | ""; 51 52 52 53 try { 53 printf("jumping out of try\n");54 sout | "jumping out of try"; 54 55 goto endoffunction; 55 56 } finally { 56 57 loud_exit a = "jumping finally"; 57 printf("jumping through finally\n");58 sout | "jumping through finally"; 58 59 } 59 60 endoffunction:
Note: See TracChangeset
for help on using the changeset viewer.