VirtualBox

Changeset 72031 in vbox


Ignore:
Timestamp:
Apr 26, 2018 8:36:11 AM (7 years ago)
Author:
vboxsync
Message:

ValidationKit/tests/serial: Add verbose flag to avoid flooding the log with error messages by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/serial/SerialTest.cpp

    r72029 r72031  
    325325 * Verifies the data in the given RX buffer for correct transmission.
    326326 *
    327  * @returns nothing.
     327 * @returns Flag whether verification failed.
    328328 * @param   hTest               The test handle to report errors to.
    329329 * @param   pSerBuf             The RX buffer pointer.
    330330 * @param   iCntTx              The current TX counter value the RX buffer should never get ahead of.
    331331 */
    332 static void serialTestRxBufVerify(RTTEST hTest, PSERIALTESTTXRXBUFCNT pSerBuf, uint32_t iCntTx)
     332static bool serialTestRxBufVerify(RTTEST hTest, PSERIALTESTTXRXBUFCNT pSerBuf, uint32_t iCntTx)
    333333{
    334334    uint32_t offRx = 0;
     
    349349    }
    350350
    351     if (fFailed)
    352         RTTestFailed(hTest, "Data corruption/loss detected\n");
    353 
    354351    if (RT_UNLIKELY(pSerBuf->iCnt > iCntTx))
     352    {
     353        fFailed = true;
    355354        RTTestFailed(hTest, "Overtook the send buffer, expected maximum counter value %u got %u\n",
    356355                     iCntTx, pSerBuf->iCnt);
     356    }
    357357
    358358    /* Remove processed data from the buffer and move the rest to the front. */
     
    363363        pSerBuf->cbTxRxMax += offRx;
    364364    }
     365
     366    return fFailed;
    365367}
    366368
     
    380382{
    381383    uint64_t tsStart = RTTimeMilliTS();
     384    bool fFailed = false;
    382385    SERIALTESTTXRXBUFCNT SerBufTx;
    383386    SERIALTESTTXRXBUFCNT SerBufRx;
     
    408411                break;
    409412
    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            }
    411419        }
    412420        if (   RT_SUCCESS(rc)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette