VirtualBox

Changeset 18571 in vbox


Ignore:
Timestamp:
Mar 31, 2009 1:08:16 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
45465
Message:

tstUtf8: Converted to RTTest (awful lot of work) and added RTStrStr and RTStrIStr tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstUtf8.cpp

    r14831 r18571  
    4141#include <iprt/assert.h>
    4242#include <iprt/err.h>
     43#include <iprt/test.h>
    4344
    4445#include <stdlib.h>
    4546
    46 
    47 /*******************************************************************************
    48 *   Global Variables                                                           *
    49 *******************************************************************************/
    50 static int g_cErrors = 0;
    5147
    5248
     
    6864 *
    6965 */
    70 static void test1(void)
     66static void test1(RTTEST hTest)
    7167{
    7268    static const char s_szBadString1[] = "Bad \xe0\x13\x0";
     
    7874    PRTUTF16 pwszRand;
    7975
    80     RTPrintf("tstUtf8: TEST 1\n");
    81 
    8276    /*
    8377     * Invalid UTF-8 to UCS-2 test.
    8478     */
     79    RTTestSub(hTest, "Feeding bad UTF-8 to RTStrToUtf16");
    8580    rc = RTStrToUtf16(s_szBadString1, &pwsz);
    86     if (rc != VERR_NO_TRANSLATION && rc != VERR_INVALID_UTF8_ENCODING)
    87     {
    88         RTPrintf("tstUtf8: FAILURE - %d: Conversion of first bad UTF-8 string to UTF-16 apparantly succeeded. It shouldn't. rc=%Rrc\n",
    89                  __LINE__, rc);
    90         g_cErrors++;
    91     }
     81    RTTEST_CHECK_MSG(hTest, rc == rc != VERR_NO_TRANSLATION || rc == VERR_INVALID_UTF8_ENCODING,
     82                     (hTest, RTTESTLVL_FAILURE, "Conversion of first bad UTF-8 string to UTF-16 apparantly succeeded. It shouldn't. rc=%Rrc\n", rc));
    9283    rc = RTStrToUtf16(s_szBadString2, &pwsz);
    93     if (rc != VERR_NO_TRANSLATION && rc != VERR_INVALID_UTF8_ENCODING)
    94     {
    95         RTPrintf("tstUtf8: FAILURE - %d: Conversion of second bad UTF-8 strings to UTF-16 apparantly succeeded. It shouldn't. rc=%Rrc\n",
    96                  __LINE__, rc);
    97         g_cErrors++;
    98     }
     84    RTTEST_CHECK_MSG(hTest, rc == rc != VERR_NO_TRANSLATION || rc == VERR_INVALID_UTF8_ENCODING,
     85                     (hTest, RTTESTLVL_FAILURE, "Conversion of second bad UTF-8 strings to UTF-16 apparantly succeeded. It shouldn't. rc=%Rrc\n", rc));
    9986
    10087    /*
    10188     * Test current CP convertion.
    10289     */
     90    RTTestSub(hTest, "Rand UTF-16 -> UTF-8 -> CP -> UTF-8");
    10391    pwszRand = (PRTUTF16)RTMemAlloc(31 * sizeof(*pwsz));
    10492    srand((unsigned)RTTimeNanoTS());
     
    115103            rc = RTStrCurrentCPToUtf8(&pszUtf8, pszCurrent);
    116104            if (rc == VINF_SUCCESS)
    117                 RTPrintf("tstUtf8: Random UTF-16 -> UTF-8 -> Current -> UTF-8 successful.\n");
     105                RTTestPassed(hTest, "Random UTF-16 -> UTF-8 -> Current -> UTF-8 successful.\n");
    118106            else
    119             {
    120                 RTPrintf("tstUtf8: FAILURE - %d: The third part of random UTF-16 -> UTF-8 -> Current -> UTF-8 failed with return value %Rrc.\n",
     107                RTTestFailed(hTest, "%d: The third part of random UTF-16 -> UTF-8 -> Current -> UTF-8 failed with return value %Rrc.",
     108                             __LINE__, rc);
     109        }
     110        else if (rc == VERR_NO_TRANSLATION)
     111            RTTestPassed(hTest, "The second part of random UTF-16 -> UTF-8 -> Current -> UTF-8 returned VERR_NO_TRANSLATION.  This is probably as it should be.\n");
     112        else
     113            RTTestFailed(hTest, "%d: The second part of random UTF-16 -> UTF-8 -> Current -> UTF-8 failed with return value %Rrc.",
    121114                         __LINE__, rc);
    122                 g_cErrors++;
    123             }
    124         }
    125         else if (rc == VERR_NO_TRANSLATION)
    126             RTPrintf("tstUtf8: The second part of random UTF-16 -> UTF-8 -> Current -> UTF-8 returned VERR_NO_TRANSLATION.  This is probably as it should be.\n");
    127         else
    128         {
    129             RTPrintf("tstUtf8: FAILURE - %d: The second part of random UTF-16 -> UTF-8 -> Current -> UTF-8 failed with return value %Rrc.\n",
     115    }
     116    else
     117        RTTestFailed(hTest, "%d: The first part of random UTF-16 -> UTF-8 -> Current -> UTF-8 failed with return value %Rrc.",
    130118                     __LINE__, rc);
    131             g_cErrors++;
    132         }
    133     }
    134     else
    135     {
    136         RTPrintf("tstUtf8: FAILURE - %d: The first part of random UTF-16 -> UTF-8 -> Current -> UTF-8 failed with return value %Rrc.\n",
    137                  __LINE__, rc);
    138         g_cErrors++;
    139     }
    140119
    141120    /*
    142121     * Generate a new random string.
    143122     */
     123    RTTestSub(hTest, "Random UTF-16 -> UTF-8 -> UTF-16");
    144124    pwszRand = (PRTUTF16)RTMemAlloc(31 * sizeof(*pwsz));
    145125    srand((unsigned)RTTimeNanoTS());
     
    157137                /* nothing */;
    158138            if (pwszRand[i] == pwsz[i] && pwsz[i] == 0)
    159                 RTPrintf("tstUtf8: Random UTF-16 -> UTF-8 -> UTF-16 successful.\n");
     139                RTTestPassed(hTest, "Random UTF-16 -> UTF-8 -> UTF-16 successful.\n");
    160140            else
    161141            {
    162                 RTPrintf("tstUtf8: FAILURE - %d: The second part of random UTF-16 -> UTF-8 -> UTF-16 failed.\n", __LINE__);
    163                 RTPrintf("tstUtf8: First differing character is at position %d and has the value %x.\n", i, pwsz[i]);
    164                 g_cErrors++;
     142                RTTestFailed(hTest, "%d: The second part of random UTF-16 -> UTF-8 -> UTF-16 failed.", __LINE__);
     143                RTTestPrintf(hTest, RTTESTLVL_FAILURE, "First differing character is at position %d and has the value %x.\n", i, pwsz[i]);
    165144            }
    166145        }
    167146        else
    168         {
    169             RTPrintf("tstUtf8: FAILURE - %d: The second part of random UTF-16 -> UTF-8 -> UTF-16 failed with return value %Rrc.\n",
     147            RTTestFailed(hTest, "%d: The second part of random UTF-16 -> UTF-8 -> UTF-16 failed with return value %Rrc.",
     148                         __LINE__, rc);
     149    }
     150    else
     151        RTTestFailed(hTest, "%d: The first part of random UTF-16 -> UTF-8 -> UTF-16 failed with return value %Rrc.",
    170152                     __LINE__, rc);
    171             g_cErrors++;
    172         }
    173     }
    174     else
    175     {
    176         RTPrintf("tstUtf8: FAILURE - %d: The first part of random UTF-16 -> UTF-8 -> UTF-16 failed with return value %Rrc.\n",
    177                  __LINE__, rc);
    178         g_cErrors++;
    179     }
    180153
    181154    /*
    182155     * Generate yet another random string and convert it to a buffer.
    183156     */
     157    RTTestSub(hTest, "Random RTUtf16ToUtf8Ex + RTStrToUtf16");
    184158    pwszRand = (PRTUTF16)RTMemAlloc(31 * sizeof(*pwsz));
    185159    srand((unsigned)RTTimeNanoTS());
     
    200174                ;
    201175            if (pwsz[i] == 0 && i >= 8)
    202                 RTPrintf("tstUtf8: Random UTF-16 -> fixed length UTF-8 -> UTF-16 successful.\n");
     176                RTTestPassed(hTest, "Random UTF-16 -> fixed length UTF-8 -> UTF-16 successful.\n");
    203177            else
    204178            {
    205                 RTPrintf("tstUtf8: FAILURE - %d: Incorrect conversion of UTF-16 -> fixed length UTF-8 -> UTF-16.\n", __LINE__);
    206                 RTPrintf("tstUtf8: First differing character is at position %d and has the value %x.\n", i, pwsz[i]);
    207                 g_cErrors++;
     179                RTTestFailed(hTest, "%d: Incorrect conversion of UTF-16 -> fixed length UTF-8 -> UTF-16.\n", __LINE__);
     180                RTTestPrintf(hTest, RTTESTLVL_FAILURE, "First differing character is at position %d and has the value %x.\n", i, pwsz[i]);
    208181            }
    209182        }
    210183        else
    211         {
    212             RTPrintf("tstUtf8: FAILURE - %d: The second part of random UTF-16 -> fixed length UTF-8 -> UTF-16 failed with return value %Rrc.\n",
    213                      __LINE__, rc);
    214             g_cErrors++;
    215         }
     184            RTTestFailed(hTest, "%d: The second part of random UTF-16 -> fixed length UTF-8 -> UTF-16 failed with return value %Rrc.\n", __LINE__, rc);
    216185    }
    217186    else
    218     {
    219         RTPrintf("tstUtf8: FAILURE - %d: The first part of random UTF-16 -> fixed length UTF-8 -> UTF-16 failed with return value %Rrc.\n",
    220                  __LINE__, rc);
    221         g_cErrors++;
    222     }
     187        RTTestFailed(hTest, "%d: The first part of random UTF-16 -> fixed length UTF-8 -> UTF-16 failed with return value %Rrc.\n", __LINE__, rc);
    223188
    224189    /*
    225190     * And again.
    226191     */
     192    RTTestSub(hTest, "Random RTUtf16ToUtf8 + RTStrToUtf16Ex");
    227193    pwszRand = (PRTUTF16)RTMemAlloc(31 * sizeof(*pwsz));
    228194    srand((unsigned)RTTimeNanoTS());
     
    243209                ;
    244210            if (pwszRand[i] == 0 && pwsz2Buf[i] == 0)
    245                 RTPrintf("tstUtf8: Random UTF-16 -> UTF-8 -> fixed length UTF-16 successful.\n");
     211                RTTestPassed(hTest, "Random UTF-16 -> UTF-8 -> fixed length UTF-16 successful.\n");
    246212            else
    247213            {
    248                 RTPrintf("tstUtf8: FAILURE - %d: Incorrect conversion of random UTF-16 -> UTF-8 -> fixed length UTF-16.\n", __LINE__);
    249                 RTPrintf("tstUtf8: First differing character is at position %d and has the value %x.\n", i, pwsz2Buf[i]);
    250                 g_cErrors++;
     214                RTTestFailed(hTest, "%d: Incorrect conversion of random UTF-16 -> UTF-8 -> fixed length UTF-16.\n", __LINE__);
     215                RTTestPrintf(hTest, RTTESTLVL_FAILURE, "First differing character is at position %d and has the value %x.\n", i, pwsz2Buf[i]);
    251216            }
    252217        }
    253218        else
    254         {
    255             RTPrintf("tstUtf8: FAILURE - %d: The second part of random UTF-16 -> UTF-8 -> fixed length UTF-16 failed with return value %Rrc.\n",
     219            RTTestFailed(hTest, "%d: The second part of random UTF-16 -> UTF-8 -> fixed length UTF-16 failed with return value %Rrc.\n", __LINE__, rc);
     220    }
     221    else
     222        RTTestFailed(hTest, "%d: The first part of random UTF-16 -> UTF-8 -> fixed length UTF-16 failed with return value %Rrc.\n",
    256223                     __LINE__, rc);
    257             g_cErrors++;
    258         }
    259     }
    260     else
    261     {
    262         RTPrintf("tstUtf8: FAILURE - %d: The first part of random UTF-16 -> UTF-8 -> fixed length UTF-16 failed with return value %Rrc.\n",
    263                  __LINE__, rc);
    264         g_cErrors++;
    265     }
    266224    pwszRand = (PRTUTF16)RTMemAlloc(31 * sizeof(*pwsz));
    267225    srand((unsigned)RTTimeNanoTS());
     
    272230    rc = RTUtf16ToUtf8Ex(pwszRand, RTSTR_MAX, &pszUtf8Array, 20, NULL);
    273231    if (rc == VERR_BUFFER_OVERFLOW)
    274         RTPrintf("tstUtf8: Random UTF-16 -> fixed length UTF-8 with too short buffer successfully rejected.\n");
     232        RTTestPassed(hTest, "Random UTF-16 -> fixed length UTF-8 with too short buffer successfully rejected.\n");
    275233    else
    276     {
    277         RTPrintf("tstUtf8: FAILURE - %d: Random UTF-16 -> fixed length UTF-8 with too small buffer returned value %d instead of VERR_BUFFER_OVERFLOW.\n",
    278                  __LINE__, rc);
    279         g_cErrors++;
    280     }
     234        RTTestFailed(hTest, "%d: Random UTF-16 -> fixed length UTF-8 with too small buffer returned value %d instead of VERR_BUFFER_OVERFLOW.\n",
     235                     __LINE__, rc);
    281236
    282237    /*
    283238     * last time...
    284239     */
     240    RTTestSub(hTest, "Random RTUtf16ToUtf8 + RTStrToUtf16Ex");
    285241    pwszRand = (PRTUTF16)RTMemAlloc(31 * sizeof(*pwsz));
    286242    srand((unsigned)RTTimeNanoTS());
     
    294250        rc = RTStrToUtf16Ex(pszUtf8, RTSTR_MAX, &pwsz2Buf, 20, NULL);
    295251        if (rc == VERR_BUFFER_OVERFLOW)
    296             RTPrintf("tstUtf8: Random UTF-16 -> UTF-8 -> fixed length UTF-16 with too short buffer successfully rejected.\n");
    297         else
    298         {
    299             RTPrintf("tstUtf8: FAILURE - %d: The second part of random UTF-16 -> UTF-8 -> fixed length UTF-16 with too short buffer returned value %Rrc instead of VERR_BUFFER_OVERFLOW.\n",
     252            RTTestPassed(hTest, "Random UTF-16 -> UTF-8 -> fixed length UTF-16 with too short buffer successfully rejected.\n");
     253        else
     254            RTTestFailed(hTest, "%d: The second part of random UTF-16 -> UTF-8 -> fixed length UTF-16 with too short buffer returned value %Rrc instead of VERR_BUFFER_OVERFLOW.\n",
     255                         __LINE__, rc);
     256    }
     257    else
     258        RTTestFailed(hTest, "%d:The first part of random UTF-16 -> UTF-8 -> fixed length UTF-16 failed with return value %Rrc.\n",
    300259                     __LINE__, rc);
    301             g_cErrors++;
    302         }
    303     }
    304     else
    305     {
    306         RTPrintf("tstUtf8: FAILURE - %d:The first part of random UTF-16 -> UTF-8 -> fixed length UTF-16 failed with return value %Rrc.\n",
    307                  __LINE__, rc);
    308         g_cErrors++;
    309     }
    310 
     260
     261
     262    RTTestSubDone(hTest);
    311263}
    312264
     
    321273    {
    322274        if (off < 0x7f)
    323             RTPrintf("UTF-8 U+%#x\n", off + 1);
     275            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-8 U+%#x\n", off + 1);
    324276        else if (off < 0xf7f)
    325             RTPrintf("UTF-8 U+%#x\n", (off - 0x7f) / 2 + 0x80);
     277            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-8 U+%#x\n", (off - 0x7f) / 2 + 0x80);
    326278        else if (off < 0x27f7f)
    327             RTPrintf("UTF-8 U+%#x\n", (off - 0xf7f) / 3 + 0x800);
     279            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-8 U+%#x\n", (off - 0xf7f) / 3 + 0x800);
    328280        else if (off < 0x2df79)
    329             RTPrintf("UTF-8 U+%#x\n", (off - 0x27f7f) / 3 + 0xe000);
     281            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-8 U+%#x\n", (off - 0x27f7f) / 3 + 0xe000);
    330282        else if (off < 0x42df79)
    331             RTPrintf("UTF-8 U+%#x\n", (off - 0x2df79) / 4 + 0x10000);
    332         else
    333             RTPrintf("UTF-8 ???\n");
     283            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-8 U+%#x\n", (off - 0x2df79) / 4 + 0x10000);
     284        else
     285            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-8 ???\n");
    334286    }
    335287    else if (cBits == 16)
    336288    {
    337289        if (off < 0xd7ff*2)
    338             RTPrintf("UTF-16 U+%#x\n", off / 2 + 1);
     290            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-16 U+%#x\n", off / 2 + 1);
    339291        else if (off < 0xf7fd*2)
    340             RTPrintf("UTF-16 U+%#x\n", (off - 0xd7ff*2) / 2 + 0xe000);
     292            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-16 U+%#x\n", (off - 0xd7ff*2) / 2 + 0xe000);
    341293        else if (off < 0x20f7fd)
    342             RTPrintf("UTF-16 U+%#x\n", (off - 0xf7fd*2) / 4 + 0x10000);
    343         else
    344             RTPrintf("UTF-16 ???\n");
     294            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-16 U+%#x\n", (off - 0xf7fd*2) / 4 + 0x10000);
     295        else
     296            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "UTF-16 ???\n");
    345297    }
    346298    else
    347299    {
    348300        if (off < (0xd800 - 1) * sizeof(RTUNICP))
    349             RTPrintf("RTUNICP U+%#x\n", off / sizeof(RTUNICP) + 1);
     301            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "RTUNICP U+%#x\n", off / sizeof(RTUNICP) + 1);
    350302        else if (off < (0xfffe - 0x800 - 1) * sizeof(RTUNICP))
    351             RTPrintf("RTUNICP U+%#x\n", off / sizeof(RTUNICP) + 0x800 + 1);
    352         else
    353             RTPrintf("RTUNICP U+%#x\n", off / sizeof(RTUNICP) + 0x800 + 1 + 2);
     303            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "RTUNICP U+%#x\n", off / sizeof(RTUNICP) + 0x800 + 1);
     304        else
     305            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "RTUNICP U+%#x\n", off / sizeof(RTUNICP) + 0x800 + 1 + 2);
    354306    }
    355307}
     
    363315        if (pb1[off] != pb2[off])
    364316        {
    365             RTPrintf("mismatch at %#x: ", off);
     317            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "mismatch at %#x: ", off);
    366318            whereami(cBits, off);
    367             RTPrintf(" %#x: %02x != %02x!\n", off-1, pb1[off-1], pb2[off-1]);
    368             RTPrintf("*%#x: %02x != %02x!\n", off, pb1[off], pb2[off]);
    369             RTPrintf(" %#x: %02x != %02x!\n", off+1, pb1[off+1], pb2[off+1]);
    370             RTPrintf(" %#x: %02x != %02x!\n", off+2, pb1[off+2], pb2[off+2]);
    371             RTPrintf(" %#x: %02x != %02x!\n", off+3, pb1[off+3], pb2[off+3]);
    372             RTPrintf(" %#x: %02x != %02x!\n", off+4, pb1[off+4], pb2[off+4]);
    373             RTPrintf(" %#x: %02x != %02x!\n", off+5, pb1[off+5], pb2[off+5]);
    374             RTPrintf(" %#x: %02x != %02x!\n", off+6, pb1[off+6], pb2[off+6]);
    375             RTPrintf(" %#x: %02x != %02x!\n", off+7, pb1[off+7], pb2[off+7]);
    376             RTPrintf(" %#x: %02x != %02x!\n", off+8, pb1[off+8], pb2[off+8]);
    377             RTPrintf(" %#x: %02x != %02x!\n", off+9, pb1[off+9], pb2[off+9]);
     319            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off-1, pb1[off-1], pb2[off-1]);
     320            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, "*%#x: %02x != %02x!\n", off, pb1[off], pb2[off]);
     321            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+1, pb1[off+1], pb2[off+1]);
     322            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+2, pb1[off+2], pb2[off+2]);
     323            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+3, pb1[off+3], pb2[off+3]);
     324            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+4, pb1[off+4], pb2[off+4]);
     325            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+5, pb1[off+5], pb2[off+5]);
     326            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+6, pb1[off+6], pb2[off+6]);
     327            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+7, pb1[off+7], pb2[off+7]);
     328            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+8, pb1[off+8], pb2[off+8]);
     329            RTTestPrintf(NIL_RTTEST, RTTESTLVL_FAILURE, " %#x: %02x != %02x!\n", off+9, pb1[off+9], pb2[off+9]);
    378330            return 1;
    379331        }
     
    383335
    384336
    385 void InitStrings(void)
     337void InitStrings()
    386338{
    387339    /*
     
    476428
    477429
    478 void test2(void)
    479 {
    480     RTPrintf("tstUtf8: TEST 2\n");
    481 
     430void test2(RTTEST hTest)
     431{
    482432    /*
    483433     * Convert to UTF-8 and back.
    484434     */
    485     RTPrintf("tstUtf8: #1: UTF-16 -> UTF-8 -> UTF-16...\n");
     435    RTTestSub(hTest, "UTF-16 -> UTF-8 -> UTF-16");
    486436    char *pszUtf8;
    487437    int rc = RTUtf16ToUtf8(&g_wszAll[0], &pszUtf8);
     
    489439    {
    490440        if (mymemcmp(pszUtf8, g_szAll, sizeof(g_szAll), 8))
    491         {
    492             RTPrintf("tstUtf8: FAILURE - the full #1: UTF-16 -> UTF-8 mismatch!\n");
    493             g_cErrors++;
    494         }
     441            RTTestFailed(hTest, "UTF-16 -> UTF-8 mismatch!");
    495442
    496443        PRTUTF16 pwszUtf16;
     
    499446        {
    500447            if (mymemcmp(pwszUtf16, g_wszAll, sizeof(g_wszAll), 16))
    501             {
    502                 RTPrintf("tstUtf8: FAILURE - the full #1: UTF-8 -> UTF-16 failed compare!\n");
    503                 g_cErrors++;
    504             }
     448                RTTestFailed(hTest, "UTF-8 -> UTF-16 failed compare!");
    505449            RTUtf16Free(pwszUtf16);
    506450        }
    507451        else
    508         {
    509             RTPrintf("tstUtf8: FAILURE - the full #1: UTF-8 -> UTF-16 failed, rc=%Rrc.\n", rc);
    510             g_cErrors++;
    511         }
     452            RTTestFailed(hTest, "UTF-8 -> UTF-16 failed, rc=%Rrc.", rc);
    512453        RTStrFree(pszUtf8);
    513454    }
    514455    else
    515     {
    516         RTPrintf("tstUtf8: FAILURE - the full #1: UTF-16 -> UTF-8 failed, rc=%Rrc.\n", rc);
    517         g_cErrors++;
    518     }
     456        RTTestFailed(hTest, "UTF-16 -> UTF-8 failed, rc=%Rrc.", rc);
    519457
    520458
     
    522460     * Convert to UTF-16 and back. (just in case the above test fails)
    523461     */
    524     RTPrintf("tstUtf8: #2: UTF-8 -> UTF-16 -> UTF-8...\n");
     462    RTTestSub(hTest, "UTF-8 -> UTF-16 -> UTF-8");
    525463    PRTUTF16 pwszUtf16;
    526464    rc = RTStrToUtf16(&g_szAll[0], &pwszUtf16);
     
    528466    {
    529467        if (mymemcmp(pwszUtf16, g_wszAll, sizeof(g_wszAll), 16))
    530         {
    531             RTPrintf("tstUtf8: FAILURE - the full #2: UTF-8 -> UTF-16 failed compare!\n");
    532             g_cErrors++;
    533         }
     468            RTTestFailed(hTest, "UTF-8 -> UTF-16 failed compare!");
    534469
    535470        char *pszUtf8;
     
    538473        {
    539474            if (mymemcmp(pszUtf8, g_szAll, sizeof(g_szAll), 8))
    540             {
    541                 RTPrintf("tstUtf8: FAILURE - the full #2: UTF-16 -> UTF-8 failed compare!\n");
    542                 g_cErrors++;
    543             }
     475                RTTestFailed(hTest, "UTF-16 -> UTF-8 failed compare!");
    544476            RTStrFree(pszUtf8);
    545477        }
    546478        else
    547         {
    548             RTPrintf("tstUtf8: FAILURE - the full #2: UTF-16 -> UTF-8 failed, rc=%Rrc.\n", rc);
    549             g_cErrors++;
    550         }
     479            RTTestFailed(hTest, "UTF-16 -> UTF-8 failed, rc=%Rrc.", rc);
    551480        RTUtf16Free(pwszUtf16);
    552481    }
    553482    else
    554     {
    555         RTPrintf("tstUtf8: FAILURE - the full #2: UTF-8 -> UTF-16 failed, rc=%Rrc.\n", rc);
    556         g_cErrors++;
    557     }
     483        RTTestFailed(hTest, "UTF-8 -> UTF-16 failed, rc=%Rrc.", rc);
    558484
    559485    /*
    560486     * Convert UTF-8 to CPs.
    561487     */
     488    RTTestSub(hTest, "UTF-8 -> UNI -> UTF-8");
    562489    PRTUNICP paCps;
    563490    rc = RTStrToUni(g_szAll, &paCps);
     
    565492    {
    566493        if (mymemcmp(paCps, g_uszAll, sizeof(g_uszAll), 32))
    567         {
    568             RTPrintf("tstUtf8: FAILURE - the full #2: UTF-8 -> UTF-16 failed, rc=%Rrc.\n", rc);
    569             g_cErrors++;
    570         }
     494            RTTestFailed(hTest, "UTF-8 -> UTF-16 failed, rc=%Rrc.", rc);
    571495
    572496        size_t cCps;
     
    575499        {
    576500            if (cCps != RT_ELEMENTS(g_uszAll) - 1)
    577             {
    578                 RTPrintf("tstUtf8: FAILURE - the full #3+: wrong Code Point count %zu, expected %zu\n", cCps, RT_ELEMENTS(g_uszAll) - 1);
    579                 g_cErrors++;
    580             }
    581         }
    582         else
    583         {
    584             RTPrintf("tstUtf8: FAILURE - the full #3+: UTF-8 -> Code Points failed, rc=%Rrc.\n", rc);
    585             g_cErrors++;
    586         }
     501                RTTestFailed(hTest, "wrong Code Point count %zu, expected %zu\n", cCps, RT_ELEMENTS(g_uszAll) - 1);
     502        }
     503        else
     504            RTTestFailed(hTest, "UTF-8 -> Code Points failed, rc=%Rrc.\n", rc);
    587505
    588506        /** @todo RTCpsToUtf8 or something. */
    589507    }
    590508    else
    591     {
    592         RTPrintf("tstUtf8: FAILURE - the full #3a: UTF-8 -> Code Points failed, rc=%Rrc.\n", rc);
    593         g_cErrors++;
    594     }
     509        RTTestFailed(hTest, "UTF-8 -> Code Points failed, rc=%Rrc.\n", rc);
    595510
    596511    /*
    597512     * Check the various string lengths.
    598513     */
     514    RTTestSub(hTest, "Lengths");
    599515    size_t cuc1 = RTStrCalcUtf16Len(g_szAll);
    600516    size_t cuc2 = RTUtf16Len(g_wszAll);
    601517    if (cuc1 != cuc2)
    602     {
    603         RTPrintf("tstUtf8: FAILURE - cuc1=%zu != cuc2=%zu\n", cuc1, cuc2);
    604         g_cErrors++;
    605     }
     518        RTTestFailed(hTest, "cuc1=%zu != cuc2=%zu\n", cuc1, cuc2);
    606519    //size_t cuc3 = RTUniLen(g_uszAll);
    607520
     
    610523     * Enumerate the strings.
    611524     */
     525    RTTestSub(hTest, "Code Point Getters and Putters");
    612526    char *pszPut1Base = (char *)RTMemAlloc(sizeof(g_szAll));
    613527    AssertRelease(pszPut1Base);
     
    629543        if (RT_FAILURE(rc))
    630544        {
    631             RTPrintf("tstUtf8: FAILURE - RTStrGetCpEx failed with rc=%Rrc at %.10Rhxs\n", rc, psz2);
     545            RTTestFailed(hTest, "RTStrGetCpEx failed with rc=%Rrc at %.10Rhxs", rc, psz2);
    632546            whereami(8, psz2 - &g_szAll[0]);
    633             g_cErrors++;
    634547            break;
    635548        }
     
    637550        if (pszPrev1 != psz2)
    638551        {
    639             RTPrintf("tstUtf8: FAILURE - RTStrPrevCp returned %p expected %p!\n", pszPrev1, psz2);
     552            RTTestFailed(hTest, "RTStrPrevCp returned %p expected %p!", pszPrev1, psz2);
    640553            whereami(8, psz2 - &g_szAll[0]);
    641             g_cErrors++;
    642554            break;
    643555        }
     
    645557        if (uc2 != uc1)
    646558        {
    647             RTPrintf("tstUtf8: FAILURE - RTStrGetCpEx and RTStrGetCp returned different CPs: %RTunicp != %RTunicp\n", uc2, uc1);
     559            RTTestFailed(hTest, "RTStrGetCpEx and RTStrGetCp returned different CPs: %RTunicp != %RTunicp", uc2, uc1);
    648560            whereami(8, psz2 - &g_szAll[0]);
    649             g_cErrors++;
    650561            break;
    651562        }
     
    653564        if (psz2 != psz1)
    654565        {
    655             RTPrintf("tstUtf8: FAILURE - RTStrGetCpEx and RTStrGetNext returned different next pointer!\n");
     566            RTTestFailed(hTest, "RTStrGetCpEx and RTStrGetNext returned different next pointer!");
    656567            whereami(8, psz2 - &g_szAll[0]);
    657             g_cErrors++;
    658568            break;
    659569        }
     
    663573        if (RT_FAILURE(rc))
    664574        {
    665             RTPrintf("tstUtf8: FAILURE - RTUtf16GetCpEx failed with rc=%Rrc at %.10Rhxs\n", rc, pwsz4);
     575            RTTestFailed(hTest, "RTUtf16GetCpEx failed with rc=%Rrc at %.10Rhxs", rc, pwsz4);
    666576            whereami(16, pwsz4 - &g_wszAll[0]);
    667             g_cErrors++;
    668577            break;
    669578        }
    670579        if (uc3 != uc2)
    671580        {
    672             RTPrintf("tstUtf8: FAILURE - RTUtf16GetCpEx and RTStrGetCp returned different CPs: %RTunicp != %RTunicp\n", uc3, uc2);
     581            RTTestFailed(hTest, "RTUtf16GetCpEx and RTStrGetCp returned different CPs: %RTunicp != %RTunicp", uc3, uc2);
    673582            whereami(16, pwsz4 - &g_wszAll[0]);
    674             g_cErrors++;
    675583            break;
    676584        }
     
    678586        if (uc3 != uc4)
    679587        {
    680             RTPrintf("tstUtf8: FAILURE - RTUtf16GetCpEx and RTUtf16GetCp returned different CPs: %RTunicp != %RTunicp\n", uc3, uc4);
     588            RTTestFailed(hTest, "RTUtf16GetCpEx and RTUtf16GetCp returned different CPs: %RTunicp != %RTunicp", uc3, uc4);
    681589            whereami(16, pwsz4 - &g_wszAll[0]);
    682             g_cErrors++;
    683590            break;
    684591        }
     
    686593        if (pwsz4 != pwsz3)
    687594        {
    688             RTPrintf("tstUtf8: FAILURE - RTUtf16GetCpEx and RTUtf16GetNext returned different next pointer!\n");
     595            RTTestFailed(hTest, "RTUtf16GetCpEx and RTUtf16GetNext returned different next pointer!");
    689596            whereami(8, pwsz4 - &g_wszAll[0]);
    690             g_cErrors++;
    691597            break;
    692598        }
     
    699605        if (pszPut1 - pszPut1Base != psz1 - &g_szAll[0])
    700606        {
    701             RTPrintf("tstUtf8: FAILURE - RTStrPutCp is not at the same offset! %p != %p\n",
    702                      pszPut1 - pszPut1Base, psz1 - &g_szAll[0]);
     607            RTTestFailed(hTest, "RTStrPutCp is not at the same offset! %p != %p",
     608                         pszPut1 - pszPut1Base, psz1 - &g_szAll[0]);
    703609            whereami(8, psz2 - &g_szAll[0]);
    704             g_cErrors++;
    705610            break;
    706611        }
     
    709614        if (pwszPut2 - pwszPut2Base != pwsz3 - &g_wszAll[0])
    710615        {
    711             RTPrintf("tstUtf8: FAILURE - RTStrPutCp is not at the same offset! %p != %p\n",
    712                      pwszPut2 - pwszPut2Base, pwsz3 - &g_wszAll[0]);
     616            RTTestFailed(hTest, "RTStrPutCp is not at the same offset! %p != %p",
     617                         pwszPut2 - pwszPut2Base, pwsz3 - &g_wszAll[0]);
    713618            whereami(8, pwsz4 - &g_wszAll[0]);
    714             g_cErrors++;
    715619            break;
    716620        }
     
    726630    {
    727631        if (mymemcmp(pszPut1Base, g_szAll, sizeof(g_szAll), 8))
    728         {
    729             RTPrintf("tstUtf8: FAILURE - RTStrPutCp encoded the string incorrectly.\n");
    730             g_cErrors++;
    731         }
     632            RTTestFailed(hTest, "RTStrPutCp encoded the string incorrectly.");
    732633        if (mymemcmp(pwszPut2Base, g_wszAll, sizeof(g_wszAll), 16))
    733         {
    734             RTPrintf("tstUtf8: FAILURE - RTUtf16PutCp encoded the string incorrectly.\n");
    735             g_cErrors++;
    736         }
     634            RTTestFailed(hTest, "RTUtf16PutCp encoded the string incorrectly.");
    737635    }
    738636
    739637    RTMemFree(pszPut1Base);
    740638    RTMemFree(pwszPut2Base);
     639
     640    RTTestSubDone(hTest);
    741641}
    742642
     
    745645 * Check case insensitivity.
    746646 */
    747 void test3(void)
    748 {
    749     RTPrintf("tstUtf8: TEST 3\n");
     647void test3(RTTEST hTest)
     648{
     649    RTTestSub(hTest, "Case Sensitivitity");
    750650
    751651    if (    RTUniCpToLower('a') != 'a'
     
    759659        ||  RTUniCpToUpper('z') != 'Z'
    760660        ||  RTUniCpToUpper('Z') != 'Z')
    761     {
    762         RTPrintf("tstUtf8: FAILURE - RTUniToUpper/Lower failed basic tests.\n");
    763         g_cErrors++;
    764     }
     661        RTTestFailed(hTest, "RTUniToUpper/Lower failed basic tests.\n");
    765662
    766663    if (RTUtf16ICmp(g_wszAll, g_wszAll))
    767     {
    768         RTPrintf("tstUtf8: FAILURE - RTUtf16ICmp failed the basic test.\n");
    769         g_cErrors++;
    770     }
     664        RTTestFailed(hTest, "RTUtf16ICmp failed the basic test.\n");
    771665
    772666    if (RTUtf16Cmp(g_wszAll, g_wszAll))
    773     {
    774         RTPrintf("tstUtf8: FAILURE - RTUtf16Cmp failed the basic test.\n");
    775         g_cErrors++;
    776     }
     667        RTTestFailed(hTest, "RTUtf16Cmp failed the basic test.\n");
    777668
    778669    static RTUTF16 s_wszTst1a[] = { 'a', 'B', 'c', 'D', 'E', 'f', 'g', 'h', 'i', 'j', 'K', 'L', 'm', 'N', 'o', 'P', 'q', 'r', 'S', 't', 'u', 'V', 'w', 'x', 'Y', 'Z', 0xc5, 0xc6, 0xf8, 0 };
     
    783674        ||  RTUtf16ICmp(s_wszTst1b, s_wszTst1a)
    784675        )
    785     {
    786         RTPrintf("tstUtf8: FAILURE - RTUtf16ICmp failed the alphabet test.\n");
    787         g_cErrors++;
    788     }
     676        RTTestFailed(hTest, "RTUtf16ICmp failed the alphabet test.\n");
    789677
    790678    if (    RTUtf16Cmp(s_wszTst1b, s_wszTst1b)
     
    793681        ||  !RTUtf16Cmp(s_wszTst1b, s_wszTst1a)
    794682        )
    795     {
    796         RTPrintf("tstUtf8: FAILURE - RTUtf16Cmp failed the alphabet test.\n");
    797         g_cErrors++;
    798     }
     683        RTTestFailed(hTest, "RTUtf16Cmp failed the alphabet test.\n");
     684
     685    RTTestSubDone(hTest);
    799686}
    800687
     
    803690 * Test the RTStr*Cmp functions.
    804691 */
    805 void TstRTStrXCmp(void)
    806 {
    807     RTPrintf("tstUtf8: TEST 4 - RTStr*Cmp\n");
     692void TstRTStrXCmp(RTTEST hTest)
     693{
    808694#define CHECK_DIFF(expr, op) \
    809695    do \
     
    811697        int iDiff = expr; \
    812698        if (!(iDiff op 0)) \
    813         { \
    814             RTPrintf("tstUtf8(%d): failure - %d " #op " 0: %s\n", __LINE__, iDiff, #expr); \
    815             g_cErrors++; \
    816         } \
     699            RTTestFailed(hTest, "%d: %d " #op " 0: %s\n", __LINE__, iDiff, #expr); \
    817700    } while (0)
    818701
    819702/** @todo test the non-ascii bits. */
    820703
     704    RTTestSub(hTest, "RTStrCmp");
    821705    CHECK_DIFF(RTStrCmp(NULL, NULL), == );
    822706    CHECK_DIFF(RTStrCmp(NULL, ""), < );
     
    832716
    833717
     718    RTTestSub(hTest, "RTStrNCmp");
    834719    CHECK_DIFF(RTStrNCmp(NULL, NULL, RTSTR_MAX), == );
    835720    CHECK_DIFF(RTStrNCmp(NULL, "", RTSTR_MAX), < );
     
    849734
    850735
     736    RTTestSub(hTest, "RTStrICmp");
    851737    CHECK_DIFF(RTStrICmp(NULL, NULL), == );
    852738    CHECK_DIFF(RTStrICmp(NULL, ""), < );
     
    869755
    870756
     757    RTTestSub(hTest, "RTStrNICmp");
    871758    CHECK_DIFF(RTStrNICmp(NULL, NULL, RTSTR_MAX), == );
    872759    CHECK_DIFF(RTStrNICmp(NULL, "", RTSTR_MAX), < );
     
    901788    /* We should continue using byte comparison when we hit the invalid CP.  Will assert in debug builds. */
    902789    // CHECK_DIFF(RTStrNICmp("AbCd\xff""eg", "aBcD\xff""eF", 6), ==);
     790
     791    RTTestSubDone(hTest);
    903792}
    904793
     
    908797 * Benchmark stuff.
    909798 */
    910 void Benchmarks(void)
    911 {
    912     RTPrintf("tstUtf8: BENCHMARKS\n");
     799void Benchmarks(RTTEST hTest)
     800{
    913801    static union
    914802    {
     
    917805    } s_Buf;
    918806
     807    RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "Benchmarking RTStrToUtf16Ex:  "); /** @todo figure this stuff into the test framework. */
    919808    PRTUTF16 pwsz = &s_Buf.wszBuf[0];
    920809    int rc = RTStrToUtf16Ex(&g_szAll[0], RTSTR_MAX, &pwsz, RT_ELEMENTS(s_Buf.wszBuf), NULL);
     
    928817            if (RT_FAILURE(rc))
    929818            {
    930                 RTPrintf("tstUtf8: UTF-8 -> UTF-16 benchmark failed at i=%d, rc=%Rrc\n", i, rc);
     819                RTTestFailed(hTest, "UTF-8 -> UTF-16 benchmark failed at i=%d, rc=%Rrc\n", i, rc);
    931820                break;
    932821            }
    933822        }
    934823        uint64_t u64Elapsed = RTTimeNanoTS() - u64Start;
    935         RTPrintf("tstUtf8: UTF-8 -> UTF-16: %d in %RI64ns\n", i, u64Elapsed);
    936     }
    937 
     824        RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%d in %RI64ns\n", i, u64Elapsed);
     825    }
     826
     827    RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "Benchmarking RTUtf16ToUtf8Ex: ");
    938828    char *psz = &s_Buf.szBuf[0];
    939829    rc = RTUtf16ToUtf8Ex(&g_wszAll[0], RTSTR_MAX, &psz, RT_ELEMENTS(s_Buf.szBuf), NULL);
     
    947837            if (RT_FAILURE(rc))
    948838            {
    949                 RTPrintf("tstUtf8: UTF-16 -> UTF-8 benchmark failed at i=%d, rc=%Rrc\n", i, rc);
     839                RTTestFailed(hTest, "UTF-16 -> UTF-8 benchmark failed at i=%d, rc=%Rrc\n", i, rc);
    950840                break;
    951841            }
    952842        }
    953843        uint64_t u64Elapsed = RTTimeNanoTS() - u64Start;
    954         RTPrintf("tstUtf8: UTF-16 -> UTF-8: %d in %RI64ns\n", i, u64Elapsed);
    955     }
    956 
     844        RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%d in %RI64ns\n", i, u64Elapsed);
     845    }
     846
     847}
     848
     849
     850/**
     851 * Tests RTStrStr and RTStrIStr.
     852 */
     853static void testStrStr(RTTEST hTest)
     854{
     855#define CHECK_NULL(expr) \
     856    do { \
     857        const char *pszRet = expr; \
     858        if (pszRet != NULL) \
     859            RTTestFailed(hTest, "%d: %#x -> %s expected NULL", __LINE__, #expr, pszRet); \
     860    } while (0)
     861
     862#define CHECK(expr, expect) \
     863    do { \
     864        const char *pszRet = expr; \
     865        if (    pszRet != expect \
     866            &&  (   (expect) == NULL  \
     867                 || pszRet == NULL \
     868                 || strcmp(pszRet, (expect)) ) \
     869            ) \
     870            RTTestFailed(hTest, "%d: %#x -> %s expected %s", __LINE__, #expr, pszRet, (expect)); \
     871    } while (0)
     872
     873
     874    RTTestSub(hTest, "RTStrStr");
     875    CHECK(RTStrStr("abcdef", ""), "abcdef");
     876    CHECK_NULL(RTStrStr("abcdef", NULL));
     877    CHECK_NULL(RTStrStr(NULL, ""));
     878    CHECK_NULL(RTStrStr(NULL, NULL));
     879    CHECK(RTStrStr("abcdef", "abcdef"), "abcdef");
     880    CHECK(RTStrStr("abcdef", "b"), "bcdef");
     881    CHECK(RTStrStr("abcdef", "bcdef"), "bcdef");
     882    CHECK(RTStrStr("abcdef", "cdef"), "cdef");
     883    CHECK(RTStrStr("abcdef", "cde"), "cdef");
     884    CHECK(RTStrStr("abcdef", "cd"), "cdef");
     885    CHECK(RTStrStr("abcdef", "c"), "cdef");
     886    CHECK(RTStrStr("abcdef", "f"), "f");
     887    CHECK(RTStrStr("abcdef", "ef"), "ef");
     888    CHECK(RTStrStr("abcdef", "e"), "ef");
     889    CHECK_NULL(RTStrStr("abcdef", "z"));
     890    CHECK_NULL(RTStrStr("abcdef", "A"));
     891    CHECK_NULL(RTStrStr("abcdef", "F"));
     892
     893    RTTestSub(hTest, "RTStrIStr");
     894    CHECK(RTStrIStr("abcdef", ""), "abcdef");
     895    CHECK_NULL(RTStrIStr("abcdef", NULL));
     896    CHECK_NULL(RTStrIStr(NULL, ""));
     897    CHECK_NULL(RTStrIStr(NULL, NULL));
     898    CHECK(RTStrIStr("abcdef", "abcdef"), "abcdef");
     899    CHECK(RTStrIStr("abcdef", "Abcdef"), "abcdef");
     900    CHECK(RTStrIStr("abcdef", "ABcDeF"), "abcdef");
     901    CHECK(RTStrIStr("abcdef", "b"), "bcdef");
     902    CHECK(RTStrIStr("abcdef", "B"), "bcdef");
     903    CHECK(RTStrIStr("abcdef", "bcdef"), "bcdef");
     904    CHECK(RTStrIStr("abcdef", "BCdEf"), "bcdef");
     905    CHECK(RTStrIStr("abcdef", "bCdEf"), "bcdef");
     906    CHECK(RTStrIStr("abcdef", "bcdEf"), "bcdef");
     907    CHECK(RTStrIStr("abcdef", "BcdEf"), "bcdef");
     908    CHECK(RTStrIStr("abcdef", "cdef"), "cdef");
     909    CHECK(RTStrIStr("abcdef", "cde"), "cdef");
     910    CHECK(RTStrIStr("abcdef", "cd"), "cdef");
     911    CHECK(RTStrIStr("abcdef", "c"), "cdef");
     912    CHECK(RTStrIStr("abcdef", "f"), "f");
     913    CHECK(RTStrIStr("abcdeF", "F"), "F");
     914    CHECK(RTStrIStr("abcdef", "F"), "f");
     915    CHECK(RTStrIStr("abcdef", "ef"), "ef");
     916    CHECK(RTStrIStr("EeEef", "e"), "EeEef");
     917    CHECK(RTStrIStr("EeEef", "E"), "EeEef");
     918    CHECK(RTStrIStr("EeEef", "EE"), "EeEef");
     919    CHECK(RTStrIStr("EeEef", "EEE"), "EeEef");
     920    CHECK(RTStrIStr("EeEef", "EEEF"), "eEef");
     921    CHECK_NULL(RTStrIStr("EeEef", "z"));
     922
     923#undef CHECK
     924#undef CHECK_NULL
     925    RTTestSubDone(hTest);
    957926}
    958927
     
    960929int main()
    961930{
    962     RTR3Init();
     931    /*
     932     * Init the runtime and stuff.
     933     */
     934    RTTEST hTest;
     935    if (    RT_FAILURE(RTR3Init())
     936        ||  RT_FAILURE(RTTestCreate("tstUtf8", &hTest)))
     937    {
     938        RTPrintf("tstBitstUtf8: fatal initialization error\n");
     939        return 1;
     940    }
     941    RTTestBanner(hTest);
    963942
    964943    InitStrings();
    965     test1();
    966     test2();
    967     test3();
    968     TstRTStrXCmp();
    969     Benchmarks();
     944    test1(hTest);
     945    test2(hTest);
     946    test3(hTest);
     947    TstRTStrXCmp(hTest);
     948    testStrStr(hTest);
     949    Benchmarks(hTest);
    970950
    971951    /*
    972952     * Summary
    973953     */
    974     if (!g_cErrors)
    975         RTPrintf("tstUtf8: SUCCESS\n");
    976     else
    977         RTPrintf("tstUtf8: FAILURE - %d errors!\n", g_cErrors);
    978 
    979     return !!g_cErrors;
    980 }
     954    return RTTestSummaryAndDestroy(hTest);
     955}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette