- 時間撮記:
- 2023-2-17 下午12:40:38 (2 年 以前)
- svn:sync-xref-src-repo-rev:
- 155912
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/testcase/tstRTPipe.cpp
r98103 r98619 49 49 #include <iprt/process.h> 50 50 #include <iprt/string.h> 51 #ifdef RT_OS_WINDOWS 52 # include <iprt/system.h> 53 #endif 51 54 #include <iprt/test.h> 52 55 … … 55 58 * Global Variables * 56 59 *********************************************************************************************************************************/ 60 static RTTEST g_hTest = NIL_RTTEST; 57 61 static const char g_szTest4Message[] = "This is test #4, everything is working fine.\n\r"; 58 62 static const char g_szTest5Message[] = "This is test #5, everything is working fine.\n\r"; … … 214 218 { 215 219 RTTestISub("Full write buffer"); 216 217 220 #ifdef RT_OS_WINDOWS 218 221 /* Kludge! The RTPipeWrite+RTPipeWriteBlocking code is able to write twice the size … … 255 258 size_t cbRead; 256 259 RTTESTI_CHECK_RC(RTPipeReadBlocking(hPipeR, s_abBuf, cbToRead, &cbRead), VINF_SUCCESS); 257 RTTESTI_CHECK_RC(RTPipeSelectOne(hPipeW, 0), VINF_SUCCESS); 258 RTTESTI_CHECK_RC(RTPipeSelectOne(hPipeW, 1), VINF_SUCCESS); 259 260 size_t cbWritten = _1G; 261 rc = RTPipeWrite(hPipeW, s_abBuf, sizeof(s_abBuf), &cbWritten); 262 RTTESTI_CHECK(rc == VINF_SUCCESS); 260 261 #ifdef RT_OS_WINDOWS 262 /* Kludge! Older Windows NT versions does not complete a pending write till 263 all the pending data has been read and the pipe buffer is 264 completely empty. Applies to NT4, W2K, and XP. Though on XP the 265 test works at 50% for some reason and we can write double the 266 amount, so possibly a different issue there, so we'l 267 268 This does not seem to be a bug in pipe-win.cpp. */ 269 if (RTSystemGetNtVersion() < (uPct == 50 ? RTSYSTEM_MAKE_NT_VERSION(5,2,0) : RTSYSTEM_MAKE_NT_VERSION(6,0,0))) 270 RTTestIPrintf(RTTESTLVL_ALWAYS, "old buggy windows - skipping 2nd part (0: %Rrc, 1: %Rrc)\n", 271 RTPipeSelectOne(hPipeW, 0), RTPipeSelectOne(hPipeW, 1)); 272 else 273 #endif 274 { 275 RTTESTI_CHECK_RC(RTPipeSelectOne(hPipeW, 0), VINF_SUCCESS); 276 RTTESTI_CHECK_RC(RTPipeSelectOne(hPipeW, 1), VINF_SUCCESS); 277 278 size_t cbWritten = _1G; 279 rc = RTPipeWrite(hPipeW, s_abBuf, sizeof(s_abBuf), &cbWritten); 280 RTTESTI_CHECK(rc == VINF_SUCCESS); 281 } 263 282 } 264 283 … … 508 527 return tstRTPipe5Child(argv[2]); 509 528 510 RTTEST hTest; 511 int rc = RTTestInitAndCreate("tstRTPipe", &hTest); 529 int rc = RTTestInitAndCreate("tstRTPipe", &g_hTest); 512 530 if (rc) 513 531 return rc; 514 RTTestBanner( hTest);532 RTTestBanner(g_hTest); 515 533 516 534 /* … … 518 536 */ 519 537 tstRTPipe1(); 520 if (RTTestErrorCount( hTest) == 0)538 if (RTTestErrorCount(g_hTest) == 0) 521 539 { 522 540 bool fMayPanic = RTAssertMayPanic(); … … 536 554 * Summary. 537 555 */ 538 return RTTestSummaryAndDestroy( hTest);539 } 540 556 return RTTestSummaryAndDestroy(g_hTest); 557 } 558
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器