Changeset cb344f7 for tests


Ignore:
Timestamp:
Jul 18, 2023, 9:31:57 AM (11 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
ca22a7c
Parents:
a1467c1
Message:

refactored tests to use new syntax for channel ops

Location:
tests/concurrency
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrency/channels/daisy_chain.cfa

    ra1467c1 rcb344f7  
    2323        for ( ;; ) {
    2424            token << *chain;
    25             token >> *chain;
     25            *chain << token;
    2626            runs++;
    2727        }
     
    6060    Channel chainChan{ 1 };
    6161
    62     ((int)0) >> chainChan;
     62    chainChan << ((int)0);
    6363
    6464    chain = &chainChan;   
  • tests/concurrency/waituntil/all_types.cfa

    ra1467c1 rcb344f7  
    9696            Churner c;
    9797            for( long long int j = 0; j < numtimes; j++ ) {
    98                 when( j % 2 == 0 ) waituntil( j >> A ) { total += j; }
     98                when( j % 2 == 0 ) waituntil( A << j ) { total += j; }
    9999                or when( j % 4 < 2 ) waituntil( B ) { produce_b_val( total ); }
    100                 and when( j % 8 < 4 ) waituntil( j >> C ) { total += j; }
     100                and when( j % 8 < 4 ) waituntil( C << j ) { total += j; }
    101101                and waituntil( timeout( 1`ns ) ) {}
    102102                if ( j == numtimes / 2 )
  • tests/concurrency/waituntil/channel_close.cfa

    ra1467c1 rcb344f7  
    1313    try {
    1414        for( long long int i = 0;;i++ ) {
    15             waituntil( (i >> A) ) { inserts++; }
    16             and waituntil( (i >> B) ) { inserts++; }
     15            waituntil( A << i ) { inserts++; }
     16            and waituntil( B << i ) { inserts++; }
    1717        }
    1818    } catch ( channel_closed * e ) {}
  • tests/concurrency/waituntil/channel_zero_size.cfa

    ra1467c1 rcb344f7  
    3737        for( long long int j = 0; j < numtimes; j++ ) {
    3838            // printf("loop\n");
    39             waituntil( j >> A ) { total += j; }
    40             or waituntil( j >> B ) { total += j; }
    41             or waituntil( j >> C ) { total += j; }
     39            waituntil( A << j ) { total += j; }
     40            or waituntil( B << j ) { total += j; }
     41            or waituntil( C << j ) { total += j; }
    4242        }
    4343        printf("sending sentinels\n");
  • tests/concurrency/waituntil/channels.cfa

    ra1467c1 rcb344f7  
    6969            Churner c;
    7070            for( long long int j = 0; j < numtimes; j++ ) {
    71                 when( j % 2 == 0 ) waituntil( j >> A ) { total += j; }
    72                 or when( j % 4 < 2 ) waituntil( j >> B ) { total += j; }
    73                 and when( j % 8 < 4 ) waituntil( j >> C ) { total += j; }
     71                when( j % 2 == 0 ) waituntil( A << j ) { total += j; }
     72                or when( j % 4 < 2 ) waituntil( B << j ) { total += j; }
     73                and when( j % 8 < 4 ) waituntil( C << j ) { total += j; }
    7474            }
    7575            done = true;
  • tests/concurrency/waituntil/one_chan.cfa

    ra1467c1 rcb344f7  
    3131        Server1 s[numServers];
    3232        for( long long int j = 0; j < numtimes; j++ ) {
    33             waituntil( j >> C ) { total += j; }
     33            waituntil( C << j ) { total += j; }
    3434        }
    3535        printf("waiting for empty channels\n");
  • tests/concurrency/waituntil/repeat_close.cfa

    ra1467c1 rcb344f7  
    1515    try {
    1616        for( long long int i = 0;;i++ ) {
    17             waituntil( (i >> A) ) { A_i++; }
    18             and waituntil( (i >> B) ) { B_i++; }
    19             and waituntil( (i >> C) ) { C_i++; }
    20             and waituntil( (i >> D) ) { D_i++; }
    21             and waituntil( (i >> E) ) { E_i++; }
    22             and waituntil( (i >> F) ) { F_i++; }
     17            waituntil( A << i ) { A_i++; }
     18            and waituntil( B << i ) { B_i++; }
     19            and waituntil( C << i ) { C_i++; }
     20            and waituntil( D << i ) { D_i++; }
     21            and waituntil( E << i ) { E_i++; }
     22            and waituntil( F << i ) { F_i++; }
    2323        }
    2424    } catch ( channel_closed * e ) {}
     
    3131    try {
    3232        for( ;; ) {
    33             waituntil( remove(F) ) { F_removes++; }
    34             or waituntil( remove(E) ) { E_removes++; }
    35             or waituntil( remove(D) ) { D_removes++; }
    36             or waituntil( remove(C) ) { C_removes++; }
    37             or waituntil( remove(B) ) { B_removes++; }
    38             or waituntil( remove(A) ) { A_removes++; }
     33            waituntil( in << F ) { F_removes++; }
     34            or waituntil( in << E ) { E_removes++; }
     35            or waituntil( in << D ) { D_removes++; }
     36            or waituntil( in << C ) { C_removes++; }
     37            or waituntil( in << B ) { B_removes++; }
     38            or waituntil( in << A ) { A_removes++; }
    3939        }
    4040    } catchResume ( channel_closed * e ) { } // continue to remove until would block
Note: See TracChangeset for help on using the changeset viewer.