Changeset 36532 in vbox for trunk/src/VBox/Runtime/testcase/tstIprtList.cpp
- Timestamp:
- Apr 4, 2011 2:41:14 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70958
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstIprtList.cpp
r36527 r36532 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT Testcase - iprt::list.3 * IPRT Testcase - RTCList/RTCMTList. 4 4 */ 5 5 … … 348 348 } 349 349 350 /* define iprt::list here to see what happens without MT support ;)350 /* define RTCList here to see what happens without MT support ;) 351 351 * (valgrind is the preferred tool to check). */ 352 #define MTTESTLISTTYPE iprt::mtlist352 #define MTTESTLISTTYPE RTCMTList 353 353 #define MTTESTTYPE uint32_t 354 354 #define MTTESTITEMS 1000 … … 421 421 /* Make sure there is at least one item in the list. */ 422 422 while (pTestList->isEmpty()) {}; 423 a = pTestList->at(RTRandU32Ex(0, pTestList->size() - 1));423 a = pTestList->at(RTRandU32Ex(0, (uint32_t)pTestList->size() - 1)); 424 424 } 425 425 … … 442 442 /* Make sure there is at least one item in the list. */ 443 443 while (pTestList->isEmpty()) {}; 444 pTestList->replace(RTRandU32Ex(0, pTestList->size() - 1), 0xFF00FF00);444 pTestList->replace(RTRandU32Ex(0, (uint32_t)pTestList->size() - 1), 0xFF00FF00); 445 445 } 446 446 … … 463 463 /* Make sure there is at least one item in the list. */ 464 464 while (pTestList->isEmpty()) {}; 465 pTestList->removeAt(RTRandU32Ex(0, pTestList->size() - 1));465 pTestList->removeAt(RTRandU32Ex(0, (uint32_t)pTestList->size() - 1)); 466 466 } 467 467 … … 540 540 for (size_t i = 0; i < RT_ELEMENTS(au8TestInts); ++i) 541 541 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)); 544 544 545 545 uint16_t au16TestInts[s_cTestCount]; 546 546 for (size_t i = 0; i < RT_ELEMENTS(au16TestInts); ++i) 547 547 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)); 550 550 551 551 uint32_t au32TestInts[s_cTestCount]; 552 552 for (size_t i = 0; i < RT_ELEMENTS(au32TestInts); ++i) 553 553 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)); 556 556 557 557 /* … … 561 561 for (size_t i = 0; i < RT_ELEMENTS(au64TestInts); ++i) 562 562 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)); 565 565 566 566 /* 567 567 * Big size type (translate to internal pointer list). 568 568 */ 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)); 571 571 572 572 /*
Note:
See TracChangeset
for help on using the changeset viewer.