VirtualBox

Changeset 7418 in vbox for trunk/src/VBox/Runtime/testcase


Ignore:
Timestamp:
Mar 10, 2008 4:01:58 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28852
Message:

UCS-2 -> UTF-16.

Location:
trunk/src/VBox/Runtime/testcase
Files:
3 edited

Legend:

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

    r5999 r7418  
    160160                                 DirEntry.Info.ModificationTime,
    161161                                 DirEntry.Info.AccessTime);
    162                         if (fShortName && DirEntry.cucShortName)
    163                             RTPrintf(" %2d %lS\n", DirEntry.cucShortName, DirEntry.uszShortName);
     162                        if (fShortName && DirEntry.cwcShortName)
     163                            RTPrintf(" %2d %lS\n", DirEntry.cwcShortName, DirEntry.wszShortName);
    164164                        else
    165165                            RTPrintf(" %2d %s\n", DirEntry.cbName, DirEntry.szName);
  • trunk/src/VBox/Runtime/testcase/tstPath.cpp

    r5999 r7418  
    6666    if (RT_SUCCESS(rc))
    6767        RTPrintf("UserHome={%s}\n", szPath);
    68    
     68
    6969    /*
    7070     * RTPathAbsEx
     
    7373    static const char *aInput[] =
    7474    {
    75         // NULL, NULL, -- assertion in RTStrUtf8ToUcs2
     75        // NULL, NULL, -- assertion in RTStrToUtf16
    7676        NULL,                           "/absolute/..",
    7777        NULL,                           "/absolute\\\\../..",
  • trunk/src/VBox/Runtime/testcase/tstUtf8.cpp

    r5999 r7418  
    5050 * Generate a random codepoint for simple UTF-16 encoding.
    5151 */
    52 static RTUTF16 GetRandUcs2(void)
     52static RTUTF16 GetRandUtf16(void)
    5353{
    5454    RTUTF16 wc;
     
    100100    srand((unsigned)RTTimeNanoTS());
    101101    for (int i = 0; i < 30; i++)
    102         pwszRand[i] = GetRandUcs2();
     102        pwszRand[i] = GetRandUtf16();
    103103    pwszRand[30] = 0;
    104104
     
    141141    srand((unsigned)RTTimeNanoTS());
    142142    for (int i = 0; i < 30; i++)
    143         pwszRand[i] = GetRandUcs2();
     143        pwszRand[i] = GetRandUtf16();
    144144    pwszRand[30] = 0;
    145145    rc = RTUtf16ToUtf8(pwszRand, &pszUtf8);
     
    181181    srand((unsigned)RTTimeNanoTS());
    182182    for (int i = 0; i < 30; i++)
    183         pwszRand[i] = GetRandUcs2();
     183        pwszRand[i] = GetRandUtf16();
    184184    pwszRand[30] = 0;
    185185
     
    223223    srand((unsigned)RTTimeNanoTS());
    224224    for (int i = 0; i < 30; i++)
    225         pwszRand[i] = GetRandUcs2();
     225        pwszRand[i] = GetRandUtf16();
    226226    pwszRand[30] = 0;
    227227
     
    261261    srand((unsigned)RTTimeNanoTS());
    262262    for (int i = 0; i < 30; i++)
    263         pwszRand[i] = GetRandUcs2();
     263        pwszRand[i] = GetRandUtf16();
    264264    pwszRand[30] = 0;
    265265
     
    280280    srand((unsigned)RTTimeNanoTS());
    281281    for (int i = 0; i < 30; i++)
    282         pwszRand[i] = GetRandUcs2();
     282        pwszRand[i] = GetRandUtf16();
    283283    pwszRand[30] = 0;
    284284
     
    488488        }
    489489
    490         PRTUTF16 puszUcs2;
    491         rc = RTStrToUtf16(pszUtf8, &puszUcs2);
     490        PRTUTF16 pwszUtf16;
     491        rc = RTStrToUtf16(pszUtf8, &pwszUtf16);
    492492        if (rc == VINF_SUCCESS)
    493493        {
    494             if (mymemcmp(puszUcs2, g_wszAll, sizeof(g_wszAll), 16))
     494            if (mymemcmp(pwszUtf16, g_wszAll, sizeof(g_wszAll), 16))
    495495            {
    496496                RTPrintf("tstUtf8: FAILURE - the full #1: UTF-8 -> UTF-16 failed compare!\n");
    497497                g_cErrors++;
    498498            }
    499             RTUtf16Free(puszUcs2);
     499            RTUtf16Free(pwszUtf16);
    500500        }
    501501        else
     
    517517     */
    518518    RTPrintf("tstUtf8: #2: UTF-8 -> UTF-16 -> UTF-8...\n");
    519     PRTUTF16 puszUcs2;
    520     rc = RTStrToUtf16(&g_szAll[0], &puszUcs2);
     519    PRTUTF16 pwszUtf16;
     520    rc = RTStrToUtf16(&g_szAll[0], &pwszUtf16);
    521521    if (rc == VINF_SUCCESS)
    522522    {
    523         if (mymemcmp(puszUcs2, g_wszAll, sizeof(g_wszAll), 16))
     523        if (mymemcmp(pwszUtf16, g_wszAll, sizeof(g_wszAll), 16))
    524524        {
    525525            RTPrintf("tstUtf8: FAILURE - the full #2: UTF-8 -> UTF-16 failed compare!\n");
     
    528528
    529529        char *pszUtf8;
    530         rc = RTUtf16ToUtf8(puszUcs2, &pszUtf8);
     530        rc = RTUtf16ToUtf8(pwszUtf16, &pszUtf8);
    531531        if (rc == VINF_SUCCESS)
    532532        {
     
    543543            g_cErrors++;
    544544        }
    545         RTStrUcs2Free(puszUcs2);
     545        RTUtf16Free(pwszUtf16);
    546546    }
    547547    else
Note: See TracChangeset for help on using the changeset viewer.

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