Changeset 72031 in vbox
- Timestamp:
- Apr 26, 2018 8:36:11 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/serial/SerialTest.cpp
r72029 r72031 325 325 * Verifies the data in the given RX buffer for correct transmission. 326 326 * 327 * @returns nothing.327 * @returns Flag whether verification failed. 328 328 * @param hTest The test handle to report errors to. 329 329 * @param pSerBuf The RX buffer pointer. 330 330 * @param iCntTx The current TX counter value the RX buffer should never get ahead of. 331 331 */ 332 static voidserialTestRxBufVerify(RTTEST hTest, PSERIALTESTTXRXBUFCNT pSerBuf, uint32_t iCntTx)332 static bool serialTestRxBufVerify(RTTEST hTest, PSERIALTESTTXRXBUFCNT pSerBuf, uint32_t iCntTx) 333 333 { 334 334 uint32_t offRx = 0; … … 349 349 } 350 350 351 if (fFailed)352 RTTestFailed(hTest, "Data corruption/loss detected\n");353 354 351 if (RT_UNLIKELY(pSerBuf->iCnt > iCntTx)) 352 { 353 fFailed = true; 355 354 RTTestFailed(hTest, "Overtook the send buffer, expected maximum counter value %u got %u\n", 356 355 iCntTx, pSerBuf->iCnt); 356 } 357 357 358 358 /* Remove processed data from the buffer and move the rest to the front. */ … … 363 363 pSerBuf->cbTxRxMax += offRx; 364 364 } 365 366 return fFailed; 365 367 } 366 368 … … 380 382 { 381 383 uint64_t tsStart = RTTimeMilliTS(); 384 bool fFailed = false; 382 385 SERIALTESTTXRXBUFCNT SerBufTx; 383 386 SERIALTESTTXRXBUFCNT SerBufRx; … … 408 411 break; 409 412 410 serialTestRxBufVerify(pSerialTest->hTest, &SerBufRx, SerBufTx.iCnt); 413 bool fRes = serialTestRxBufVerify(pSerialTest->hTest, &SerBufRx, SerBufTx.iCnt); 414 if (fRes && !fFailed) 415 { 416 fFailed = true; 417 RTTestFailed(pSerialTest->hTest, "Data corruption/loss detected\n"); 418 } 411 419 } 412 420 if ( RT_SUCCESS(rc)
Note:
See TracChangeset
for help on using the changeset viewer.