Changeset 62721 in vbox
- Timestamp:
- Jul 29, 2016 10:31:28 PM (8 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstLog.cpp
r62477 r62721 64 64 RTLogPrintf("%%RHv: %RHv\n", (RTGCPTR)0x87654321); 65 65 66 RTLogPrintf("%%RI8 : %RI8\n", (uint8_t)8 08);66 RTLogPrintf("%%RI8 : %RI8\n", (uint8_t)88); 67 67 RTLogPrintf("%%RI16: %RI16\n", (uint16_t)16016); 68 68 RTLogPrintf("%%RI32: %RI32\n", _1G); 69 69 RTLogPrintf("%%RI64: %RI64\n", _1E); 70 70 71 RTLogPrintf("%%RU8 : %RU8\n", (uint8_t)8 08);71 RTLogPrintf("%%RU8 : %RU8\n", (uint8_t)88); 72 72 RTLogPrintf("%%RU16: %RU16\n", (uint16_t)16016); 73 73 RTLogPrintf("%%RU32: %RU32\n", _2G32); 74 74 RTLogPrintf("%%RU64: %RU64\n", _2E); 75 75 76 RTLogPrintf("%%RX8 : %RX8 %#RX8\n", (uint8_t)8 08, (uint8_t)808);76 RTLogPrintf("%%RX8 : %RX8 %#RX8\n", (uint8_t)88, (uint8_t)88); 77 77 RTLogPrintf("%%RX16: %RX16 %#RX16\n", (uint16_t)16016, (uint16_t)16016); 78 78 RTLogPrintf("%%RX32: %RX32 %#RX32\n", _2G32, _2G32); -
trunk/src/VBox/Runtime/testcase/tstRTCritSect.cpp
r62592 r62721 152 152 static DECLCALLBACK(int) ThreadTest1(RTTHREAD ThreadSelf, void *pvArgs) 153 153 { 154 RT_NOREF1(ThreadSelf); 154 155 THREADTEST1ARGS Args = *(PTHREADTEST1ARGS)pvArgs; 155 156 Log2(("ThreadTest1: Start - iThread=%d ThreadSelf=%p\n", Args.iThread, ThreadSelf)); … … 246 247 static DECLCALLBACK(int) ThreadTest2(RTTHREAD ThreadSelf, void *pvArg) 247 248 { 249 RT_NOREF1(ThreadSelf); 248 250 PTHREADTEST2ARGS pArgs = (PTHREADTEST2ARGS)pvArg; 249 251 Log2(("ThreadTest2: Start - iThread=%d ThreadSelf=%p\n", pArgs->iThread, ThreadSelf)); … … 312 314 } 313 315 } 314 ASMAtomicCmpXchgU32(pArgs->pu32Alone, pArgs->iThread, ~0);316 ASMAtomicCmpXchgU32(pArgs->pu32Alone, pArgs->iThread, UINT32_MAX); 315 317 for (u32 = 0; u32 < pArgs->cCheckLoops; u32++) 316 318 { … … 322 324 } 323 325 } 324 ASMAtomicXchgU32(pArgs->pu32Alone, ~0);326 ASMAtomicXchgU32(pArgs->pu32Alone, UINT32_MAX); 325 327 326 328 /* … … 376 378 RTTEST_CHECK_RC_RET(g_hTest, RTSemEventCreate(&EventDone), VINF_SUCCESS, 1); 377 379 uint32_t volatile u32Release = 0; 378 uint32_t volatile u32Alone = ~0;379 uint32_t volatile u32Prev = ~0;380 uint32_t volatile u32Alone = UINT32_MAX; 381 uint32_t volatile u32Prev = UINT32_MAX; 380 382 uint32_t volatile cSeq = 0; 381 383 uint32_t volatile cReordered = 0; -
trunk/src/VBox/Runtime/testcase/tstRTGetOptArgv.cpp
r62477 r62721 431 431 432 432 433 /* Global to avoid weird C4640 warning about "construction of local static object is not thread-safe". */ 434 static const struct 435 { 436 const char * const apszArgs[5]; 437 const char *pszCmdLine; 438 } g_aMscCrtTests[] = 439 { 440 { 441 { "abcd", "a ", " b", " c ", NULL }, 442 "abcd \"a \" \" b\" \" c \"" 443 }, 444 { 445 { "a\\\\\\b", "de fg", "h", NULL, NULL }, 446 "a\\\\\\b \"de fg\" h" 447 }, 448 { 449 { "a\\\"b", "c", "d", "\"", NULL }, 450 "\"a\\\\\\\"b\" c d \"\\\"\"" 451 }, 452 { 453 { "a\\\\b c", "d", "e", " \\", NULL }, 454 "\"a\\\\b c\" d e \" \\\\\"" 455 }, 456 }; 457 433 458 static void tst2(void) 434 459 { 435 460 RTTestISub("RTGetOptArgvToString / MS_CRT"); 436 461 437 static const struct 438 { 439 const char * const apszArgs[5]; 440 const char *pszCmdLine; 441 } s_aMscCrtTests[] = 442 { 443 { 444 { "abcd", "a ", " b", " c ", NULL }, 445 "abcd \"a \" \" b\" \" c \"" 446 }, 447 { 448 { "a\\\\\\b", "de fg", "h", NULL, NULL }, 449 "a\\\\\\b \"de fg\" h" 450 }, 451 { 452 { "a\\\"b", "c", "d", "\"", NULL }, 453 "\"a\\\\\\\"b\" c d \"\\\"\"" 454 }, 455 { 456 { "a\\\\b c", "d", "e", " \\", NULL }, 457 "\"a\\\\b c\" d e \" \\\\\"" 458 }, 459 }; 460 461 for (size_t i = 0; i < RT_ELEMENTS(s_aMscCrtTests); i++) 462 for (size_t i = 0; i < RT_ELEMENTS(g_aMscCrtTests); i++) 462 463 { 463 464 char *pszCmdLine = NULL; 464 int rc = RTGetOptArgvToString(&pszCmdLine, s_aMscCrtTests[i].apszArgs, RTGETOPTARGV_CNV_QUOTE_MS_CRT);465 int rc = RTGetOptArgvToString(&pszCmdLine, g_aMscCrtTests[i].apszArgs, RTGETOPTARGV_CNV_QUOTE_MS_CRT); 465 466 RTTESTI_CHECK_RC_RETV(rc, VINF_SUCCESS); 466 if (!strcmp( s_aMscCrtTests[i].pszCmdLine, pszCmdLine))467 tstCheckNativeMsCrtToArgv(pszCmdLine, -1, s_aMscCrtTests[i].apszArgs);467 if (!strcmp(g_aMscCrtTests[i].pszCmdLine, pszCmdLine)) 468 tstCheckNativeMsCrtToArgv(pszCmdLine, -1, g_aMscCrtTests[i].apszArgs); 468 469 else 469 470 RTTestIFailed("g_aTest[%i] failed:\n" 470 471 " got '%s'\n" 471 472 " expected '%s'\n", 472 i, pszCmdLine, s_aMscCrtTests[i].pszCmdLine);473 i, pszCmdLine, g_aMscCrtTests[i].pszCmdLine); 473 474 RTStrFree(pszCmdLine); 474 475 } -
trunk/src/VBox/Runtime/testcase/tstRTInlineAsm.cpp
r62570 r62721 640 640 CHECKVAL(*pu8, 0, "%#x"); 641 641 642 CHECKOP(ASMAtomicXchgU8(pu8, 0xff), 0, "%#x", uint8_t);642 CHECKOP(ASMAtomicXchgU8(pu8, UINT8_C(0xff)), 0, "%#x", uint8_t); 643 643 CHECKVAL(*pu8, 0xff, "%#x"); 644 644 645 CHECKOP(ASMAtomicXchgU8(pu8, 0x87), 0xffff, "%#x", uint8_t);645 CHECKOP(ASMAtomicXchgU8(pu8, UINT8_C(0x87)), UINT8_C(0xff), "%#x", uint8_t); 646 646 CHECKVAL(*pu8, 0x87, "%#x"); 647 647 } … … 1434 1434 pbBuf2[offEnd] = 0xff; 1435 1435 } 1436 #ifdef _MSC_VER /* simple stupid compiler warnings */ 1437 else 1438 bSaved1 = bSaved2 = 0; 1439 #endif 1436 1440 1437 1441 uint8_t *pbRet = (uint8_t *)ASMMemFirstMismatchingU8(pbBuf1 + offStart, cb, bFiller1); … … 1667 1671 u64Out = ASMByteSwapU64(u64In); 1668 1672 CHECKVAL(u64Out, u64In, "%#018RX64"); 1669 u64In = ~(uint64_t)0;1673 u64In = UINT64_MAX; 1670 1674 u64Out = ASMByteSwapU64(u64In); 1671 1675 CHECKVAL(u64Out, u64In, "%#018RX64"); … … 1686 1690 u32Out = ASMByteSwapU32(u32In); 1687 1691 CHECKVAL(u32Out, u32In, "%#010RX32"); 1688 u32In = ~(uint32_t)0;1692 u32In = UINT32_MAX; 1689 1693 u32Out = ASMByteSwapU32(u32In); 1690 1694 CHECKVAL(u32Out, u32In, "%#010RX32"); … … 1705 1709 u16Out = ASMByteSwapU16(u16In); 1706 1710 CHECKVAL(u16Out, u16In, "%#06RX16"); 1707 u16In = ~(uint16_t)0;1711 u16In = UINT16_MAX; 1708 1712 u16Out = ASMByteSwapU16(u16In); 1709 1713 CHECKVAL(u16Out, u16In, "%#06RX16"); -
trunk/src/VBox/Runtime/testcase/tstRTMemWipe.cpp
r62477 r62721 46 46 for (uint32_t p = 0; p < RTRandU32Ex(1, 64); p++) 47 47 { 48 size_t cbAlloc = RTRandS32Ex(1, _1M) * sizeof(uint8_t);48 uint32_t cbAlloc = RTRandS32Ex(1, _1M) * sizeof(uint8_t); 49 49 50 50 RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "Testing wipe #%.02RU32 (%u bytes) ...\n", … … 69 69 continue; 70 70 } 71 size_t cbWipeRand = RTRandU32Ex(1, cbAlloc);71 uint32_t cbWipeRand = RTRandU32Ex(1, cbAlloc); 72 72 RTMemWipeThoroughly(pvWipe, RT_MIN(cbAlloc, cbWipeRand), p /* Passes */); 73 73 if (!memcmp(pvWipe, pvBuf, cbAlloc)) -
trunk/src/VBox/Runtime/testcase/tstRTPipe.cpp
r62477 r62721 252 252 RTPIPE hPipeR = (RTPIPE)1; 253 253 RTPIPE hPipeW = (RTPIPE)1; 254 RTTESTI_CHECK_RC(RTPipeCreate(&hPipeR, &hPipeW, ~0), VERR_INVALID_PARAMETER);254 RTTESTI_CHECK_RC(RTPipeCreate(&hPipeR, &hPipeW, UINT32_MAX), VERR_INVALID_PARAMETER); 255 255 RTTESTI_CHECK_RC(RTPipeCreate(NULL, &hPipeW, 0), VERR_INVALID_POINTER); 256 256 RTTESTI_CHECK_RC(RTPipeCreate(&hPipeR, NULL, 0), VERR_INVALID_POINTER); -
trunk/src/VBox/Runtime/testcase/tstRTR0CommonDriver.h
r62477 r62721 47 47 char g_szSrvName[64]; 48 48 /** The length of the service name. */ 49 uint32_tg_cchSrvName;49 size_t g_cchSrvName; 50 50 /** The base address of the service module. */ 51 51 void *g_pvImageBase; -
trunk/src/VBox/Runtime/testcase/tstRTR0MemUserKernelDriver.cpp
r62477 r62721 49 49 extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) 50 50 { 51 RT_NOREF3(argc, argv, envp); 51 52 #ifndef VBOX 52 53 RTPrintf("tstSup: SKIPPED\n"); -
trunk/src/VBox/Runtime/testcase/tstRTR0SemMutexDriver.cpp
r62477 r62721 176 176 extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) 177 177 { 178 RT_NOREF3(argc, argv, envp); 178 179 #ifndef VBOX 179 180 RTPrintf("tstSup: SKIPPED\n"); -
trunk/src/VBox/Runtime/testcase/tstRTR0ThreadDriver.cpp
r62477 r62721 49 49 extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) 50 50 { 51 RT_NOREF3(argc, argv, envp); 51 52 #ifndef VBOX 52 53 RTPrintf("tstRTR0Thread: SKIPPED\n"); -
trunk/src/VBox/Runtime/testcase/tstRTR0ThreadPreemptionDriver.cpp
r62477 r62721 58 58 static DECLCALLBACK(int) MyThreadProc(RTTHREAD hSelf, void *pvCpuIdx) 59 59 { 60 RT_NOREF1(hSelf); 60 61 RTCPUSET Affinity; 61 62 RTCpuSetEmpty(&Affinity); … … 82 83 extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) 83 84 { 85 RT_NOREF3(argc, argv, envp); 84 86 #ifndef VBOX 85 87 RTPrintf("tstSup: SKIPPED\n");
Note:
See TracChangeset
for help on using the changeset viewer.