Changeset 2a301ff for tests


Ignore:
Timestamp:
Aug 31, 2023, 11:31:15 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
950c58e
Parents:
92355883 (diff), 686912c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolve conflict

Location:
tests
Files:
25 added
8 deleted
51 edited
15 moved

Legend:

Unmodified
Added
Removed
  • tests/.expect/alloc.txt

    r92355883 r2a301ff  
    66
    77C   array calloc, fill 0
    8 0 0 0 0 0 0 0 0 0 0
     80x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
    99CFA array calloc, fill 0
    10 0 0 0 0 0 0 0 0 0 0
     100x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
    1111CFA array alloc, no fill
    12120xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef
  • tests/.expect/typedefRedef-ERR1.txt

    r92355883 r2a301ff  
    11typedefRedef.cfa:75:25: warning: Compiled
    22typedefRedef.cfa:4:1 error: Cannot redefine typedef: Foo
     3typedefRedef.cfa:31:1 error: Cannot redefine typedef: ARR
    34typedefRedef.cfa:65:1 error: Cannot redefine typedef: ARR
  • tests/Makefile.am

    r92355883 r2a301ff  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sun May 28 08:15:43 2023
    14 ## Update Count     : 196
     13## Last Modified On : Wed Aug 30 22:31:45 2023
     14## Update Count     : 197
    1515###############################################################################
    1616
     
    9191        concurrency/unified_locking/mutex_test.hfa \
    9292        concurrency/channels/parallel_harness.hfa \
    93         array-container/dimexpr-match.hfa \
    94         array-container/dimexpr-match-detail.sh
     93        array-collections/dimexpr-match.hfa \
     94        array-collections/dimexpr-match-detail.sh
    9595
    9696dist-hook:
     
    227227        -cp ${test} ${abspath ${@}}
    228228
    229 array-container/dimexpr-match-c-ERRS : array-container/dimexpr-match-c.cfa
     229array-collections/dimexpr-match-c-ERRS : array-collections/dimexpr-match-c.cfa
    230230        ${CFACOMPILE_SYNTAX} -DERRS
    231231        -cp ${test} ${abspath ${@}}
    232232
    233 array-container/dimexpr-match-cfa-ERRS : array-container/dimexpr-match-cfa.cfa
     233array-collections/dimexpr-match-cfa-ERRS : array-collections/dimexpr-match-cfa.cfa
    234234        ${CFACOMPILE_SYNTAX} -DERRS
    235235        -cp ${test} ${abspath ${@}}
  • tests/PRNG.cfa

    r92355883 r2a301ff  
    1010// Created On       : Wed Dec 29 09:38:12 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 25 15:39:52 2023
    13 // Update Count     : 422
     12// Last Modified On : Mon Aug 14 08:49:53 2023
     13// Update Count     : 425
    1414//
    1515
     
    2727#define str(s) #s
    2828
    29 #if defined( __x86_64__ ) || defined( __aarch64__ )             // 64-bit architecture
    30 #define PRNG PRNG64
    31 #else                                                                                                   // 32-bit architecture
    32 #define PRNG PRNG32
    33 #endif // __x86_64__
    34 
    3529//#define TIME
    3630
     
    144138        srand( rseed );
    145139
    146         sout | sepDisable;
     140        sout | sepOff;
    147141        sout | nl | wd(26, "rand()" ) | wd(12, "rand(5)") | wd(12, "rand(0,5)" );
    148142        for ( 20 ) {
     
    151145                sout | wd(12, rand() % (5 - 0 + 1) + 0);
    152146        } // for
    153         sout | sepEnable;
     147        sout | sepOn;
    154148        sout | "seed" | rseed;
    155149
     
    185179        if ( seed != 0 ) set_seed( prng, seed );
    186180
    187         sout | sepDisable;
     181        sout | sepOff;
    188182        sout | nl | wd(26, "PRNG()" ) | wd(12, "PRNG(5)") | wd(12, "PRNG(0,5)" );
    189183        for ( 20 ) {
     
    192186                sout | wd(12, prng( prng, 0, 5 ));
    193187        } // for
    194         sout | sepEnable;
     188        sout | sepOn;
    195189        sout | "seed" | get_seed( prng );
    196190
     
    220214        if ( seed != 0 ) set_seed( seed );
    221215
    222         sout | sepDisable;
     216        sout | sepOff;
    223217        sout | nl | wd(26, "prng()" ) | wd(12, "prng(5)") | wd(12, "prng(0,5)" );
    224218        for ( 20 ) {
     
    227221                sout | wd(12, prng( 0, 5 ));
    228222        } // for
    229         sout | sepEnable;
     223        sout | sepOn;
    230224        sout | "seed" | get_seed( prng );
    231225
     
    256250        thread$ & th = *active_thread();
    257251
    258         sout | sepDisable;
     252        sout | sepOff;
    259253        sout | nl | wd(26, "prng(t)" ) | wd(12, "prng(t,5)") | wd(12, "prng(t,0,5)" );
    260254        for ( 20 ) {
     
    263257                sout | wd(12, prng( th, 0, 5 ));
    264258        } // for
    265         sout | sepEnable;
     259        sout | sepOn;
    266260        sout | "seed" | get_seed( prng );
    267261
  • tests/array-collections/.expect/dimexpr-match-c.txt

    r92355883 r2a301ff  
    1313skip STA NE UNS, L=enu7, R=mut42
    1414done DYN EQ DYN, L=cpr7, R=cpr7
    15 done DYN NE DYN, L=cpr7, R=cpr42
     15skip DYN NE DYN, L=cpr7, R=cpr42
    1616skip DYN NE STA, L=cpr7, R=42
    1717skip DYN NE STA, L=cpr7, R=enu42
    18 done DYN NE UNS, L=cpr7, R=mut42
    19 done UNS EQ UNS, L=mut7, R=mut7
    20 done UNS NE UNS, L=mut7, R=mut42
     18skip DYN NE UNS, L=cpr7, R=mut42
     19skip UNS EQ UNS, L=mut7, R=mut7
     20skip UNS NE UNS, L=mut7, R=mut42
    2121skip UNS NE STA, L=mut7, R=42
    2222skip UNS NE STA, L=mut7, R=enu42
    23 done UNS NE DYN, L=mut7, R=cpr42
     23skip UNS NE DYN, L=mut7, R=cpr42
     24skip STA NE DYN, L=7, R=dim42
     25skip STA NE DYN, L=enu7, R=dim42
     26skip DYN NE DYN, L=cpr7, R=dim42
     27done DYN EQ DYN, L=dim7, R=dim7
     28skip DYN NE DYN, L=dim7, R=dim42
     29skip DYN NE STA, L=dim7, R=42
     30skip DYN NE STA, L=dim7, R=enu42
     31skip DYN NE DYN, L=dim7, R=cpr42
     32skip DYN NE UNS, L=dim7, R=mut42
     33skip UNS NE DYN, L=mut7, R=dim42
    2434---- PTRVAR_INIT:   { float a[__R__]; float (*b)[__L__] = & a; }
    2535done STA EQ STA, L=7, R=7
     
    3646skip STA NE UNS, L=enu7, R=mut42
    3747done DYN EQ DYN, L=cpr7, R=cpr7
    38 done DYN NE DYN, L=cpr7, R=cpr42
     48skip DYN NE DYN, L=cpr7, R=cpr42
    3949skip DYN NE STA, L=cpr7, R=42
    4050skip DYN NE STA, L=cpr7, R=enu42
    41 done DYN NE UNS, L=cpr7, R=mut42
    42 done UNS EQ UNS, L=mut7, R=mut7
    43 done UNS NE UNS, L=mut7, R=mut42
     51skip DYN NE UNS, L=cpr7, R=mut42
     52skip UNS EQ UNS, L=mut7, R=mut7
     53skip UNS NE UNS, L=mut7, R=mut42
    4454skip UNS NE STA, L=mut7, R=42
    4555skip UNS NE STA, L=mut7, R=enu42
    46 done UNS NE DYN, L=mut7, R=cpr42
     56skip UNS NE DYN, L=mut7, R=cpr42
     57skip STA NE DYN, L=7, R=dim42
     58skip STA NE DYN, L=enu7, R=dim42
     59skip DYN NE DYN, L=cpr7, R=dim42
     60done DYN EQ DYN, L=dim7, R=dim7
     61skip DYN NE DYN, L=dim7, R=dim42
     62skip DYN NE STA, L=dim7, R=42
     63skip DYN NE STA, L=dim7, R=enu42
     64skip DYN NE DYN, L=dim7, R=cpr42
     65skip DYN NE UNS, L=dim7, R=mut42
     66skip UNS NE DYN, L=mut7, R=dim42
    4767---- PTRVAR_ASGN:   { float a[__R__]; float (*b)[__L__] = 0p; b = & a; }
    4868done STA EQ STA, L=7, R=7
     
    5979skip STA NE UNS, L=enu7, R=mut42
    6080done DYN EQ DYN, L=cpr7, R=cpr7
    61 done DYN NE DYN, L=cpr7, R=cpr42
     81skip DYN NE DYN, L=cpr7, R=cpr42
    6282skip DYN NE STA, L=cpr7, R=42
    6383skip DYN NE STA, L=cpr7, R=enu42
    64 done DYN NE UNS, L=cpr7, R=mut42
    65 done UNS EQ UNS, L=mut7, R=mut7
    66 done UNS NE UNS, L=mut7, R=mut42
     84skip DYN NE UNS, L=cpr7, R=mut42
     85skip UNS EQ UNS, L=mut7, R=mut7
     86skip UNS NE UNS, L=mut7, R=mut42
    6787skip UNS NE STA, L=mut7, R=42
    6888skip UNS NE STA, L=mut7, R=enu42
    69 done UNS NE DYN, L=mut7, R=cpr42
     89skip UNS NE DYN, L=mut7, R=cpr42
     90skip STA NE DYN, L=7, R=dim42
     91skip STA NE DYN, L=enu7, R=dim42
     92skip DYN NE DYN, L=cpr7, R=dim42
     93done DYN EQ DYN, L=dim7, R=dim7
     94skip DYN NE DYN, L=dim7, R=dim42
     95skip DYN NE STA, L=dim7, R=42
     96skip DYN NE STA, L=dim7, R=enu42
     97skip DYN NE DYN, L=dim7, R=cpr42
     98skip DYN NE UNS, L=dim7, R=mut42
     99skip UNS NE DYN, L=mut7, R=dim42
    70100---- REFVAR_ASGN:   { float a[__R__]; float (&b)[__L__] = *0p; & b = & a; }
    71101done STA EQ STA, L=7, R=7
     
    82112skip STA NE UNS, L=enu7, R=mut42
    83113done DYN EQ DYN, L=cpr7, R=cpr7
    84 done DYN NE DYN, L=cpr7, R=cpr42
     114skip DYN NE DYN, L=cpr7, R=cpr42
    85115skip DYN NE STA, L=cpr7, R=42
    86116skip DYN NE STA, L=cpr7, R=enu42
    87 done DYN NE UNS, L=cpr7, R=mut42
    88 done UNS EQ UNS, L=mut7, R=mut7
    89 done UNS NE UNS, L=mut7, R=mut42
     117skip DYN NE UNS, L=cpr7, R=mut42
     118skip UNS EQ UNS, L=mut7, R=mut7
     119skip UNS NE UNS, L=mut7, R=mut42
    90120skip UNS NE STA, L=mut7, R=42
    91121skip UNS NE STA, L=mut7, R=enu42
    92 done UNS NE DYN, L=mut7, R=cpr42
     122skip UNS NE DYN, L=mut7, R=cpr42
     123skip STA NE DYN, L=7, R=dim42
     124skip STA NE DYN, L=enu7, R=dim42
     125skip DYN NE DYN, L=cpr7, R=dim42
     126done DYN EQ DYN, L=dim7, R=dim7
     127skip DYN NE DYN, L=dim7, R=dim42
     128skip DYN NE STA, L=dim7, R=42
     129skip DYN NE STA, L=dim7, R=enu42
     130skip DYN NE DYN, L=dim7, R=cpr42
     131skip DYN NE UNS, L=dim7, R=mut42
     132skip UNS NE DYN, L=mut7, R=dim42
  • tests/array-collections/array-basic.cfa

    r92355883 r2a301ff  
    1 #include <containers/array.hfa>
     1#include <collections/array.hfa>
    22
    33//
  • tests/array-collections/array-md-sbscr-cases.cfa

    r92355883 r2a301ff  
    1 #include <containers/array.hfa>
     1#include <collections/array.hfa>
    22
    33#include <assert.h>
  • tests/array-collections/array-sbscr-types.cfa

    r92355883 r2a301ff  
    1 #include <containers/array.hfa>
     1#include <collections/array.hfa>
    22
    33// Shows support for many required ways a user can index into a new array.
  • tests/array-collections/dimexpr-match-c.cfa

    r92355883 r2a301ff  
    1616#include "dimexpr-match.hfa"     // test framework
    1717
     18#ifdef TRY_WISH_1 // "unification as-if"
     19forall( [N] )
     20void zip( float (*a)[N], float (*b)[N] ) {}
     21#endif
     22
    1823DECLN_runTests {
    1924
     
    2126    int mut7 = 7, mut42 = 42;
    2227
    23    
    2428    #define TRY_COMPAT( LV, RV )        \
    2529    {                                   \
     
    7983
    8084  #ifdef TRY_WISH_1 // "unification as-if"
    81     forall( [N] )
    82     void zip( float (*a)[N], float (*b)[N] ) {}
    83 
    8485    #define TRY_COMPAT( LV, RV )        \
    8586    {                                   \
     
    9394
    9495  #endif
    95 
    96 
    97 
    9896}
  • tests/array-collections/dimexpr-match-cfa.cfa

    r92355883 r2a301ff  
    99#ifdef INCLUDE_MINIMAL
    1010#define POUNDINCLUDE #include
    11 POUNDINCLUDE <containers/array.hfa>
     11POUNDINCLUDE <collections/array.hfa>
    1212#else
    13 #include <containers/array.hfa>                           // part of SUT
     13#include <collections/array.hfa>                                                // part of SUT
    1414#endif
    1515
    16 #include "dimexpr-match.hfa"                              // test framework
     16#include "dimexpr-match.hfa"                                                    // test framework
    1717
    1818// CFA "classic" behaviour is inconsistent between "C array" and "new array."
     
    4444#endif
    4545
     46forall( [N] )
     47void zip( array(float, N) & a, array(float, N) & b ) {}
    4648
    4749DECLN_runTests {
     
    5052    int mut7 = 7, mut42 = 42;
    5153
    52    
    5354    #define TRY_COMPAT( LV, RV )            \
    5455    {                                       \
     
    103104    #undef TRY_COMPAT
    104105
    105 
    106     forall( [N] )
    107     void zip( array(float, N) & a, array(float, N) & b ) {}
    108 
    109106    #define TRY_COMPAT( LV, RV )            \
    110107    {                                       \
  • tests/array-collections/dimexpr-match.hfa

    r92355883 r2a301ff  
    145145#define EXPAND_AND_QUOTE(str) QUOTE(str)
    146146#define TRY_COMPAT_E EXPAND_AND_QUOTE(TRY_COMPAT(__L__,__R__))
    147 
    148 // Temporary: CFA is classic by default
    149 #if defined CFA_IS_PREVIEW && defined CFA_IS_CLASSIC
    150 #error Must not define both CFA_IS_CLASSIC, CFA_IS_PREVIEW
    151 #endif
    152 #if ! defined CFA_IS_PREVIEW && ! defined CFA_IS_CLASSIC
    153 #define CFA_IS_CLASSIC
    154 #endif
    155147
    156148#if ! defined __cforall
  • tests/collections/atomic_mpsc.cfa

    r92355883 r2a301ff  
    11#include <fstream.hfa>
    2 #include <containers/lockfree.hfa>
     2#include <collections/lockfree.hfa>
    33#include <thread.hfa>
    44
  • tests/collections/string-api-coverage.cfa

    r92355883 r2a301ff  
    1 #include <containers/string.hfa>
     1#include <collections/string.hfa>
    22#include <string_sharectx.hfa>
    33
  • tests/collections/string-overwrite.cfa

    r92355883 r2a301ff  
    1 #include <containers/string.hfa>
     1#include <collections/string.hfa>
    22#include <string_sharectx.hfa>
    33
  • tests/collections/vector-demo.cfa

    r92355883 r2a301ff  
    1 #include <containers/vector2.hfa>
     1#include <collections/vector2.hfa>
    22
    33void raiiTests() {
  • tests/concurrency/actors/inherit.cfa

    r92355883 r2a301ff  
    1313struct D_msg { int a; inline message; };
    1414void ?{}( D_msg & this ) { set_allocation( this, Delete ); }
    15 void ^?{}( D_msg & this ) { mutex(sout) sout | 'A'; }
     15void ^?{}( D_msg & ) { mutex(sout) sout | 'A'; }
    1616
    1717struct D_msg2 { inline D_msg; };
  • tests/concurrency/channels/daisy_chain.cfa

    r92355883 r2a301ff  
    1919void main(Task & this) {
    2020    size_t runs = 0;
     21    int token = 0;
    2122    try{
    2223        for ( ;; ) {
    23             remove( *chain );
    24             insert( *chain, 0 );
     24            token << *chain;
     25            *chain << token;
    2526            runs++;
    2627        }
     
    5960    Channel chainChan{ 1 };
    6061
    61     insert( chainChan, 0 );
     62    chainChan << ((int)0);
    6263
    6364    chain = &chainChan;   
  • tests/concurrency/unified_locking/thread_test.cfa

    r92355883 r2a301ff  
    33#include <stdlib.hfa>
    44#include <thread.hfa>
    5 #include <containers/array.hfa>
     5#include <collections/array.hfa>
    66
    77static unsigned int taskCount = 4;
  • tests/concurrency/waituntil/all_types.cfa

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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 ) {}
     
    3131            }
    3232            waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; }
    33             or waituntil( (in2 << B) ) { assert( B_removes == in2 ); B_removes++; removes++; }
     33            or waituntil( (in << B) ) { assert( B_removes == in ); B_removes++; removes++; }
    3434        }
    3535    } catchResume ( channel_closed * e ) {} // continue to remove until would block
     
    7474    ^B{};
    7575
     76    useAnd = true;
     77
    7678    inserts = 0;
    7779    removes = 0;
  • tests/concurrency/waituntil/channel_zero_size.cfa

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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/timeout.cfa

    r92355883 r2a301ff  
    1515
    1616    assert( count == 1000 );
     17    sleep( 1`ms );
    1718    printf("done\n");
    1819}
  • tests/designations.cfa

    r92355883 r2a301ff  
    1010// Created On       : Thu Jun 29 15:26:36 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar 28 22:41:55 2022
    13 // Update Count     : 15
    14 //
     12// Last Modified On : Thu Jun 29 11:31:21 2023
     13// Update Count     : 28
     14//
     15
     16#include <fstream.hfa>
    1517
    1618// Note: this test case has been crafted so that it compiles with both cfa and with gcc without any modifications.
     
    2123#define AT @
    2224#else
    23 int printf( const char *, ...);
    2425#define _ =
    2526#define AT
     
    2829const int indentAmt = 2;
    2930void indent( int level ) {
    30         for ( int i = 0; i < level; ++i ) {
    31                 printf( " " );
    32         }
     31        sout | wd( level, "" ) | nonl;
    3332}
    3433
     
    4039void printA( struct A a, int level ) {
    4140        indent( level );
    42         printf( "(A){ %d %d %p }\n", a.x, a.y, a.ptr );
     41        sout | "(A){ " | a.x | a.y | a.ptr | " }";
    4342}
    4443
     
    4948void printB( struct B b, int level ) {
    5049        indent( level );
    51         printf( "(B){\n" );
     50        sout | "(B){";
    5251        printA( b.a0, level+indentAmt );
    5352        printA( b.a1, level+indentAmt );
    5453        indent( level );
    55         printf( "}\n" );
     54        sout | "}";
    5655}
    5756
     
    6362void printC( struct C c, int level ) {
    6463        indent( level );
    65         printf( "(C){\n" );
     64        sout | "(C){";
    6665        indent( level+indentAmt );
    67         printf( "(int[]{ %d %d %d }\n", c.arr[0], c.arr[1], c.arr[2]);
     66        sout | "(int[]{ " | c.arr[0] | c.arr[1] | c.arr[2] | " }";
    6867        printB( c.b, level+indentAmt );
    6968        indent( level );
    70         printf( "}\n" );
     69        sout | "}";
    7170}
    7271
     
    7978void printD( struct D d, int level ) {
    8079        indent( level);
    81         printf( "(D ){ %d }\n", d.x );
     80        sout | "(D){ " | d.x | "}";
    8281}
    8382
     
    9291
    9392struct Fred {
    94     double i[3];
    95     int j;
    96     struct Mary {
    97         struct Jane {
    98             double j;
    99         } j;
    100         double i;
    101     } m;
     93        double i[3];
     94        int j;
     95        struct Mary {
     96                struct Jane {
     97                        double j;
     98                } j;
     99                double i;
     100        } m;
    102101};
    103102struct Fred s1 AT= { .m.j _ 3 };
     
    129128#endif
    130129
    131         printf( "=====A=====\n" );
     130        sout | "=====A=====";
    132131        printA( y0, 0 );
    133132        printA( y1, 0 );
    134133        printA( y2, 0 );
    135         printf( "=====A=====\n\n" );
     134        sout | "=====A=====" | nl | nl;
    136135
    137136        // initialize only first element (z0.a.x), leaving everything else default-initialized (zero), no nested curly-braces
     
    172171        };
    173172
    174         printf( "=====B=====\n" );
     173        sout | "=====B=====";
    175174        printB( z0, 0 );
    176175        printB( z1, 0 );
     
    179178        printB( z5, 0 );
    180179        printB( z6, 0 );
    181         printf( "=====B=====\n\n" );
     180        sout | "=====B=====" | nl | nl;
    182181
    183182        // TODO: what about extra things in a nested init? are empty structs skipped??
     
    190189        };
    191190
    192         printf( "=====C=====\n" );
     191        sout | "=====C=====";
    193192        printC( c1, 0 );
    194         printf( "=====C=====\n\n" );
     193        sout | "=====C=====" | nl | nl;
    195194
    196195#if ERROR
     
    246245        };
    247246
    248         printf( "=====E=====\n" );
     247        sout | "=====E=====";
    249248        printA( e0.a, 0 );
    250249        printA( e1.a, 0 );
    251250        printA( e2.a, 0 );
    252251        printB( e3.b, 0 );
    253         printf( "=====E=====\n\n" );
     252        sout | "=====E=====" | nl | nl;
    254253
    255254        // special case of initialization: char[] can be initialized with a string literal
  • tests/exceptions/.expect/polymorphic.txt

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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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.hfa>
    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

    r92355883 r2a301ff  
    11// Test exceptions that add data but no functionality.
     2
     3#include <fstream.hfa>
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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

    r92355883 r2a301ff  
    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}
  • tests/include/vector-collections.cfa

    r92355883 r2a301ff  
    11#include <vector.hfa>
    2 #include <bits/containers.hfa>
     2#include <bits/collections.hfa>
    33
    44int main() {
  • tests/io/.expect/io.txt

    r92355883 r2a301ff  
    61611, 2, 3 4, 5, 6
    6262
    63 check sepOn/sepOff
     63check sep/nosep
    64641 2 3
    656512 3
  • tests/io/.expect/manipulatorsOutput2.arm64.txt

    r92355883 r2a301ff  
    440 033 033 033 033
    550345 0177745 037777777745 01777777777777777777745
    6 0 0x1b 0x1b 0x1b 0x1b
     60x0 0x1b 0x1b 0x1b 0x1b
    770xe5 0xffe5 0xffffffe5 0xffffffffffffffe5
    8 0x0p+0. 0x1.b8p+4 0x1.b8p+4 0x1.b8p+4
     80x0p+0 0x1.b8p+4 0x1.b8p+4 0x1.b8p+4
    99-0x1.b8p+4 -0x1.b8p+4 -0x1.b8p+4
    10100.000000e+00 2.750000e+01 -2.750000e+01
  • tests/io/.expect/manipulatorsOutput2.x64.txt

    r92355883 r2a301ff  
    440 033 033 033 033
    550345 0177745 037777777745 01777777777777777777745
    6 0 0x1b 0x1b 0x1b 0x1b
     60x0 0x1b 0x1b 0x1b 0x1b
    770xe5 0xffe5 0xffffffe5 0xffffffffffffffe5
    8 0x0p+0. 0x1.b8p+4 0x1.b8p+4 0xd.cp+1
     80x0p+0 0x1.b8p+4 0x1.b8p+4 0xd.cp+1
    99-0x1.b8p+4 -0x1.b8p+4 -0xd.cp+1
    10100.000000e+00 2.750000e+01 -2.750000e+01
  • tests/io/.expect/manipulatorsOutput2.x86.txt

    r92355883 r2a301ff  
    440 033 033 033 033
    550345 0177745 037777777745 037777777745
    6 0 0x1b 0x1b 0x1b 0x1b
     60x0 0x1b 0x1b 0x1b 0x1b
    770xe5 0xffe5 0xffffffe5 0xffffffe5
    8 0x0p+0. 0x1.b8p+4 0x1.b8p+4 0xd.cp+1
     80x0p+0 0x1.b8p+4 0x1.b8p+4 0xd.cp+1
    99-0x1.b8p+4 -0x1.b8p+4 -0xd.cp+1
    10100.000000e+00 2.750000e+01 -2.750000e+01
  • tests/io/.expect/manipulatorsOutput3.arm64.txt

    r92355883 r2a301ff  
    246246-1                   0xffffffffffffffffffffffffffffffff 03777777777777777777777777777777777777777777
    2472470b11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
    248 +0                   0                    0                   
     248+0                   0x0                  0                   
    2492490b0                 
    250250+1                   0x1                  01                 
  • tests/io/.expect/manipulatorsOutput3.x64.txt

    r92355883 r2a301ff  
    246246-1                   0xffffffffffffffffffffffffffffffff 03777777777777777777777777777777777777777777
    2472470b11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
    248 +0                   0                    0                   
     248+0                   0x0                  0                   
    2492490b0                 
    250250+1                   0x1                  01                 
  • tests/io/io.cfa

    r92355883 r2a301ff  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 21 10:56:33 2021
    13 // Update Count     : 121
     12// Last Modified On : Tue Aug  8 23:18:32 2023
     13// Update Count     : 128
    1414//
    1515
     
    104104        in       | f | d | ld;                                                                  // floating point
    105105        in       | fc | dc | ldc;                                                               // floating-point complex
    106         in       | s1 | wdi( size, s2 );                                                // C string, length unchecked and checked
     106        in       | wdi(size, s1) | wdi( size, s2 );                             // C string, length unchecked and checked
    107107        sout | nl;
    108108
     
    122122        sout | "toggle separator";
    123123        sout | f | "" | d | "" | ld;                                            // floating point without separator
    124         sout | sepDisable | fc | dc | ldc;                                      // complex without separator
    125         sout | fc | sepOn | dc | ldc;                                           // local separator add
    126         sout | sepEnable | fc | dc | ldc;                                       // complex with separator
    127         sout | fc | sepOff | dc | ldc;                                          // local separator removal
    128         sout | s1 | sepOff | s2;                                                        // local separator removal
     124        sout | sepOff | fc | dc | ldc;                                          // complex without separator
     125        sout | fc | sep | dc | ldc;                                                     // local separator add
     126        sout | sepOn | fc | dc | ldc;                                           // complex with separator
     127        sout | fc | nosep | dc | ldc;                                           // local separator removal
     128        sout | s1 | nosep | s2;                                                         // local separator removal
    129129        sout | s1 | "" | s2;                                                            // local separator removal
    130130        sout | nl;
    131131
    132132        sout | "change separator";
    133         sout | "from \"" | sep | "\"" | nonl;
     133        sout | "from \"" | sepVal | "\"" | nonl;
    134134        sepSet( sout, ", $" );                                                          // change separator, maximum of 15 characters
    135         sout | " to \"" | sep | "\"";
     135        sout | " to \"" | sepVal | "\"";
    136136        sout | f | d | ld;
    137137        sout | fc | dc | ldc;
     
    139139        sout | t1 | t2;                                                                         // print tuple
    140140        sout | nl;
    141         sout | "from \"" | sep | "\" " | nonl;
     141        sout | "from \"" | sepVal | "\" " | nonl;
    142142        sepSet( sout, " " );                                                            // restore separator
    143         sout | "to \"" | sep | "\"";
     143        sout | "to \"" | sepVal | "\"";
    144144        sout | f | d | ld;
    145145        sout | fc | dc | ldc;
     
    148148        sout | nl;
    149149
    150         sout | "check sepOn/sepOff";
    151         sout | sepOn | 1 | 2 | 3 | sepOn;                                       // no separator at start/end of line
    152         sout | 1 | sepOff | 2 | 3;                                                      // locally turn off implicit separator
    153         sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n' | nonl; // no separator at start/end of line
    154         sout | 1 | 2 | 3 | "\n\n" | sepOn | nonl;                       // no separator at start of next line
     150        sout | "check sep/nosep";
     151        sout | sep | 1 | 2 | 3 | sep;                                           // no separator at start/end of line
     152        sout | 1 | nosep | 2 | 3;                                                       // locally turn off implicit separator
     153        sout | sep | sep | 1 | 2 | 3 | sep | nosep | sep | '\n' | nonl; // no separator at start/end of line
     154        sout | 1 | 2 | 3 | "\n\n" | sep | nonl;                         // no separator at start of next line
    155155        sout | 1 | 2 | 3;
    156156        sout | nl;
    157157
    158158        sout | "check enable/disable";
    159         sout | sepDisable | 1 | 2 | 3;                                          // globally turn off implicit separation
    160         sout | 1 | sepOn | 2 | 3;                                                       // locally turn on implicit separator
    161         sout | sepEnable | 1 | 2 | 3 | sepDisable;                      // globally turn on/off implicit separation
    162         sout | 1 | 2 | 3 | sepEnable;                                           // globally turn on implicit separation
    163         sout | 1 | 2 | 3 | sepOn | sepDisable;                          // ignore seperate at end of line
    164         sout | 1 | 2 | 3 | sepOn | sepEnable;                           // separator at end of line
     159        sout | sepOff | 1 | 2 | 3;                                                      // globally turn off implicit separation
     160        sout | 1 | sep | 2 | 3;                                                         // locally turn on implicit separator
     161        sout | sepOn | 1 | 2 | 3 | sepOff;                                      // globally turn on/off implicit separation
     162        sout | 1 | 2 | 3 | sepOn;                                                       // globally turn on implicit separation
     163        sout | 1 | 2 | 3 | sep | sepOff;                                        // ignore seperate at end of line
     164        sout | 1 | 2 | 3 | sep | sepOn;                                         // separator at end of line
    165165        sout | 1 | 2 | 3;
    166166        sout | nl;
     
    169169
    170170        sepSetTuple( sout, " " );                                                       // set tuple separator from ", " to " "
    171         sout | t1 | t2 | " \"" | sep | "\"";
     171        sout | t1 | t2 | " \"" | sepVal | "\"";
    172172        sepSetTuple( sout, ", " );                                                      // reset tuple separator to ", "
    173         sout | t1 | t2 | " \"" | sep | "\"";
     173        sout | t1 | t2 | " \"" | sepVal | "\"";
    174174        sout | t1 | t2;                                                                         // print tuple
    175175        sout | nl;
     
    180180        sepSetTuple( sout, " " );
    181181        sout | t3;
    182         sout | sepOn | t3 | sepDisable | t3 | sepEnable | t3;
     182        sout | sep | t3 | sepOff | t3 | sepOn | t3;
    183183        sepSet( sout, "^" );
    184184        sepSetTuple( sout, "-" );
  • tests/io/manipulatorsInput.cfa

    r92355883 r2a301ff  
    77// Created On       : Sat Jun  8 17:58:54 2019
    88// Last Modified By : Peter A. Buhr
    9 // Last Modified On : Sat Jun 17 07:56:02 2023
    10 // Update Count     : 48
     9// Last Modified On : Mon Aug 14 17:38:52 2023
     10// Update Count     : 63
    1111//
    1212
     
    1919                const char sk[] = "abc";
    2020                scanf( "abc " ); scanf( sk ); for ( 5 ) scanf( "%*c" ); printf( "1 %s\n", s );
    21                 scanf( "%s", s );                                               printf( "2 %s\n", s );
    22                 scanf( "%*s" );                                                 printf( "3 %s\n", s );
    23                 scanf( "%8s", s );                                              printf( "4 %s\n", s );
    24                 scanf( "%*8s" );                                                printf( "5 %s\n", s );
     21                scanf( "%s", s );                                                               printf( "2 %s\n", s );
     22                scanf( "%*s" );                                                                 printf( "3 %s\n", s );
     23                scanf( "%8s", s );                                                              printf( "4 %s\n", s );
     24                scanf( "%*8s" );                                                                printf( "5 %s\n", s );
    2525
    26                 scanf( "%[abc]", s );                                   printf( "6 %s\n", s );
    27                 scanf( "%[^abc]", s );                                  printf( "7 %s\n", s );
    28                 scanf( "%*[abc]" );                                             printf( "8 %s\n", s );
    29                 scanf( "%*[^abc]" );                                    printf( "9 %s\n", s );
    30                 scanf( "%8[abc]", s );                                  printf( "10 %s\n", s );
    31                 scanf( "%8[^abc]", s );                                 printf( "11 %s\n", s );
    32                 scanf( "%*8[abc]" );                                    printf( "12 %s\n", s );
    33                 scanf( "%*8[^abc]" );                                   printf( "13 %s\n", s );
     26                scanf( "%[abc]", s );                                                   printf( "6 %s\n", s );
     27                scanf( "%[^abc]", s );                                                  printf( "7 %s\n", s );
     28                scanf( "%*[abc]" );                                                             printf( "8 %s\n", s );
     29                scanf( "%*[^abc]" );                                                    printf( "9 %s\n", s );
     30                scanf( "%8[abc]", s );                                                  printf( "10 %s\n", s );
     31                scanf( "%8[^abc]", s );                                                 printf( "11 %s\n", s );
     32                scanf( "%*8[abc]" );                                                    printf( "12 %s\n", s );
     33                scanf( "%*8[^abc]" );                                                   printf( "13 %s\n", s );
    3434        }
    3535        {
    3636                char s[] = "yyyyyyyyyyyyyyyyyyyy";
    3737                char sk[] = "abc";
    38                 sin /*| "abc "*/ | skip( sk ) | skip( 5 );      sout | "1" | s;
    39                 sin | s;                                                                sout | "2" | s;
    40                 sin | ignore( s );                                              sout | "3" | s;
    41                 sin | wdi( 8, s );                                              sout | "4" | s;
    42                 sin | ignore( wdi( 8, s ) );                    sout | "5" | s;
     38                sin /*| "abc "*/ | skip( sk ) | skip( 5 );              sout | "1" | s;
     39                sin | wdi( sizeof(s), s );                                              sout | "2" | s;
     40                sin | ignore( s );                                                              sout | "3" | s;
     41                sin | wdi( sizeof(s), 8, s );                                   sout | "4" | s;
     42                sin | ignore( wdi( sizeof(s), 8, s ) );                 sout | "5" | s;
    4343
    44                 sin | incl( "abc", s );                                 sout | "6" | s;
    45                 sin | excl( "abc", s );                                 sout | "7" | s;
    46                 sin | ignore( incl( "abc", s ) );               sout | "8" | s;
    47                 sin | ignore( excl( "abc", s ) );               sout | "9" | s;
    48                 sin | wdi( 8, incl( "abc", s ) );               sout | "10" | s;
    49                 sin | wdi( 8, excl( "abc", s ) );               sout | "11" | s;
    50                 sin | ignore( wdi( 8, incl( "abc", s ) ) );     sout | "12" | s;
    51                 sin | ignore( wdi( 8, excl( "abc", s ) ) );     sout | "13" | s;
     44                sin | incl( "abc", wdi( sizeof(s), s ) );               sout | "6" | s;
     45                sin | excl( "abc", wdi( sizeof(s), s ) );               sout | "7" | s;
     46                sin | ignore( incl( "abc", wdi( sizeof(s), s ) ) ); sout | "8" | s;
     47                sin | ignore( excl( "abc", wdi( sizeof(s), s ) ) ); sout | "9" | s;
     48                sin | incl( "abc", wdi( sizeof(s), 8, s ) );    sout | "10" | s;
     49                sin | excl( "abc", wdi( sizeof(s), 8, s ) );    sout | "11" | s;
     50                sin | ignore( incl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "12" | s;
     51                sin | ignore( excl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "13" | s;
    5252        }
    5353        {
    5454                char c;
    55                 sin | c;                                                                sout | c;
    56                 sin | ignore( c );                                              sout | c;
     55                sin | c;                                                                                sout | c;
     56                sin | ignore( c );                                                              sout | c;
    5757
    5858                signed char sc;
    59                 sin | sc;                                                               sout | sc;
    60                 sin | wdi( 3, sc );                                             sout | sc;
    61                 sin | ignore( sc );                                             sout | sc;
    62                 sin | ignore( wdi( 3, sc ) );                   sout | sc;
     59                sin | sc;                                                                               sout | sc;
     60                sin | wdi( 3, sc );                                                             sout | sc;
     61                sin | ignore( sc );                                                             sout | sc;
     62                sin | ignore( wdi( 3, sc ) );                                   sout | sc;
    6363
    6464                unsigned char usc;
    65                 sin | usc;                                                              sout | usc;
    66                 sin | wdi( 3, usc );                                    sout | usc;
    67                 sin | ignore( usc );                                    sout | usc;
    68                 sin | ignore( wdi( 3, usc ) );                  sout | usc;
     65                sin | usc;                                                                              sout | usc;
     66                sin | wdi( 3, usc );                                                    sout | usc;
     67                sin | ignore( usc );                                                    sout | usc;
     68                sin | ignore( wdi( 3, usc ) );                                  sout | usc;
    6969
    7070                signed short int ssi;
    71                 sin | ssi;                                                              sout | ssi;
    72                 sin | wdi( 3, ssi );                                    sout | ssi;
    73                 sin | ignore( ssi );                                    sout | ssi;
    74                 sin | ignore( wdi( 3, ssi ) );                  sout | ssi;
     71                sin | ssi;                                                                              sout | ssi;
     72                sin | wdi( 3, ssi );                                                    sout | ssi;
     73                sin | ignore( ssi );                                                    sout | ssi;
     74                sin | ignore( wdi( 3, ssi ) );                                  sout | ssi;
    7575
    7676                unsigned short int usi;
    77                 sin | usi;                                                              sout | usi;
    78                 sin | wdi( 3, usi );                                    sout | usi;
    79                 sin | ignore( usi );                                    sout | usi;
    80                 sin | ignore( wdi( 3, usi ) );                  sout | usi;
     77                sin | usi;                                                                              sout | usi;
     78                sin | wdi( 3, usi );                                                    sout | usi;
     79                sin | ignore( usi );                                                    sout | usi;
     80                sin | ignore( wdi( 3, usi ) );                                  sout | usi;
    8181
    8282                signed int si;
    83                 sin | si;                                                               sout | si;
    84                 sin | wdi( 3, si );                                             sout | si;
    85                 sin | ignore( si );                                             sout | si;
    86                 sin | ignore( wdi( 3, si ) );                   sout | si;
     83                sin | si;                                                                               sout | si;
     84                sin | wdi( 3, si );                                                             sout | si;
     85                sin | ignore( si );                                                             sout | si;
     86                sin | ignore( wdi( 3, si ) );                                   sout | si;
    8787
    8888                unsigned int ui;
    89                 sin | ui;                                                               sout | ui;
    90                 sin | wdi( 3, ui );                                             sout | ui;
    91                 sin | ignore( ui );                                             sout | ui;
    92                 sin | ignore( wdi( 3, ui ) );                   sout | ui;
     89                sin | ui;                                                                               sout | ui;
     90                sin | wdi( 3, ui );                                                             sout | ui;
     91                sin | ignore( ui );                                                             sout | ui;
     92                sin | ignore( wdi( 3, ui ) );                                   sout | ui;
    9393
    9494                signed long int sli;
    95                 sin | sli;                                                              sout | sli;
    96                 sin | wdi( 3, sli );                                    sout | sli;
    97                 sin | ignore( sli );                                    sout | sli;
    98                 sin | ignore( wdi( 3, sli ) );                  sout | sli;
     95                sin | sli;                                                                              sout | sli;
     96                sin | wdi( 3, sli );                                                    sout | sli;
     97                sin | ignore( sli );                                                    sout | sli;
     98                sin | ignore( wdi( 3, sli ) );                                  sout | sli;
    9999
    100100                unsigned long int uli;
    101                 sin | uli;                                                              sout | uli;
    102                 sin | wdi( 3, uli );                                    sout | uli;
    103                 sin | ignore( uli );                                    sout | uli;
    104                 sin | ignore( wdi( 3, uli ) );                  sout | uli;
     101                sin | uli;                                                                              sout | uli;
     102                sin | wdi( 3, uli );                                                    sout | uli;
     103                sin | ignore( uli );                                                    sout | uli;
     104                sin | ignore( wdi( 3, uli ) );                                  sout | uli;
    105105
    106106                signed long long int slli;
    107                 sin | slli;                                                             sout | slli;
    108                 sin | wdi( 3, slli );                                   sout | slli;
    109                 sin | ignore( slli );                                   sout | slli;
    110                 sin | ignore( wdi( 3, slli ) );                 sout | slli;
     107                sin | slli;                                                                             sout | slli;
     108                sin | wdi( 3, slli );                                                   sout | slli;
     109                sin | ignore( slli );                                                   sout | slli;
     110                sin | ignore( wdi( 3, slli ) );                                 sout | slli;
    111111
    112112                unsigned long long int ulli;
    113                 sin | ulli;                                                             sout | ulli;
    114                 sin | wdi( 3, ulli );                                   sout | ulli;
    115                 sin | ignore( ulli );                                   sout | ulli;
    116                 sin | ignore( wdi( 3, ulli ) );                 sout | ulli;
     113                sin | ulli;                                                                             sout | ulli;
     114                sin | wdi( 3, ulli );                                                   sout | ulli;
     115                sin | ignore( ulli );                                                   sout | ulli;
     116                sin | ignore( wdi( 3, ulli ) );                                 sout | ulli;
    117117
    118118                float f;
    119                 sin | f;                                                                sout | f;
    120                 sin | wdi( 8, f );                                              sout | f;
    121                 sin | ignore( f );                                              sout | f;
    122                 sin | ignore( wdi( 8, f ) );                    sout | f;
     119                sin | f;                                                                                sout | f;
     120                sin | wdi( 8, f );                                                              sout | f;
     121                sin | ignore( f );                                                              sout | f;
     122                sin | ignore( wdi( 8, f ) );                                    sout | f;
    123123
    124124                double d;
    125                 sin | d;                                                                sout | d;
    126                 sin | wdi( 8, d );                                              sout | d;
    127                 sin | ignore( d );                                              sout | d;
    128                 sin | ignore( wdi( 8, d ) );                    sout | d;
     125                sin | d;                                                                                sout | d;
     126                sin | wdi( 8, d );                                                              sout | d;
     127                sin | ignore( d );                                                              sout | d;
     128                sin | ignore( wdi( 8, d ) );                                    sout | d;
    129129
    130130                long double ld;
    131                 sin | ld;                                                               sout | ld;
    132                 sin | wdi( 8, ld );                                             sout | ld;
    133                 sin | ignore( ld );                                             sout | ld;
    134                 sin | ignore( wdi( 8, ld ) );                   sout | ld;
     131                sin | ld;                                                                               sout | ld;
     132                sin | wdi( 8, ld );                                                             sout | ld;
     133                sin | ignore( ld );                                                             sout | ld;
     134                sin | ignore( wdi( 8, ld ) );                                   sout | ld;
    135135
    136136                float _Complex fc;
    137                 sin | fc;                                                               sout | fc;
    138                 sin | wdi( 8, fc );                                             sout | fc;
    139                 sin | ignore( fc );                                             sout | fc;
    140                 sin | ignore( wdi( 8, fc ) );                   sout | fc;
     137                sin | fc;                                                                               sout | fc;
     138                sin | wdi( 8, fc );                                                             sout | fc;
     139                sin | ignore( fc );                                                             sout | fc;
     140                sin | ignore( wdi( 8, fc ) );                                   sout | fc;
    141141
    142142                double _Complex dc;
    143                 sin | dc;                                                               sout | dc;
    144                 sin | wdi( 8, dc );                                             sout | dc;
    145                 sin | ignore( dc );                                             sout | dc;
    146                 sin | ignore( wdi( 8, dc ) );                   sout | dc;
     143                sin | dc;                                                                               sout | dc;
     144                sin | wdi( 8, dc );                                                             sout | dc;
     145                sin | ignore( dc );                                                             sout | dc;
     146                sin | ignore( wdi( 8, dc ) );                                   sout | dc;
    147147
    148148                long double _Complex ldc;
    149                 sin | ldc;                                                              sout | ldc;
    150                 sin | wdi( 8, ldc );                                    sout | ldc;
    151                 sin | ignore( ldc );                                    sout | ldc;
    152                 sin | ignore( wdi( 8, ldc ) );                  sout | ldc;
     149                sin | ldc;                                                                              sout | ldc;
     150                sin | wdi( 8, ldc );                                                    sout | ldc;
     151                sin | ignore( ldc );                                                    sout | ldc;
     152                sin | ignore( wdi( 8, ldc ) );                                  sout | ldc;
    153153        }
    154154        #if defined( __SIZEOF_INT128__ )
  • tests/list/dlist-insert-remove.cfa

    r92355883 r2a301ff  
    1 #include <containers/list.hfa>
     1#include <collections/list.hfa>
    22#include <fstream.hfa>
    33#include <assert.h>
  • tests/maybe.cfa

    r92355883 r2a301ff  
    1010// Created On       : Thr May 25 16:02:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Sep 25 15:13:28 2020
    13 // Update Count     : 2
     12// Last Modified On : Wed Aug 30 21:45:27 2023
     13// Update Count     : 3
    1414//
    1515
    1616#include <assert.h>
    17 #include <containers/maybe.hfa>
     17#include <collections/maybe.hfa>
    1818
    1919void checkPredicates() {
  • tests/raii/.expect/memberCtors-ERR1.txt

    r92355883 r2a301ff  
    1 raii/memberCtors.cfa:92:1 error: in ?{}, field a2 used before being constructed
     1raii/memberCtors.cfa:94:1 error: in ?{}, field a2 used before being constructed
  • tests/raii/dtor-early-exit.cfa

    r92355883 r2a301ff  
    1010// Created On       : Wed Aug 17 08:26:25 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 21 08:45:19 2018
    13 // Update Count     : 10
     12// Last Modified On : Thu Jun 29 11:15:56 2023
     13// Update Count     : 11
    1414//
    1515
     
    244244
    245245int main() {
    246         sepDisable(sout);
     246        sepOff(sout);
    247247        for (int i = 0; i < 4; i++) {
    248248                f(i);
  • tests/raii/memberCtors.cfa

    r92355883 r2a301ff  
     1#include <fstream.hfa>
     2
    13struct WrappedInt {
    2   int x;
    3   int id;
     4        int x;
     5        int id;
    46};
    57int intID = 0;
    68
    7 void ?{}(WrappedInt & this) {
    8   this.id = intID++;
    9   printf("constructing int id: %d\n", this.id);
    10   this.x = 0;
     9void ?{}( WrappedInt & this ) {
     10        this.id = intID++;
     11        sout | "constructing int id: " | this.id;
     12        this.x = 0;
    1113}
    1214
    13 void ?{}(WrappedInt & this, WrappedInt other) {
    14   this.id = intID++;
    15   printf("copy constructing int: %d id: %d\n", other.x, this.id);
    16   this.x = other.x;
     15void ?{}( WrappedInt & this, WrappedInt other ) {
     16        this.id = intID++;
     17        sout | "copy constructing int: " | other.x | "id: " | this.id;
     18        this.x = other.x;
    1719}
    1820
    19 void ?{}(WrappedInt & this, int x) {
    20   this.id = intID++;
    21   printf("constructing int: %d id: %d\n", x, this.id);
    22   this.x = x;
     21void ?{}( WrappedInt & this, int x ) {
     22        this.id = intID++;
     23        sout | "constructing int: " | x | "id: " | this.id;
     24        this.x = x;
    2325}
    2426
    25 void ^?{}(WrappedInt & this) {
    26   printf("destructing int: %d id: %d\n", this.x, this.id);
     27void ^?{}( WrappedInt & this ) {
     28        sout | "destructing int: " | this.x | "id: " | this.id;
    2729}
    2830
    29 /* WrappedInt */ void ?=?(WrappedInt & this, int x) {
    30   printf("assigning int: %d %d id: %d\n", this.x, x, this.id);
    31   this.x = x;
    32   // return this;
     31/* WrappedInt */ void ?=?( WrappedInt & this, int x ) {
     32        sout | "assigning int: " | this.x | x | "id: " | this.id;
     33        this.x = x;
     34        // return this;
    3335}
    3436
    35 // WrappedInt ?=?(WrappedInt & this, WrappedInt other) {
    36 //   printf("assigning int: %d %d\n", this.x, other.x);
     37// WrappedInt ?=?( WrappedInt & this, WrappedInt other ) {
     38//   sout | "assigning int: " | this.x | other.x;
    3739//   this.x = other.x;
    3840//   return this;
     
    4042
    4143struct A {
    42   WrappedInt x, y, z;
    43   int id;
     44        WrappedInt x, y, z;
     45        int id;
    4446};
    4547int AID = 0;
    4648
    47 void ?{}(A & a) {
    48   // currently must define default ctor, since there's no "= default" syntax
    49   a.id = AID++;
    50   printf("default construct A %d\n", a.id);
     49void ?{}( A & a ) {
     50        // currently must define default ctor, since there's no "= default" syntax
     51        a.id = AID++;
     52        sout | "default construct A" | a.id;
    5153}
    5254
    53 void ?{}(A & a, int x) {
    54   a.id = AID++;
    55   printf("begin construct A id: %d\n", a.id);
    56   printf("construct a.x\n");
    57   (a.x){ x+999 };
    58   printf("assign a.y\n");
    59   a.y = 0; // not a constructor - default constructor will be inserted
    60   printf("end construct A\n");
     55void ?{}( A & a, int x ) {
     56        a.id = AID++;
     57        sout | "begin construct A id: " | a.id;
     58        sout | "construct a.x";
     59        (a.x){ x+999 };
     60        sout | "assign a.y";
     61        a.y = 0; // not a constructor - default constructor will be inserted
     62        sout | "end construct A";
    6163} // z never constructed - will be automatically default constructed
    6264
    63 void ?{}(A & this, A other) {
    64   this.id = AID++;
    65   printf("begin copy construct A id: %d\n", this.id);
    66   printf("copy construct this.x\n");
    67   (this.x){ other.x };
    68   printf("assign this.y\n");
    69   this.y = other.y; // not a constructor - copy constructor will be inserted
    70   printf("end copy construct A\n");
     65void ?{}( A & this, A other ) {
     66        this.id = AID++;
     67        sout | "begin copy construct A id: " | this.id;
     68        sout | "copy construct this.x";
     69        (this.x){ other.x };
     70        sout | "assign this.y";
     71        this.y = other.y; // not a constructor - copy constructor will be inserted
     72        sout | "end copy construct A";
    7173} // z never constructed - will be automatically copy constructed
    7274
    73 A ?=?(A & this, A other) {
    74   printf("begin ?=? A id: %d\n", this.id);
    75   this.x = other.x;
    76   this.y = other.y;
    77   this.z = other.z;
    78   printf("end ?=? A\n");
    79   return this;
     75A ?=?( A & this, A other ) {
     76        sout | "begin ?=? A id: " | this.id;
     77        this.x = other.x;
     78        this.y = other.y;
     79        this.z = other.z;
     80        sout | "end ?=? A";
     81        return this;
    8082}
    8183
    8284struct B {
    83   A a1, a2, a3;
    84   int id;
     85        A a1, a2, a3;
     86        int id;
    8587};
    8688int BID = 0;
    8789
    88 void ?{}(B & b) {
    89   b.id = BID++;
    90   printf("begin construct B id: %d\n", b.id);
    91   printf("assign b.a2\n");
    92   b.a2 = (A) { 2 };
    93   printf("construct b.a1\n");
    94   (b.a1){ 1 };
     90void ?{}( B & b ) {
     91        b.id = BID++;
     92        sout | "begin construct B id: " | b.id;
     93        sout | "assign b.a2";
     94        b.a2 = (A){ 2 };
     95        sout | "construct b.a1";
     96        (b.a1){ 1 };
    9597#ifdef ERR1
    96   (b.a2){ b.a3 }; // error, b->a2 was used previously but is explicitly constructed
     98        (b.a2){ b.a3 }; // error, b->a2 was used previously but is explicitly constructed
    9799#endif
    98   printf("end construct B\n");
     100        sout | "end construct B";
    99101} // a2, a3 never constructed - will be automatically default constructed
    100102
    101 void ^?{}(B & b) {
    102   b.id = BID++;
    103   printf("begin destruct B id: %d\n", b.id);
    104   b.a2 = (A) { 0 };
    105   ^(b.a1){};
    106   printf("end destruct B\n");
     103void ^?{}( B & b ) {
     104        b.id = BID++;
     105        sout | "begin destruct B id: " | b.id;
     106        b.a2 = (A) { 0 };
     107        ^(b.a1){};
     108        sout | "end destruct B";
    107109} // a2, a3 never destructed - will be automatically destructed
    108110
    109111int main() {
    110   printf("Before declaration of b1\n");
    111   B b1;  // b1 = { { 1000, 0, 0 }, { 1001, 0, 0 }, { 0, 0, 0 } }
    112   printf("Before declaration of b2\n");
    113   B b2 = b1;
    114   printf("End of main\n");
     112        sout | "Before declaration of b1";
     113        B b1;  // b1 = { { 1000, 0, 0 }, { 1001, 0, 0 }, { 0, 0, 0 } }
     114        sout | "Before declaration of b2";
     115        B b2 = b1;
     116        sout | "End of main";
    115117}
  • tests/result.cfa

    r92355883 r2a301ff  
    1010// Created On       : Thr May 25 16:50:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Sep 25 15:22:59 2020
    13 // Update Count     : 2
     12// Last Modified On : Wed Aug 30 21:46:34 2023
     13// Update Count     : 3
    1414//
    1515
    1616#include <assert.h>
    17 #include <containers/result.hfa>
     17#include <collections/result.hfa>
    1818
    1919void checkPredicates() {
  • tests/zombies/gc_no_raii/premake4.lua

    r92355883 r2a301ff  
    4848                linkoptions (linkOptionList)
    4949                includedirs (includeDirList)
    50                 files { "src/**.c", "containers/**.c" }
     50                files { "src/**.c", "collections/**.c" }
    5151
    5252        configuration "debug"
  • tests/zombies/hashtable.cfa

    r92355883 r2a301ff  
    11
    2 #include <containers/list.hfa>
     2#include <collections/list.hfa>
    33
    44#include <exception.hfa>
  • tests/zombies/hashtable2.cfa

    r92355883 r2a301ff  
    11
    2 #include <containers/list.hfa>
     2#include <collections/list.hfa>
    33
    44typedef unsigned int K;
  • tests/zombies/linked-list-perf/experiment.koad

    r92355883 r2a301ff  
    6767#elif defined IMPL_CFA_MIKE_NEW
    6868
    69         #include <containers/list.hfa>
     69        #include <collections/list.hfa>
    7070        struct S {
    7171                int f[64]; // FIXME: make "is volatile" consistent; given bug #TBD
Note: See TracChangeset for help on using the changeset viewer.