Ignore:
Timestamp:
Jun 21, 2023, 9:45:08 PM (14 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
6065281f
Parents:
2de175ce
Message:

change printf to sout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/defaults.cfa

    r2de175ce r3bf9d10  
    11// Tests for providing new default operations.
    22
     3#include <fstream.hfa>
    34#include <string.h>
    45
     
    3536                throwResume (log_message){&log_vt, "Should be printed.\n"};
    3637        } catchResume (log_message * this) {
    37                 printf("%s", this->virtual_table->msg(this));
     38                sout | this->virtual_table->msg(this) | nonl;
    3839        }
    3940        // But we don't have to:
     
    4445exception jump {};
    4546void defaultTerminationHandler(jump &) {
    46         printf("jump default handler.\n");
     47        sout | "jump default handler.";
    4748}
    4849
     
    5354                throw (jump){&jump_vt};
    5455        } catch (jump * this) {
    55                 printf("jump catch handler.\n");
     56                sout | "jump catch handler.";
    5657        }
    5758        throw (jump){&jump_vt};
     
    7576                throw (first){&first_vt};
    7677        } catch (unhandled_exception * t) {
    77                 printf("Catch unhandled_exception.\n");
     78                sout | "Catch unhandled_exception.";
    7879        }
    7980}
     
    8485void cross_test(void) {
    8586        void defaultTerminationHandler(first &) {
    86                 printf("cross terminate default\n");
     87                sout | "cross terminate default";
    8788                throw (second){&second_vt};
    8889        }
    8990        void defaultResumptionHandler(first &) {
    90                 printf("cross resume default\n");
     91                sout | "cross resume default";
    9192                throwResume (second){&second_vt};
    9293        }
    9394        try {
    94                 printf("cross terminate throw\n");
     95                sout | "cross terminate throw";
    9596                throw (first){&first_vt};
    9697        } catch (second *) {
    97                 printf("cross terminate catch\n");
     98                sout | "cross terminate catch";
    9899        }
    99100        try {
    100                 printf("cross resume throw\n");
     101                sout | "cross resume throw";
    101102                throwResume (first){&first_vt};
    102103        } catchResume (second *) {
    103                 printf("cross resume catch\n");
     104                sout | "cross resume catch";
    104105        }
    105106}
Note: See TracChangeset for help on using the changeset viewer.