Changeset 92462 in vbox
- Timestamp:
- Nov 16, 2021 3:26:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp
r92461 r92462 802 802 static int audioTestRecordTone(PAUDIOTESTIOOPTS pIoOpts, PAUDIOTESTENV pTstEnv, PAUDIOTESTSTREAM pStream, PAUDIOTESTTONEPARMS pParms) 803 803 { 804 uint32_t const idxTest = (uint8_t)pParms->Hdr.idxTest; 805 804 806 const char *pcszPathOut = pTstEnv->Set.szPathAbs; 805 807 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); 808 811 809 812 /** @todo Use .WAV here? */ … … 821 824 uint32_t cbTestRec = 0; 822 825 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); 824 827 825 828 /* We expect a pre + post beacon before + after the actual test tone. … … 831 834 if (cbBeacon) 832 835 { 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); 834 838 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)); 837 841 } 838 842 … … 869 873 { 870 874 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); 873 877 874 878 uint32_t const cbToRead = RT_MIN(cbCanRead, cbSamplesAligned); … … 911 915 && g_uVerbosity >= 3) 912 916 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), 915 919 PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbRecTotal)); 916 920 … … 918 922 { 919 923 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)); 922 926 fGoToNextStage = true; 923 927 } … … 958 962 959 963 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); 961 965 962 966 if (AudioTestBeaconGetSize(&Beacon)) … … 967 971 if (g_uVerbosity >= 2) 968 972 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)); 970 975 } 971 976 } … … 1004 1009 || (nsNow - nsLastMsgCantRead) > RT_NS_10SEC)) /* Don't spam the output too much. */ 1005 1010 { 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); 1007 1013 nsLastMsgCantRead = nsNow; 1008 1014 } … … 1015 1021 if (cNsElapsed > nsTimeout) 1016 1022 { 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); 1018 1025 rc = VERR_TIMEOUT; 1019 1026 } … … 1024 1031 1025 1032 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); 1027 1034 if (cbTestRec != cbTestToRec) 1028 1035 { 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); 1030 1038 rc = VERR_WRONG_ORDER; /** @todo Find a better rc. */ 1031 1039 } 1032 1040 1033 1041 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)); 1035 1043 1036 1044 int rc2 = AudioTestMixStreamDisable(pMix); … … 1044 1052 1045 1053 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); 1047 1055 1048 1056 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.

