VirtualBox

Changeset 20606 in vbox


Ignore:
Timestamp:
Jun 15, 2009 11:49:07 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48658
Message:

IPRT/testcase: Use RTTestInitAndCreate.

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

Legend:

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

    r18991 r20606  
    5151     * Init the runtime and stuff.
    5252     */
    53     int rc;
    5453    RTTEST hTest;
    55     if (    RT_FAILURE(rc = RTR3Init())
    56         ||  RT_FAILURE(rc = RTTestCreate("tstFork", &hTest)))
    57     {
    58         RTPrintf("tstFork: fatal initialization error: %Rrc\n", rc);
    59         return 1;
    60     }
     54    int rc = RTTestInitAndCreate("tstFork", &hTest);
     55    if (rc)
     56        return rc;
    6157    RTTestBanner(hTest);
    6258
  • trunk/src/VBox/Runtime/testcase/tstPath.cpp

    r20101 r20606  
    5050     * Init RT+Test.
    5151     */
    52     int rc = RTR3Init();
    53     if (RT_FAILURE(rc))
    54         return 1;
    55 
    5652    RTTEST hTest;
    57     rc = RTTestCreate("tstPath", &hTest);
    58     if (RT_FAILURE(rc))
    59         return 1;
     53    int rc = RTTestInitAndCreate("tstPath", &hTest);
     54    if (rc)
     55        return rc;
    6056    RTTestBanner(hTest);
    6157
  • trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemptionDriver.cpp

    r19970 r20606  
    5656     * Init.
    5757     */
    58     int rc = RTR3InitAndSUPLib();
    59     if (RT_FAILURE(rc))
    60     {
    61         RTPrintf("tstR0ThreadPreemption: fatal error: RTR3InitAndSUPLib failed with rc=%Rrc\n", rc);
    62         return 1;
    63     }
    64 
    6558    RTTEST hTest;
    66     rc = RTTestCreate("tstR0ThreadPreemption", &hTest);
    67     if (RT_FAILURE(rc))
    68     {
    69         RTPrintf("tstR0ThreadPreemption: fatal error: RTTestCreate failed with rc=%Rrc\n", rc);
    70         return 1;
    71     }
     59    int rc = RTTestInitAndCreate("tstR0ThreadPreemption", &hTest);
     60    if (rc)
     61        return rc;
    7262    RTTestBanner(hTest);
    7363
  • trunk/src/VBox/Runtime/testcase/tstRTAvl.cpp

    r19945 r20606  
    10291029     * Init.
    10301030     */
    1031     int rc = RTR3Init();
    1032     if (RT_FAILURE(rc))
    1033         return 1;
    1034 
    10351031    RTTEST hTest;
    1036     rc = RTTestCreate("tstRTAvl", &hTest);
    1037     if (RT_FAILURE(rc))
    1038         return 1;
     1032    int rc = RTTestInitAndCreate("tstRTAvl", &hTest);
     1033    if (rc)
     1034        return rc;
     1035    RTTestBanner(hTest);
    10391036    g_hTest = hTest;
    1040     RTTestBanner(hTest);
    10411037
    10421038    rc = RTRandAdvCreateParkMiller(&g_hRand);
  • trunk/src/VBox/Runtime/testcase/tstRTBase64.cpp

    r19947 r20606  
    111111int main()
    112112{
    113     int rc = RTR3Init();
    114     if (RT_FAILURE(rc))
    115         return 1;
    116113    RTTEST hTest;
    117     rc = RTTestCreate("tstRTBase64", &hTest);
    118     if (RT_FAILURE(rc))
    119         return 1;
     114    int rc = RTTestInitAndCreate("tstRTBase64", &hTest);
     115    if (rc)
     116        return rc;
    120117    RTTestBanner(hTest);
    121118
  • trunk/src/VBox/Runtime/testcase/tstRTBitOperations.cpp

    r19948 r20606  
    130130     */
    131131    RTTEST hTest;
    132     if (    RT_FAILURE(RTR3Init())
    133         ||  RT_FAILURE(RTTestCreate("tstRTBitOperations", &hTest)))
    134     {
    135         RTPrintf("tstRTBitOperations: fatal initialization error\n");
    136         return 1;
    137     }
     132    int rc = RTTestInitAndCreate("tstRTBitOperations", &hTest);
     133    if (rc)
     134        return rc;
    138135    RTTestBanner(hTest);
    139136
  • trunk/src/VBox/Runtime/testcase/tstRTCidr.cpp

    r19950 r20606  
    6565int main()
    6666{
    67     int rc = RTR3Init();
    68     if (RT_FAILURE(rc))
    69         return 1;
    7067    RTTEST hTest;
    71     rc = RTTestCreate("tstRTCidr", &hTest);
    72     if (RT_FAILURE(rc))
    73         return 1;
     68    int rc = RTTestInitAndCreate("tstRTCidr", &hTest);
     69    if (rc)
     70        return rc;
    7471    RTTestBanner(hTest);
    7572
  • trunk/src/VBox/Runtime/testcase/tstRTCritSect.cpp

    r19954 r20606  
    458458int main(int argc, char **argv)
    459459{
    460     int rc = RTR3Init();
    461     if (RT_FAILURE(rc))
    462         return 1;
    463460    RTTEST hTest;
    464461#ifndef TRY_WIN32_CRT
    465     rc = RTTestCreate("tstRTCritSect", &hTest);
     462    int rc = RTTestInitAndCreate("tstRTCritSect", &hTest);
    466463#else
    467     rc = RTTestCreate("tstRTCritSectW32", &hTest);
     464    int rc = RTTestInitAndCreate("tstRTCritSectW32", &hTest);
    468465#endif
    469     if (RT_FAILURE(rc))
    470         return 1;
     466    if (rc)
     467        return rc;
     468    RTTestBanner(hTest);
    471469    g_hTest = hTest;
    472     RTTestBanner(hTest);
    473470
    474471    /* parse args. */
  • trunk/src/VBox/Runtime/testcase/tstRTMemPool.cpp

    r20575 r20606  
    299299int main()
    300300{
    301     int rc = RTR3Init();
    302     if (RT_FAILURE(rc))
    303         return 1;
    304301    RTTEST hTest;
    305     rc = RTTestCreate("tstRTMemPool", &hTest);
    306     if (RT_FAILURE(rc))
    307         return 1;
     302    int rc = RTTestInitAndCreate("tstRTMemPool", &hTest);
     303    if (rc)
     304        return rc;
     305    RTTestBanner(hTest);
    308306    g_hTest = hTest;
    309     RTTestBanner(hTest);
    310307
    311308    /*
  • trunk/src/VBox/Runtime/testcase/tstRTS3.cpp

    r20110 r20606  
    182182     * Initialize IPRT and create the test.
    183183     */
    184     int rc = RTR3Init();
    185     if (RT_FAILURE(rc))
    186         return 1;
    187184    RTTEST hTest;
    188     rc = RTTestCreate("tstRTS3", &hTest);
    189     if (RT_FAILURE(rc))
    190         return 1;
     185    int rc = RTTestInitAndCreate("tstRTS3", &hTest);
     186    if (rc)
     187        return rc;
    191188    RTTestBanner(hTest);
    192189
  • trunk/src/VBox/Runtime/testcase/tstRTTemp.cpp

    r20111 r20606  
    100100int main()
    101101{
    102     int rc = RTR3Init();
    103     if (RT_FAILURE(rc))
    104         return 1;
    105102    RTTEST hTest;
    106     rc = RTTestCreate("tstRTTemp", &hTest);
    107     if (RT_FAILURE(rc))
    108         return 1;
     103    int rc = RTTestInitAndCreate("tstRTTemp", &hTest);
     104    if (rc)
     105        return rc;
    109106    RTTestBanner(hTest);
    110107
  • trunk/src/VBox/Runtime/testcase/tstStrFormat.cpp

    r20600 r20606  
    6666int main()
    6767{
    68     int rc = RTR3Init();
    69     if (RT_FAILURE(rc))
    70         return 1;
    71     RTTEST      hTest;
    72     rc = RTTestCreate("tstStrFormat", &hTest);
    73     if (RT_FAILURE(rc))
    74         return 1;
     68    RTTEST hTest;
     69    int rc = RTTestInitAndCreate("tstStrFormat", &hTest);
     70    if (rc)
     71        return rc;
    7572    RTTestBanner(hTest);
    7673
     
    129126                      pszBuf, szCorrect);
    130127
    131     /* 
     128    /*
    132129     * allocation
    133130     */
     
    389386    RTStrFormatNumber(pszBuf,  100000, 10, 0, 0, RTSTR_F_THOUSAND_SEP); CHECKSTR("100 000");        memset(pszBuf, '!', BUF_SIZE);
    390387    RTStrFormatNumber(pszBuf, 1000000, 10, 0, 0, RTSTR_F_THOUSAND_SEP); CHECKSTR("1 000 000");      memset(pszBuf, '!', BUF_SIZE);
    391    
     388
    392389    CHECK42("%'u", 1,                              "1");
    393390    CHECK42("%'u", 10,                            "10");
  • trunk/src/VBox/Runtime/testcase/tstTermCallbacks.cpp

    r19897 r20606  
    8181int main(int argc, char **argv)
    8282{
    83     int rc;
    8483    RTTEST hTest;
    85     if (    RT_FAILURE(rc = RTR3Init())
    86         ||  RT_FAILURE(rc = RTTestCreate("tstTermCallback", &hTest)))
    87     {
    88         RTPrintf("tstTermCallbacks: RTR3Init or RTTestCreate failed: %Rrc\n", rc);
    89         return 1;
    90     }
     84    int rc = RTTestInitAndCreate("tstTermCallback", &hTest);
     85    if (rc)
     86        return rc;
    9187    RTTestBanner(hTest);
    9288
  • trunk/src/VBox/Runtime/testcase/tstUtf8.cpp

    r18847 r20606  
    4343#include <iprt/test.h>
    4444
    45 #include <stdlib.h>
     45#include <stdlib.h> /** @todo use our random. */
    4646
    4747
     
    929929{
    930930    /*
    931      * Init the runtime and stuff.
     931     * Init the runtime, test and say hello.
    932932     */
    933933    RTTEST hTest;
    934     if (    RT_FAILURE(RTR3Init())
    935         ||  RT_FAILURE(RTTestCreate("tstUtf8", &hTest)))
    936     {
    937         RTPrintf("tstBitstUtf8: fatal initialization error\n");
    938         return 1;
    939     }
     934    int rc = RTTestInitAndCreate("tstUtf8", &hTest);
     935    if (rc)
     936        return rc;
    940937    RTTestBanner(hTest);
    941938
     939    /*
     940     * Run the test.
     941     */
    942942    InitStrings();
    943943    test1(hTest);
     
    953953    return RTTestSummaryAndDestroy(hTest);
    954954}
     955
  • trunk/src/VBox/Runtime/testcase/tstUuid.cpp

    r19205 r20606  
    4343int main(int argc, char **argv)
    4444{
    45     int rc;
    4645    RTTEST hTest;
    47     if (    RT_FAILURE(rc = RTR3Init())
    48         ||  RT_FAILURE(rc = RTTestCreate("tstUuid", &hTest)))
    49     {
    50         RTPrintf("tstUuid: RTR3Init or RTTestCreate failed: %Rrc\n", rc);
    51         return 1;
    52     }
     46    int rc = RTTestInitAndCreate("tstUuid", &hTest);
     47    if (rc)
     48        return rc;
    5349    RTTestBanner(hTest);
    5450
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