Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/defaults.cfa

    r3bf9d10 rc3b9d639  
    11// Tests for providing new default operations.
    22
    3 #include <fstream.hfa>
    43#include <string.h>
    54
     
    3635                throwResume (log_message){&log_vt, "Should be printed.\n"};
    3736        } catchResume (log_message * this) {
    38                 sout | this->virtual_table->msg(this) | nonl;
     37                printf("%s", this->virtual_table->msg(this));
    3938        }
    4039        // But we don't have to:
     
    4544exception jump {};
    4645void defaultTerminationHandler(jump &) {
    47         sout | "jump default handler.";
     46        printf("jump default handler.\n");
    4847}
    4948
     
    5453                throw (jump){&jump_vt};
    5554        } catch (jump * this) {
    56                 sout | "jump catch handler.";
     55                printf("jump catch handler.\n");
    5756        }
    5857        throw (jump){&jump_vt};
     
    7675                throw (first){&first_vt};
    7776        } catch (unhandled_exception * t) {
    78                 sout | "Catch unhandled_exception.";
     77                printf("Catch unhandled_exception.\n");
    7978        }
    8079}
     
    8584void cross_test(void) {
    8685        void defaultTerminationHandler(first &) {
    87                 sout | "cross terminate default";
     86                printf("cross terminate default\n");
    8887                throw (second){&second_vt};
    8988        }
    9089        void defaultResumptionHandler(first &) {
    91                 sout | "cross resume default";
     90                printf("cross resume default\n");
    9291                throwResume (second){&second_vt};
    9392        }
    9493        try {
    95                 sout | "cross terminate throw";
     94                printf("cross terminate throw\n");
    9695                throw (first){&first_vt};
    9796        } catch (second *) {
    98                 sout | "cross terminate catch";
     97                printf("cross terminate catch\n");
    9998        }
    10099        try {
    101                 sout | "cross resume throw";
     100                printf("cross resume throw\n");
    102101                throwResume (first){&first_vt};
    103102        } catchResume (second *) {
    104                 sout | "cross resume catch";
     103                printf("cross resume catch\n");
    105104        }
    106105}
Note: See TracChangeset for help on using the changeset viewer.