Changeset e891349 for tests


Ignore:
Timestamp:
Jan 17, 2024, 2:16:04 PM (6 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
5bf685f
Parents:
06280ad
Message:

Tweak string assignment-strcpy-strncpy and concatenate-strcat-strncat declarations.

Implement -n- versions correctly.

Refactor to include string_res layer.

Add missing tests.

Location:
tests/collections
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/collections/.expect/string-api-coverage.txt

    r06280ad re891349  
    2020hello
    2121world
     221234567
     23hello
     24Q
     25123
     26hell
     271234567
     28hello
     29123
     30hell
    22315
    2332helloworld
     
    2938hello, friend
    3039bye, friend
     40ohello
     41ohell
     42ohell
     43omydarling
     44omy
     45omy
    3146hellohellohellohello
    3247hellohellohello
  • tests/collections/string-api-coverage.cfa

    r06280ad re891349  
    9090    }
    9191                                            assertWellFormedHandleList( 10 );
     92    //
     93    // Assignments
     94    //
     95    {
     96        string b = "xxx";
     97
     98        b = "1234567";
     99        sout | b; // 1234567
     100
     101        b = "xxx";
     102        b = s;
     103        sout | b; // hello
     104       
     105        b = "xxx";
     106        b = 'Q';
     107        sout | b; // Q
     108       
     109        b = "xxx";
     110        assign( b, "1234567", 3 );
     111        sout | b; // 123
     112
     113        b = "xxx";
     114        assign( b, s, 4 );
     115        sout | b; // hell
     116
     117        b = "xxx";
     118        strcpy(b, "1234567");
     119        sout | b; // 1234567
     120
     121        b = "xxx";
     122        strcpy(b, s);
     123        sout | b; // hello
     124       
     125        b = "xxx";
     126        strncpy( b, "1234567", 3 );
     127        sout | b; // 123
     128
     129        b = "xxx";
     130        strncpy( b, s, 4 );
     131        sout | b; // hell
     132    }
     133                                            assertWellFormedHandleList( 10 );
     134
     135
    92136
    93137    sout | size(s); // 5
     
    125169    sx = "bye, " + "friend";
    126170    sout | sx; // bye, friend
     171
     172    sx = "o";
     173    strcat( sx, s );
     174    sout | sx; // ohello
     175
     176    sx = "o";
     177    append( sx, s, 4 );
     178    sout | sx; // ohell
     179
     180    sx = "o";
     181    strncat( sx, s, 4 );
     182    sout | sx; // ohell
     183
     184    sx = "o";
     185    strcat( sx, "mydarling" );
     186    sout | sx; // omydarling
     187
     188    sx = "o";
     189    append( sx, "mydarling", 2 );
     190    sout | sx; // omy
     191
     192    sx = "o";
     193    strncat( sx, "mydarling", 2 );
     194    sout | sx; // omy
    127195
    128196    //
Note: See TracChangeset for help on using the changeset viewer.