Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/interact.cfa

    r3eb5a478 re68d092  
    11// Testing Interactions Between Termination and Resumption
    22
    3 #include "except-mac.hfa"
     3#include <exception.hfa>
    44#include "except-io.hfa"
    55
     
    1010        // Resume falls back to terminate.
    1111        try {
    12                 THROW_RESUME(&(star){});
     12                throwResume &(star){};
    1313        } catch (star *) {
    1414                printf("caught as termination\n");
     
    1717        try {
    1818                loud_region a = "try block with resume throw";
    19                 THROW_RESUME(&(star){});
     19                throwResume &(star){};
    2020        } catch (star *) {
    2121                printf("caught as termination\n");
     
    2929        try {
    3030                try {
    31                         THROW(&(star){});
     31                        throw &(star){};
    3232                } catchResume (star *) {
    3333                        printf("resume catch on terminate\n");
     
    4343        try {
    4444                try {
    45                         THROW_RESUME(&(star){});
     45                        throwResume &(star){};
    4646                } catch (star *) {
    4747                        printf("terminate catch on resume\n");
     
    5858                try {
    5959                        try {
    60                                 THROW(&(star){});
     60                                throw &(star){};
    6161                        } catchResume (star *) {
    6262                                printf("inner resume catch (error)\n");
     
    6464                } catch (star * error) {
    6565                        printf("termination catch, will resume\n");
    66                         THROW_RESUME(error);
     66                        throwResume error;
    6767                }
    6868        } catchResume (star *) {
     
    7575                try {
    7676                        try {
    77                                 THROW_RESUME(&(star){});
     77                                throwResume &(star){};
    7878                        } catch (star *) {
    7979                                printf("inner termination catch\n");
     
    8181                } catchResume (star * error) {
    8282                        printf("resumption catch, will terminate\n");
    83                         THROW(error);
     83                        throw error;
    8484                }
    8585        } catch (star *) {
    8686                printf("outer terminate catch (error)\n");
    8787        }
    88 #if 0
    8988        printf("\n");
    9089
     
    9594                                try {
    9695                                        printf("throwing resume moon\n");
    97                                         THROW_RESUME(&(moon){});
     96                                        throwResume &(moon){};
    9897                                } catch (star *) {
    9998                                        printf("termination catch\n");
    10099                                }
    101100                                printf("throwing resume star\n");
    102                                 THROW_RESUME(&(star){});
     101                                throwResume &(star){};
    103102                        } catchResume (star *) {
    104103                                printf("resumption star catch\n");
     
    106105                } catchResume (moon *) {
    107106                        printf("resumption moon catch, will terminate\n");
    108                         THROW(&(star){});
     107                        throw &(star){};
    109108                }
    110109        } catchResume (star *) {
    111110                printf("outermost catch (error)\n");
    112111        }
    113 #endif
    114112}
Note: See TracChangeset for help on using the changeset viewer.