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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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();
Note: See TracChangeset for help on using the changeset viewer.