VirtualBox

Ignore:
Timestamp:
Nov 8, 2021 10:31:38 AM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: A bit more sanity checking in AudioTestSetClose(). bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioTest.cpp

    r92235 r92261  
    11781178        /* Update number of bound test objects. */
    11791179        PAUDIOTESTENTRY pTest;
     1180        uint32_t        cTests = 0;
    11801181        RTListForEach(&pSet->lstTest, pTest, AUDIOTESTENTRY, Node)
    11811182        {
     
    11841185            rc = audioTestManifestWrite(pSet, "%04RU32", pTest->cObj);
    11851186            AssertRCReturn(rc, rc);
     1187            cTests++; /* Sanity checking. */
    11861188        }
    11871189
     1190        AssertMsgReturn(pSet->cTests == cTests, ("Test count and list don't match"), VERR_INTERNAL_ERROR);
     1191
    11881192        /*
    1189          * Update number of ran tests.
     1193         * Update number of total objects.
    11901194         */
    11911195        rc = RTFileSeek(pSet->f.hFile, pSet->offObjCount, RTFILE_SEEK_BEGIN, NULL);
     
    11951199
    11961200        /*
    1197          * Update number of ran tests.
     1201         * Update number of total tests.
    11981202         */
    11991203        rc = RTFileSeek(pSet->f.hFile, pSet->offTestCount, RTFILE_SEEK_BEGIN, NULL);
     
    12091213
    12101214        PAUDIOTESTOBJINT pObj;
     1215        uint32_t         cObj = 0;
    12111216        RTListForEach(&pSet->lstObj, pObj, AUDIOTESTOBJINT, Node)
    12121217        {
     
    12611266                }
    12621267            }
     1268
     1269            cObj++; /* Sanity checking. */
    12631270        }
     1271
     1272        AssertMsgReturn(pSet->cObj == cObj, ("Object count and list don't match"), VERR_INTERNAL_ERROR);
    12641273
    12651274        int rc2 = RTFileClose(pSet->f.hFile);
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