Changeset 3bf9d10


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

change printf to sout

Location:
tests/exceptions
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/.expect/polymorphic.txt

    r2de175ce r3bf9d10  
    44
    55-7
    6 0
    7 1
     6false
     7true
  • tests/exceptions/cancel/coroutine.cfa

    r2de175ce r3bf9d10  
    11// Try cancelling a coroutine.
    22
     3#include <fstream.hfa>
    34#include <coroutine.hfa>
    45
     
    1314
    1415void main(WillCancel & wc) {
    15         printf("1");
     16        sout | '1';
    1617        cancel_stack((internal_error){&internal_vt});
    17         printf("!");
     18        sout | '!';
    1819}
    1920
    2021int main(int argc, char * argv[]) {
     22        sout | nlOff;
    2123        WillCancel cancel;
    2224        try {
    23                 printf("0");
     25                sout | '0';
    2426                resume(cancel);
    25                 printf("4");
     27                sout | '4';
    2628        } catchResume (CoroutineCancelled(WillCancel) * error) {
    27                 printf("2");
     29                sout | '2';
    2830                if ((virtual internal_error *)error->the_exception) {
    29                         printf("3");
     31                        sout | '3';
    3032                }
    3133        }
    32         printf("5\n");
     34        sout | '5' | nl;
    3335}
  • tests/exceptions/cancel/thread.cfa

    r2de175ce r3bf9d10  
    11// Try cancelling a thread.
    22
     3#include <fstream.hfa>
    34#include <thread.hfa>
    45
     
    1314
    1415void main(WillCancel &) {
    15         printf("1");
     16        sout | '1';
    1617        cancel_stack((internal_error){&internal_vt});
    17         printf("!");
     18        sout | '!';
    1819}
    1920
    2021void explicit() {
    2122        try {
    22                 printf("0");
     23                sout | '0';
    2324                WillCancel cancel;
    24                 printf("1");
     25                sout | '1';
    2526                join(cancel);
    26                 printf("4");
     27                sout | '4';
    2728        } catchResume (ThreadCancelled(WillCancel) * error) {
    28                 printf("2");
     29                sout | '2';
    2930                if ((virtual internal_error *)error->the_exception) {
    30                         printf("3");
     31                        sout | '3';
    3132                }
    3233        }
    33         printf("5\n");
     34        sout | '5' | nl;
    3435}
    3536
     
    3738        try {
    3839                {
    39                         printf("0");
     40                        sout | '0';
    4041                        WillCancel cancel;
    41                         printf("1");
     42                        sout | '1';
    4243                }
    43                 printf("4");
     44                sout | '4';
    4445        } catchResume (ThreadCancelled(WillCancel) * error) {
    45                 printf("2");
     46                sout | '2';
    4647                if ((virtual internal_error *)error->the_exception) {
    47                         printf("3");
     48                        sout | '3';
    4849                }
    4950        }
    50         printf("5\n");
     51        sout | '5' | nl;
    5152}
    5253
    5354int main(int argc, char * argv[]) {
     55        sout | nlOff;
    5456        explicit();
    5557        implicit();
  • tests/exceptions/conditional.cfa

    r2de175ce r3bf9d10  
    33// I may fold this back into terminate.cfa and resume.cfa once setting
    44// up the non-trivial exception is reasonable to do.
     5
     6#include <fstream.cfa>
    57
    68exception num_error {
     
    1113
    1214void caught_num_error(int expect, num_error * actual) {
    13         printf("Caught num_error: expected=%d actual=%d.\n", expect, actual->num);
     15        sout | "Caught num_error: expected=" | expect | "actual=" | actual->num | '.';
    1416}
    1517
  • tests/exceptions/data-except.cfa

    r2de175ce r3bf9d10  
    11// Test exceptions that add data but no functionality.
     2
     3#include <fstream.cfa>
    24
    35exception paired {
     
    1820                throw except;
    1921        } catch (paired * exc) {
    20                 printf("%s(%d, %d)\n", virtual_msg(exc), exc->first, exc->second);
     22                sout | virtual_msg(exc) | '(' | exc->first | ", " | exc->second | ')';
    2123                ++exc->first;
    2224        }
    2325
    24         printf("%s(%d, %d)\n", virtual_msg(&except), except.first, except.second);
     26        sout | virtual_msg(&except) | '(' | except.first | ", " | except.second | ')';
    2527
    2628        try {
    2729                throwResume except;
    2830        } catchResume (paired * exc) {
    29                 printf("%s(%d, %d)\n", virtual_msg(exc), exc->first, exc->second);
     31                sout | virtual_msg(exc) | '(' | exc->first | ", " | exc->second | ')';
    3032                ++exc->first;
    3133        }
    3234
    33         printf("%s(%d, %d)\n", virtual_msg(&except), except.first, except.second);
     35        sout | virtual_msg(&except) | '(' | except.first | ", " | except.second | ')';
    3436}
  • 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}
  • tests/exceptions/except-io.hfa

    r2de175ce r3bf9d10  
    22
    33// Echo when a destructor is run and an area/block is left.
     4
     5#include <fstream.hfa>
     6
    47struct loud_exit {
    58    const char * area;
     
    1114
    1215inline void ^?{}(loud_exit & this) {
    13     printf("Exiting: %s\n", this.area);
     16    sout | "Exiting: " | this.area;
    1417}
    1518
     
    2023inline void ?{}(loud_region & this, const char * region) {
    2124        this.region = region;
    22         printf("Entering: %s\n", region);
     25        sout | "Entering: " | region;
    2326}
    2427
    2528inline void ^?{}(loud_region & this) {
    26         printf("Exiting: %s\n", this.region);
     29        sout | "Exiting: " | this.region;
    2730}
  • tests/exceptions/finally.cfa

    r2de175ce r3bf9d10  
    11// Finally Clause Tests
    22
     3#include <fstream.hfa>
    34#include "except-io.hfa"
    45
     
    1213        try {
    1314                try {
    14                         printf("termination throw\n");
     15                        sout | "termination throw";
    1516                        throw exc;
    1617                } finally {
    1718                        loud_exit a = "termination inner finally";
    18                         printf("finally during unwind\n");
     19                        sout | "finally during unwind";
    1920                }
    2021        } catch (myth * error) {
    21                 printf("termination catch\n");
     22                sout | "termination catch";
    2223        } finally {
    2324                loud_exit a = "termination outer finally";
    24                 printf("finally after catch\n");
     25                sout | "finally after catch";
    2526        }
    26         printf("\n");
     27        sout | nl;
    2728
    2829        try {
    2930                try {
    30                         printf("resumption throw\n");
     31                        sout | "resumption throw";
    3132                        throwResume exc;
    3233                } finally {
    3334                        loud_exit a = "resumption inner finally";
    34                         printf("finally after resume\n");
     35                        sout | "finally after resume";
    3536                }
    3637        } catchResume (myth * error) {
    37                 printf("resumption catch\n");
     38                sout | "resumption catch";
    3839        } finally {
    3940                loud_exit a = "resumption outer finally";
    40                 printf("finally after catch\n");
     41                sout | "finally after catch";
    4142        }
    42         printf("\n");
     43        sout | "";
    4344
    4445        try {
    45                 printf("walking out of try\n");
     46                sout | "walking out of try";
    4647        } finally {
    4748                loud_exit a = "walking finally";
    48                 printf("walking through finally\n");
     49                sout | "walking through finally";
    4950        }
    50         printf("\n");
     51        sout | "";
    5152
    5253        try {
    53                 printf("jumping out of try\n");
     54                sout | "jumping out of try";
    5455                goto endoffunction;
    5556        } finally {
    5657                loud_exit a = "jumping finally";
    57                 printf("jumping through finally\n");
     58                sout | "jumping through finally";
    5859        }
    5960        endoffunction:
  • tests/exceptions/interact.cfa

    r2de175ce r3bf9d10  
    11// Testing Interactions Between Termination and Resumption
    22
     3#include <fstream.hfa>
    34#include "except-io.hfa"
    45
     
    1415                throwResume (star){&star_vt};
    1516        } catch (star *) {
    16                 printf("caught as termination\n");
     17                sout | "caught as termination";
    1718        }
    1819        // Variant of the above to check timing.
     
    2122                throwResume (star){&star_vt};
    2223        } catch (star *) {
    23                 printf("caught as termination\n");
     24                sout | "caught as termination";
    2425        } catchResume (star *) {
    25                 printf("intermediate rethrow\n");
     26                sout | "intermediate rethrow";
    2627                throwResume;
    2728        }
    28         printf("\n");
     29        sout | nl;
    2930
    3031        // Resume does not catch terminate.
     
    3334                        throw (star){&star_vt};
    3435                } catchResume (star *) {
    35                         printf("resume catch on terminate\n");
     36                        sout | "resume catch on terminate";
    3637                }
    3738        } catchResume (star *) {
    38                 printf("resume catch on terminate\n");
     39                sout | "resume catch on terminate";
    3940        } catch (star *) {
    40                 printf("terminate catch on terminate\n");
     41                sout | "terminate catch on terminate";
    4142        }
    42         printf("\n");
     43        sout | nl;
    4344
    4445        // Terminate does not catch resume.
     
    4748                        throwResume (star){&star_vt};
    4849                } catch (star *) {
    49                         printf("terminate catch on resume\n");
     50                        sout | "terminate catch on resume";
    5051                }
    5152        } catch (star *) {
    52                 printf("terminate catch on resume\n");
     53                sout | "terminate catch on resume";
    5354        } catchResume (star *) {
    54                 printf("resume catch on resume\n");
     55                sout | "resume catch on resume";
    5556        }
    56         printf("\n");
     57        sout | nl;
    5758
    5859        // Resume a termination exception.
     
    6263                                throw (star){&star_vt};
    6364                        } catchResume (star *) {
    64                                 printf("inner resume catch (error)\n");
     65                                sout | "inner resume catch (error)";
    6566                        }
    6667                } catch (star * error) {
    67                         printf("termination catch, will resume\n");
     68                        sout | "termination catch, will resume";
    6869                        throwResume *error;
    6970                }
    7071        } catchResume (star *) {
    71                 printf("outer resume catch\n");
     72                sout | "outer resume catch";
    7273        }
    73         printf("\n");
     74        sout | nl;
    7475
    7576        // Terminate a resumption exception.
     
    7980                                throwResume (star){&star_vt};
    8081                        } catch (star *) {
    81                                 printf("inner termination catch\n");
     82                                sout | "inner termination catch";
    8283                        }
    8384                } catchResume (star * error) {
    84                         printf("resumption catch, will terminate\n");
     85                        sout | "resumption catch, will terminate";
    8586                        throw *error;
    8687                }
    8788        } catch (star *) {
    88                 printf("outer terminate catch (error)\n");
     89                sout | "outer terminate catch (error)";
    8990        }
    90         printf("\n");
     91        sout | nl;
    9192
    9293        // Unwinding a resumption catch does not break the system.
     
    9596                        try {
    9697                                try {
    97                                         printf("throwing resume moon\n");
     98                                        sout | "throwing resume moon";
    9899                                        throwResume (moon){&moon_vt};
    99100                                } catch (star *) {
    100                                         printf("termination catch\n");
     101                                        sout | "termination catch";
    101102                                }
    102                                 printf("throwing resume star\n");
     103                                sout | "throwing resume star";
    103104                                throwResume (star){&star_vt};
    104105                        } catchResume (star *) {
    105                                 printf("resumption star catch\n");
     106                                sout | "resumption star catch";
    106107                        }
    107108                } catchResume (moon *) {
    108                         printf("resumption moon catch, will terminate\n");
     109                        sout | "resumption moon catch, will terminate";
    109110                        throw (star){&star_vt};
    110111                }
    111112        } catchResume (star *) {
    112                 printf("outermost catch (error)\n");
     113                sout | "outermost catch (error)";
    113114        }
    114115}
  • tests/exceptions/polymorphic.cfa

    r2de175ce r3bf9d10  
    11// Testing polymophic exception types.
     2
     3#include <fstream.hfa>
    24
    35forall(T &) exception proxy {};
     
    1315                throw an_int;
    1416        } catch (proxy(int) *) {
    15                 printf("terminate catch\n");
     17                sout | "terminate catch";
    1618        }
    1719
     
    1921                throwResume a_char;
    2022        } catchResume (proxy(char) *) {
    21                 printf("resume catch\n");
     23                sout | "resume catch";
    2224        }
    2325
     
    2527                throw a_char;
    2628        } catch (proxy(int) *) {
    27                 printf("caught proxy(int)\n");
     29                sout | "caught proxy(int)";
    2830        } catch (proxy(char) *) {
    29                 printf("caught proxy(char)\n");
     31                sout | "caught proxy(char)";
    3032        }
    3133}
     
    4446                throw except;
    4547        } catch (cell(int) * error) {
    46                 printf("%d\n", error->data);
     48                sout | error->data;
    4749        }
    4850
     
    5052                cell(bool) ball = {&bool_cell, false};
    5153                throwResume ball;
    52                 printf("%i\n", ball.data);
     54                sout | ball.data;
    5355        } catchResume (cell(bool) * error) {
    54                 printf("%i\n", error->data);
     56                sout | error->data;
    5557                error->data = true;
    5658        }
     
    5961int main(int argc, char * argv[]) {
    6062        proxy_test();
    61         printf("\n");
     63        sout | nl;
    6264        cell_test();
    6365}
  • tests/exceptions/resume.cfa

    r2de175ce r3bf9d10  
    11// Resumption Exception Tests
    22
     3#include <fstream.hfa>
    34#include "except-io.hfa"
    45
     
    2122        try {
    2223                loud_exit a = "simple try clause";
    23                 printf("simple throw\n");
     24                sout | "simple throw";
    2425                throwResume a_zen;
    25                 printf("end of try clause\n");
     26                sout | "end of try clause";
    2627        } catchResume (zen * error) {
    2728                loud_exit a = "simple catch clause";
    28                 printf("simple catch\n");
     29                sout | "simple catch";
    2930        }
    30         printf("\n");
     31        sout | nl;
    3132
    3233        // Throw catch-all test.
     
    3435                throwResume a_zen;
    3536        } catchResume (exception_t * error) {
    36                 printf("catch-all\n");
     37                sout | "catch-all";
    3738        }
    38         printf("\n");
     39        sout | nl;
    3940
    4041        // Don't catch if handler does not match exception.
     
    4344                        throwResume a_yin;
    4445                } catchResume (zen *) {
    45                         printf("caught yin as zen\n");
     46                        sout | "caught yin as zen";
    4647                }
    4748        } catchResume (yang *) {
    48                 printf("caught yin as yang\n");
     49                sout | "caught yin as yang";
    4950        } catchResume (yin *) {
    50                 printf("caught yin as yin\n");
     51                sout | "caught yin as yin";
    5152        }
    52         printf("\n");
     53        sout | nl;
    5354
    5455        // Test rethrowing an exception.
     
    5657                try {
    5758                        loud_exit a = "rethrow inner try";
    58                         printf("rethrow inner try\n");
     59                        sout | "rethrow inner try";
    5960                        throwResume a_zen;
    6061                } catchResume (zen *) {
    6162                        loud_exit a = "rethrowing catch clause";
    62                         printf("caught throw, will rethrow\n");
     63                        sout | "caught throw, will rethrow";
    6364                        throwResume;
    6465                }
    6566        } catchResume (zen *) {
    6667                loud_exit a = "rethrow catch clause";
    67                 printf("caught rethrow\n");
     68                sout | "caught rethrow";
    6869        }
    69         printf("\n");
     70        sout | nl;
    7071
    7172        // Throw a different exception in a catch.
     
    7475                        throwResume a_yin;
    7576                } catchResume (yin *) {
    76                         printf("caught yin, will throw yang\n");
     77                        sout | "caught yin, will throw yang";
    7778                        throwResume a_yang;
    7879                } catchResume (yang *) {
    79                         printf("caught exception from same try\n");
     80                        sout | "caught exception from same try";
    8081                }
    8182        } catchResume (yang *) {
    82                 printf("caught yang\n");
     83                sout | "caught yang";
    8384        }
    84         printf("\n");
     85        sout | nl;
    8586
    8687        // Another throw in the catch does not interfere.
    8788        try {
    8889                try {
    89                         printf("throwing first exception\n");
     90                        sout | "throwing first exception";
    9091                        throwResume a_yin;
    9192                } catchResume (yin *) {
    92                         printf("caught first exception\n");
     93                        sout | "caught first exception";
    9394                        try {
    94                                 printf("throwing second exception\n");
     95                                sout | "throwing second exception";
    9596                                throwResume a_yang;
    9697                        } catchResume (yang *) {
    97                                 printf("caught second exception\n");
     98                                sout | "caught second exception";
    9899                        }
    99100                        throwResume;
    100101                }
    101102        } catchResume (yin *) {
    102                 printf("recaught first exception\n");
     103                sout | "recaught first exception";
    103104        } catchResume (yang *) {
    104                 printf("caught second exception (bad location)\n");
     105                sout | "caught second exception (bad location)";
    105106        }
    106         printf("\n");
     107        sout | nl;
    107108
    108109        // Check successive operations.
     
    112113                        throwResume a_zen;
    113114                } catchResume (zen *) {
    114                         printf("inner catch\n");
     115                        sout | "inner catch";
    115116                }
    116117                throwResume a_zen;
    117118        } catchResume (zen *) {
    118                 printf("outer catch\n");
     119                sout | "outer catch";
    119120        }
    120         printf("\n");
     121        sout | nl;
    121122
    122123        in_void();
     
    128129        try {
    129130                try {
    130                         printf("throw\n");
     131                        sout | "throw";
    131132                        throwResume a_zen;
    132133                } catchResume (zen *) {
    133                         printf("rethrow\n");
     134                        sout | "rethrow";
    134135                        throwResume;
    135136                }
    136137        } catchResume (zen *) {
    137                 printf("handle\n");
     138                sout | "handle";
    138139        }
    139140}
  • tests/exceptions/terminate.cfa

    r2de175ce r3bf9d10  
    11// Termination Exception Tests
    22
     3#include <fstream.hfa>
    34#include "except-io.hfa"
    45
     
    2122        try {
    2223                loud_exit a = "simple try clause";
    23                 printf("simple throw\n");
     24                sout | "simple throw";
    2425                throw a_zen;
    25                 printf("end of try clause\n");
     26                sout | "end of try clause";
    2627        } catch (zen * error) {
    2728                loud_exit a = "simple catch clause";
    28                 printf("simple catch\n");
     29                sout | "simple catch";
    2930        }
    30         printf("\n");
     31        sout | nl;
    3132
    3233        // Throw catch-all test.
     
    3435                throw a_zen;
    3536        } catch (exception_t * error) {
    36                 printf("catch-all\n");
     37                sout | "catch-all";
    3738        }
    38         printf("\n");
     39        sout | nl;
    3940
    4041        // Don't catch if handler does not match exception.
     
    4344                        throw a_yin;
    4445                } catch (zen *) {
    45                         printf("caught yin as zen\n");
     46                        sout | "caught yin as zen";
    4647                }
    4748        } catch (yang *) {
    48                 printf("caught yin as yang\n");
     49                sout | "caught yin as yang";
    4950        } catch (yin *) {
    50                 printf("caught yin as yin\n");
     51                sout | "caught yin as yin";
    5152        }
    52         printf("\n");
     53        sout | nl;
    5354
    5455        // Test rethrowing an exception.
     
    5657                try {
    5758                        loud_exit a = "rethrow inner try";
    58                         printf("rethrow inner try\n");
     59                        sout | "rethrow inner try";
    5960                        throw a_zen;
    6061                } catch (zen *) {
    6162                        loud_exit a = "rethrowing catch clause";
    62                         printf("caught throw, will rethrow\n");
     63                        sout | "caught throw, will rethrow";
    6364                        throw;
    6465                }
    6566        } catch (zen *) {
    6667                loud_exit a = "rethrow catch clause";
    67                 printf("caught rethrow\n");
     68                sout | "caught rethrow";
    6869        }
    69         printf("\n");
     70        sout | nl;
    7071
    7172        // Throw a different exception in a catch.
     
    7475                        throw a_yin;
    7576                } catch (yin *) {
    76                         printf("caught yin, will throw yang\n");
     77                        sout | "caught yin, will throw yang";
    7778                        throw a_yang;
    7879                } catch (yang *) {
    79                         printf("caught exception from same try\n");
     80                        sout | "caught exception from same try";
    8081                }
    8182        } catch (yang *) {
    82                 printf("caught yang\n");
     83                sout | "caught yang";
    8384        }
    84         printf("\n");
     85        sout | nl;
    8586
    8687        // Another throw in the catch does not interfere.
    8788        try {
    8889                try {
    89                         printf("throwing first exception\n");
     90                        sout | "throwing first exception";
    9091                        throw a_yin;
    9192                } catch (yin *) {
    92                         printf("caught first exception\n");
     93                        sout | "caught first exception";
    9394                        try {
    94                                 printf("throwing second exception\n");
     95                                sout | "throwing second exception";
    9596                                throw a_yang;
    9697                        } catch (yang *) {
    97                                 printf("caught second exception\n");
     98                                sout | "caught second exception";
    9899                        }
    99100                        throw;
    100101                }
    101102        } catch (yin *) {
    102                 printf("recaught first exception\n");
     103                sout | "recaught first exception";
    103104        } catch (yang *) {
    104                 printf("caught second exception (bad location)\n");
     105                sout | "caught second exception (bad location)";
    105106        }
    106         printf("\n");
     107        sout | nl;
    107108
    108109        // Check successive operations.
     
    112113                        throw a_zen;
    113114                } catch (zen *) {
    114                         printf("inner catch\n");
     115                        sout | "inner catch";
    115116                }
    116117                throw a_zen;
    117118        } catch (zen *) {
    118                 printf("outer catch\n");
     119                sout | "outer catch";
    119120        }
    120         printf("\n");
     121        sout | nl;
    121122
    122123        in_void();
     
    128129        try {
    129130                try {
    130                         printf("throw\n");
     131                        sout | "throw";
    131132                        throw a_zen;
    132133                } catch (zen *) {
    133                         printf("rethrow\n");
     134                        sout | "rethrow";
    134135                        throw;
    135136                }
    136137        } catch (zen *) {
    137                 printf("handle\n");
     138                sout | "handle";
    138139        }
    139140}
  • tests/exceptions/trash.cfa

    r2de175ce r3bf9d10  
    11// Make sure throw-catch during unwind does not trash internal data.
     2
     3#include <fstream.hfa>
    24
    35exception yin {};
     
    1517                                throw (yang){&yang_vt};
    1618                        } catch (yin *) {
    17                                 printf("inner yin\n");
     19                                sout | "inner yin";
    1820                        } catch (yang *) {
    19                                 printf("inner yang\n");
     21                                sout | "inner yang";
    2022                        }
    2123                }
    2224        } catch (yin *) {
    23                 printf("outer yin\n");
     25                sout | "outer yin";
    2426        } catch (yang *) {
    25                 printf("outer yang\n");
     27                sout | "outer yang";
    2628        }
    2729}
  • tests/exceptions/virtual-cast.cfa

    r2de175ce r3bf9d10  
    99 */
    1010
     11#include <fstream.hfa>
    1112#include <stdlib.hfa>
    1213#include <assert.h>
    13 
    14 
    1514
    1615// Hand defined alpha virtual type:
     
    106105        free(tri);
    107106        free(top);
    108         printf( "done\n" );                             // non-empty .expect file
     107        sout | "done";                                                                          // non-empty .expect file
    109108}
  • tests/exceptions/virtual-poly.cfa

    r2de175ce r3bf9d10  
    66 */
    77
     8#include <fstream.hfa>
    89#include <assert.h>
    910
     
    105106        mono_poly_test();
    106107        poly_poly_test();
    107         printf( "done\n" );
     108        sout | "done";
    108109}
Note: See TracChangeset for help on using the changeset viewer.