VirtualBox

Ignore:
Timestamp:
Apr 4, 2011 2:41:14 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70958
Message:

IPRT-C++: iprt::list -> RTCList; iprt::mtlist -> RTCMTList

File:
1 edited

Legend:

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

    r36527 r36532  
    11/* $Id$ */
    22/** @file
    3  * IPRT Testcase - iprt::list.
     3 * IPRT Testcase - RTCList/RTCMTList.
    44 */
    55
     
    348348}
    349349
    350 /* define iprt::list here to see what happens without MT support ;)
     350/* define RTCList here to see what happens without MT support ;)
    351351 * (valgrind is the preferred tool to check). */
    352 #define MTTESTLISTTYPE iprt::mtlist
     352#define MTTESTLISTTYPE RTCMTList
    353353#define MTTESTTYPE uint32_t
    354354#define MTTESTITEMS 1000
     
    421421        /* Make sure there is at least one item in the list. */
    422422        while (pTestList->isEmpty()) {};
    423         a = pTestList->at(RTRandU32Ex(0, pTestList->size() - 1));
     423        a = pTestList->at(RTRandU32Ex(0, (uint32_t)pTestList->size() - 1));
    424424    }
    425425
     
    442442        /* Make sure there is at least one item in the list. */
    443443        while (pTestList->isEmpty()) {};
    444         pTestList->replace(RTRandU32Ex(0, pTestList->size() - 1), 0xFF00FF00);
     444        pTestList->replace(RTRandU32Ex(0, (uint32_t)pTestList->size() - 1), 0xFF00FF00);
    445445    }
    446446
     
    463463        /* Make sure there is at least one item in the list. */
    464464        while (pTestList->isEmpty()) {};
    465         pTestList->removeAt(RTRandU32Ex(0, pTestList->size() - 1));
     465        pTestList->removeAt(RTRandU32Ex(0, (uint32_t)pTestList->size() - 1));
    466466    }
    467467
     
    540540    for (size_t i = 0; i < RT_ELEMENTS(au8TestInts); ++i)
    541541        au8TestInts[i] = (uint8_t)RTRandU32Ex(0, UINT8_MAX);
    542     test1<iprt::list,   uint8_t, uint8_t, uint8_t>("ST: Native type", au8TestInts, RT_ELEMENTS(au8TestInts));
    543     test1<iprt::mtlist, uint8_t, uint8_t, uint8_t>("MT: Native type", au8TestInts, RT_ELEMENTS(au8TestInts));
     542    test1<RTCList,   uint8_t, uint8_t, uint8_t>("ST: Native type", au8TestInts, RT_ELEMENTS(au8TestInts));
     543    test1<RTCMTList, uint8_t, uint8_t, uint8_t>("MT: Native type", au8TestInts, RT_ELEMENTS(au8TestInts));
    544544
    545545    uint16_t au16TestInts[s_cTestCount];
    546546    for (size_t i = 0; i < RT_ELEMENTS(au16TestInts); ++i)
    547547        au16TestInts[i] = (uint16_t)RTRandU32Ex(0, UINT16_MAX);
    548     test1<iprt::list,   uint16_t, uint16_t, uint16_t>("ST: Native type", au16TestInts, RT_ELEMENTS(au16TestInts));
    549     test1<iprt::mtlist, uint16_t, uint16_t, uint16_t>("MT: Native type", au16TestInts, RT_ELEMENTS(au16TestInts));
     548    test1<RTCList,   uint16_t, uint16_t, uint16_t>("ST: Native type", au16TestInts, RT_ELEMENTS(au16TestInts));
     549    test1<RTCMTList, uint16_t, uint16_t, uint16_t>("MT: Native type", au16TestInts, RT_ELEMENTS(au16TestInts));
    550550
    551551    uint32_t au32TestInts[s_cTestCount];
    552552    for (size_t i = 0; i < RT_ELEMENTS(au32TestInts); ++i)
    553553        au32TestInts[i] = RTRandU32();
    554     test1<iprt::list,   uint32_t, uint32_t, uint32_t>("ST: Native type", au32TestInts, RT_ELEMENTS(au32TestInts));
    555     test1<iprt::mtlist, uint32_t, uint32_t, uint32_t>("MT: Native type", au32TestInts, RT_ELEMENTS(au32TestInts));
     554    test1<RTCList,   uint32_t, uint32_t, uint32_t>("ST: Native type", au32TestInts, RT_ELEMENTS(au32TestInts));
     555    test1<RTCMTList, uint32_t, uint32_t, uint32_t>("MT: Native type", au32TestInts, RT_ELEMENTS(au32TestInts));
    556556
    557557    /*
     
    561561    for (size_t i = 0; i < RT_ELEMENTS(au64TestInts); ++i)
    562562        au64TestInts[i] = RTRandU64();
    563     test1<iprt::list,   uint64_t, uint64_t, uint64_t>("ST: Specialized type", au64TestInts, RT_ELEMENTS(au64TestInts));
    564     test1<iprt::mtlist, uint64_t, uint64_t, uint64_t>("MT: Specialized type", au64TestInts, RT_ELEMENTS(au64TestInts));
     563    test1<RTCList,   uint64_t, uint64_t, uint64_t>("ST: Specialized type", au64TestInts, RT_ELEMENTS(au64TestInts));
     564    test1<RTCMTList, uint64_t, uint64_t, uint64_t>("MT: Specialized type", au64TestInts, RT_ELEMENTS(au64TestInts));
    565565
    566566    /*
    567567     * Big size type (translate to internal pointer list).
    568568     */
    569     test1<iprt::list,   RTCString, RTCString *, const char *>("ST: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));
    570     test1<iprt::mtlist, RTCString, RTCString *, const char *>("MT: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));
     569    test1<RTCList,   RTCString, RTCString *, const char *>("ST: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));
     570    test1<RTCMTList, RTCString, RTCString *, const char *>("MT: Class type", g_apszTestStrings, RT_ELEMENTS(g_apszTestStrings));
    571571
    572572    /*
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