VirtualBox

Changeset 92462 in vbox


Ignore:
Timestamp:
Nov 16, 2021 3:26:30 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Also use the test ID logging prefixes audioTestRecordTone(). bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp

    r92461 r92462  
    802802static int audioTestRecordTone(PAUDIOTESTIOOPTS pIoOpts, PAUDIOTESTENV pTstEnv, PAUDIOTESTSTREAM pStream, PAUDIOTESTTONEPARMS pParms)
    803803{
     804    uint32_t const idxTest = (uint8_t)pParms->Hdr.idxTest;
     805
    804806    const char *pcszPathOut = pTstEnv->Set.szPathAbs;
    805807
    806     RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Recording test tone (tone frequency is %RU16Hz, %RU32ms)\n", (uint16_t)pParms->dbFreqHz, pParms->msDuration);
    807     RTTestPrintf(g_hTest, RTTESTLVL_DEBUG,  "Writing to '%s'\n", pcszPathOut);
     808    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Recording test tone (tone frequency is %RU16Hz, %RU32ms)\n",
     809                 idxTest, (uint16_t)pParms->dbFreqHz, pParms->msDuration);
     810    RTTestPrintf(g_hTest, RTTESTLVL_DEBUG,  "Test #%RU32: Writing to '%s'\n", idxTest, pcszPathOut);
    808811
    809812    /** @todo Use .WAV here? */
     
    821824        uint32_t cbTestRec   = 0;
    822825
    823         RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Recording %RU32 bytes total\n", cbTestToRec);
     826        RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Recording %RU32 bytes total\n", idxTest, cbTestToRec);
    824827
    825828        /* We expect a pre + post beacon before + after the actual test tone.
     
    831834        if (cbBeacon)
    832835        {
    833             RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Expecting 2 x %RU32 bytes pre/post beacons\n", cbBeacon);
     836            RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Expecting 2 x %RU32 bytes pre/post beacons\n",
     837                         idxTest, cbBeacon);
    834838            if (g_uVerbosity >= 2)
    835                 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Waiting for %s beacon ...\n",
    836                              AudioTestBeaconTypeGetName(Beacon.enmType));
     839                RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Waiting for %s beacon ...\n",
     840                             idxTest, AudioTestBeaconTypeGetName(Beacon.enmType));
    837841        }
    838842
     
    869873            {
    870874                if (g_uVerbosity >= 3)
    871                     RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Stream is readable with %RU64ms (%RU32 bytes)\n",
    872                                  PDMAudioPropsBytesToMilli(pMix->pProps, cbCanRead), cbCanRead);
     875                    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Stream is readable with %RU64ms (%RU32 bytes)\n",
     876                                 idxTest, PDMAudioPropsBytesToMilli(pMix->pProps, cbCanRead), cbCanRead);
    873877
    874878                uint32_t const cbToRead   = RT_MIN(cbCanRead, cbSamplesAligned);
     
    911915                                    && g_uVerbosity >= 3)
    912916                                    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS,
    913                                                  "Detection of %s beacon started (%RU32ms recorded so far)\n",
    914                                                  AudioTestBeaconTypeGetName(Beacon.enmType),
     917                                                 "Test #%RU32: Detection of %s beacon started (%RU32ms recorded so far)\n",
     918                                                 idxTest, AudioTestBeaconTypeGetName(Beacon.enmType),
    915919                                                 PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbRecTotal));
    916920
     
    918922                                {
    919923                                    if (g_uVerbosity >= 2)
    920                                         RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Detected %s beacon\n",
    921                                                      AudioTestBeaconTypeGetName(Beacon.enmType));
     924                                        RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Detected %s beacon\n",
     925                                                     idxTest, AudioTestBeaconTypeGetName(Beacon.enmType));
    922926                                    fGoToNextStage = true;
    923927                                }
     
    958962
    959963                                if (g_uVerbosity >= 2)
    960                                     RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Recording tone data done");
     964                                    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Recording tone data done", idxTest);
    961965
    962966                                if (AudioTestBeaconGetSize(&Beacon))
     
    967971                                    if (g_uVerbosity >= 2)
    968972                                        RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS,
    969                                                      "Waiting for %s beacon ...", AudioTestBeaconTypeGetName(Beacon.enmType));
     973                                                     "Test #%RU32: Waiting for %s beacon ...",
     974                                                     idxTest, AudioTestBeaconTypeGetName(Beacon.enmType));
    970975                                }
    971976                            }
     
    10041009                        || (nsNow - nsLastMsgCantRead) > RT_NS_10SEC)) /* Don't spam the output too much. */
    10051010                {
    1006                     RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Waiting %RU32ms for stream to be readable again ...\n", msSleep);
     1011                    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Waiting %RU32ms for stream to be readable again ...\n",
     1012                                 idxTest, msSleep);
    10071013                    nsLastMsgCantRead = nsNow;
    10081014                }
     
    10151021            if (cNsElapsed > nsTimeout)
    10161022            {
    1017                 RTTestFailed(g_hTest, "Recording took too long (running %RU64 vs. timeout %RU64), aborting\n", cNsElapsed, nsTimeout);
     1023                RTTestFailed(g_hTest, "Test #%RU32: Recording took too long (running %RU64 vs. timeout %RU64), aborting\n",
     1024                             idxTest, cNsElapsed, nsTimeout);
    10181025                rc = VERR_TIMEOUT;
    10191026            }
     
    10241031
    10251032        if (g_uVerbosity >= 2)
    1026             RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Recorded %RU32 bytes total\n", cbRecTotal);
     1033            RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Recorded %RU32 bytes total\n", idxTest, cbRecTotal);
    10271034        if (cbTestRec != cbTestToRec)
    10281035        {
    1029             RTTestFailed(g_hTest, "Recording ended unexpectedly (%RU32/%RU32 recorded)\n", cbTestRec, cbTestToRec);
     1036            RTTestFailed(g_hTest, "Test #%RU32: Recording ended unexpectedly (%RU32/%RU32 recorded)\n",
     1037                         idxTest, cbTestRec, cbTestToRec);
    10301038            rc = VERR_WRONG_ORDER; /** @todo Find a better rc. */
    10311039        }
    10321040
    10331041        if (RT_FAILURE(rc))
    1034             RTTestFailed(g_hTest, "Recording failed (state is '%s')\n", AudioTestStateToStr(enmState));
     1042            RTTestFailed(g_hTest, "Test #%RU32: Recording failed (state is '%s')\n", idxTest, AudioTestStateToStr(enmState));
    10351043
    10361044        int rc2 = AudioTestMixStreamDisable(pMix);
     
    10441052
    10451053    if (RT_FAILURE(rc))
    1046         RTTestFailed(g_hTest, "Recording tone done failed with %Rrc\n", rc);
     1054        RTTestFailed(g_hTest, "Test #%RU32: Recording tone done failed with %Rrc\n", idxTest, rc);
    10471055
    10481056    return 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