VirtualBox

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


Ignore:
Timestamp:
Aug 13, 2008 10:14:09 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34645
Message:

Fix for unicode RTStrFormat testcase on Unix

File:
1 edited

Legend:

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

    r11376 r11381  
    415415
    416416
    417     cch = RTStrPrintf(szStr, sizeof(szStr), "%-10ls %-30ls %ls", L"cmd", L"args", L"description");
    418     CHECKSTR("cmd        args                           description");
    419 
    420     cch = RTStrPrintf(szStr, sizeof(szStr), "%-10ls %-30ls %ls", L"cmd", L"", L"description");
    421     CHECKSTR("cmd                                       description");
    422 
    423 
    424417    cch = RTStrPrintf(szStr, sizeof(szStr),  "%*s", 0, "");
    425418    CHECKSTR("");
     
    438431    cch = RTStrPrintf(szStr, sizeof(szStr), "%.5Ls", s_usz1);
    439432    CHECKSTR("hello");
     433
     434    /*
     435     * Unicode string formatting.
     436     */
     437    static RTUTF16 s_wszEmpty[]  = { 0 }; //assumes ascii.
     438    static RTUTF16 s_wszCmd[]    = { 'c', 'm', 'd', 0 }; //assumes ascii.
     439    static RTUTF16 s_wszArgs[]   = { 'a', 'r', 'g', 's', 0 }; //assumes ascii.
     440    static RTUTF16 s_wszDesc[]   = { 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', 0 }; //assumes ascii.
     441
     442//            0         1         2         3         4         5         6         7
     443//            0....5....0....5....0....5....0....5....0....5....0....5....0....5....0
     444    cch = RTStrPrintf(szStr, sizeof(szStr), "%-10ls %-30ls %ls", s_wszCmd, s_wszArgs, s_wszDesc);
     445    CHECKSTR("cmd        args                           description");
     446
     447    cch = RTStrPrintf(szStr, sizeof(szStr), "%-10ls %-30ls %ls", s_wszCmd, s_wszEmpty, s_wszDesc);
     448    CHECKSTR("cmd                                       description");
     449
    440450
    441451#if 0
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