Changeset 103568 in vbox
- Timestamp:
- Feb 26, 2024 1:08:48 PM (13 months ago)
- svn:sync-xref-src-repo-rev:
- 161919
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp
r103567 r103568 854 854 if (RT_SUCCESS(rc)) 855 855 { 856 uint32_t cbToReadTotal = PDMAudioPropsMilliToBytes(&pStream->Cfg.Props, pParms->msDuration);856 size_t cbToReadTotal = PDMAudioPropsMilliToBytes(&pStream->Cfg.Props, pParms->msDuration); 857 857 AssertStmt(cbToReadTotal, rc = VERR_INVALID_PARAMETER); 858 uint32_t cbReadTotal = 0; /* Counts the read test tone data (w/o any beacons). */858 size_t cbReadTotal = 0; /* Counts the read test tone data (w/o any beacons). */ 859 859 860 860 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Recording %RU32 bytes total (%RU32ms timeout)\n", … … 925 925 if (cbBlock) 926 926 { 927 rc = AudioTestMixStreamCapture(pMix, pvBlock, cbBlock, &cbCaptured);927 rc = AudioTestMixStreamCapture(pMix, pvBlock, (uint32_t)cbBlock, &cbCaptured); 928 928 if (RT_FAILURE(rc)) 929 929 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Reading from stream failed with %Rrc\n", idxTest, rc); … … 964 964 if (pTstEnv->fSelftest) /* For self-test mode we want to have a bit more randomness. */ 965 965 { 966 size_t const u = RTCircBufUsed(pCircBuf);967 size_t const r = RTRandU32Ex(1, RTCircBufSize(pCircBuf));968 cbBlockToAcq = PDMAudioPropsFloorBytesToFrame(pMix->pProps, RT_MIN( u,r));966 size_t const u = (uint32_t)RTCircBufUsed(pCircBuf); 967 size_t const r = RTRandU32Ex(1, (uint32_t)RTCircBufSize(pCircBuf)); 968 cbBlockToAcq = PDMAudioPropsFloorBytesToFrame(pMix->pProps, RT_MIN((uint32_t)u, (uint32_t)r)); 969 969 } 970 970 else 971 cbBlockToAcq = PDMAudioPropsFloorBytesToFrame(pMix->pProps, RTCircBufUsed(pCircBuf));971 cbBlockToAcq = PDMAudioPropsFloorBytesToFrame(pMix->pProps, (uint32_t)RTCircBufUsed(pCircBuf)); 972 972 973 973 RTCircBufAcquireReadBlock(pCircBuf, cbBlockToAcq, &pvBlock, &cbBlock); … … 977 977 /* Flag indicating whether the whole block we've captured is silence or not. */ 978 978 bool const fIsAllSilence = PDMAudioPropsIsBufferSilence(&pStream->pStream->Cfg.Props, pvBlock, cbBlock); 979 uint32_tcbRead = 0;979 size_t cbRead = 0; 980 980 981 981 switch (enmState) … … 1002 1002 { 1003 1003 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, 1004 "Test #%RU32: Detection of %s beacon started (%RU 32ms recorded so far)\n",1004 "Test #%RU32: Detection of %s beacon started (%RU64ms recorded so far)\n", 1005 1005 idxTest, AudioTestBeaconTypeGetName(Beacon.enmType), 1006 PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbReadTotal));1006 PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, (uint32_t)cbReadTotal)); 1007 1007 } 1008 1008 … … 1086 1086 { 1087 1087 if (g_uVerbosity >= 3) 1088 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Read data (% RU32bytes):\n"1088 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Read data (%zu bytes):\n" 1089 1089 "%.*Rhxd\n", 1090 1090 idxTest, cbRead, cbRead, pvBlock); … … 1097 1097 1098 1098 if (g_uVerbosity >= 2) 1099 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Processed %RU64ms (% RU32bytes)\n",1099 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Processed %RU64ms (%zu bytes)\n", 1100 1100 idxTest, PDMAudioPropsBytesToMilli(pMix->pProps, cbRead), cbRead); 1101 1101 … … 1119 1119 1120 1120 if (g_uVerbosity >= 2) 1121 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Recorded % RU32bytes total\n", idxTest, cbReadTotal);1121 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Test #%RU32: Recorded %zu bytes total\n", idxTest, cbReadTotal); 1122 1122 if (cbReadTotal != cbToReadTotal) 1123 1123 { 1124 RTTestFailed(g_hTest, "Test #%RU32: Recording ended unexpectedly (% RU32 read, expected %RU32)\n",1124 RTTestFailed(g_hTest, "Test #%RU32: Recording ended unexpectedly (%zu read, expected %zu)\n", 1125 1125 idxTest, cbReadTotal, cbToReadTotal); 1126 1126 int rc2 = cbReadTotal > cbToReadTotal ? VERR_BUFFER_OVERFLOW : VERR_BUFFER_UNDERFLOW;
Note:
See TracChangeset
for help on using the changeset viewer.