Changeset 4c8ce47 for tests/exceptions


Ignore:
Timestamp:
Jul 11, 2023, 10:47:49 AM (11 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
b93bf85, ffac259
Parents:
c54ca97
Message:

updated pingpong exception test to remove output race for repeatable test output

Location:
tests/exceptions
Files:
2 edited

Legend:

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

    rc54ca97 r4c8ce47  
    11main start
    2 ping start
    3 pong start
    42pong catchResume 0 0
    53ping catchResume 0 1
     
    103101ping catchResume 97 99
    104102pong catch 98 100
    105 pong end
    106103ping catch 99 101
    107 ping end
    108104main end
  • tests/exceptions/pingpong_nonlocal.cfa

    rc54ca97 r4c8ce47  
    33#include <fstream.hfa>
    44#include <mutex_stmt.hfa>
     5#include <locks.hfa>
    56
    67exception num_ping_pongs { int num; };
     
    1314        Ping_Pong & partner;
    1415};
     16
     17semaphore sync{0};
    1518
    1619void ?{}( Ping_Pong & this, char * name ) with( this ) {
     
    2730                resumeAt( partner, except );
    2831        }
    29         mutex( sout ) sout | name | "start";
     32        // mutex( sout ) sout | name | "start"; // removed to get rid of output race
    3033        try {
    3134                for () {
     
    4245                }
    4346        }
    44         mutex( sout ) sout | name | "end";
     47        // mutex( sout ) sout | name | "end"; // removed to get rid of output race
    4548}
    4649
Note: See TracChangeset for help on using the changeset viewer.