Changeset 91126 in vbox for trunk/src/VBox
- Timestamp:
- Sep 6, 2021 3:39:41 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r91051 r91126 1970 1970 * 1971 1971 * @returns Number of differences. 0 means they are equal (but not necessarily identical). 1972 * @param pVerJob Verification job to verify PCM data for. 1972 1973 * @param pCmpA File comparison parameters to file A to compare file B with. 1973 1974 * @param pCmpB File comparison parameters to file B to compare file A with. 1974 1975 * @param pToneParms Tone parameters to use for comparison. 1975 1976 */ 1976 static uint32_t audioTestFilesFindDiffsBinary(PAUDIOTESTFILECMPPARMS pCmpA, PAUDIOTESTFILECMPPARMS pCmpB, 1977 static uint32_t audioTestFilesFindDiffsBinary(PAUDIOTESTVERIFYJOB pVerJob, 1978 PAUDIOTESTFILECMPPARMS pCmpA, PAUDIOTESTFILECMPPARMS pCmpB, 1977 1979 PAUDIOTESTTONEPARMS pToneParms) 1978 1980 { … … 2015 2017 if (cDiffs) 2016 2018 { 2017 Log2Func(("Chunk A [%RU64-%RU64] vs. chunk B [%RU64-%RU64] (%RU64 bytes)\n", 2018 pCmpA->offStart + offLastDiff, pCmpA->offStart + offCur, 2019 pCmpB->offStart + offLastDiff, pCmpB->offStart + offCur, offCur - offLastDiff)); 2019 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A [%RU64-%RU64] vs. B [%RU64-%RU64] (%RU64 bytes, %RU64us)", 2020 pCmpA->offStart + offLastDiff, pCmpA->offStart + offCur, 2021 pCmpB->offStart + offLastDiff, pCmpB->offStart + offCur, offCur - offLastDiff, 2022 PDMAudioPropsBytesToMicro(&pToneParms->Props, offCur - offLastDiff)); 2023 AssertRC(rc2); 2020 2024 } 2021 2025 offLastDiff = 0; … … 2107 2111 size_t const cbDiffAbs = cbSizeA > cbSizeB ? cbSizeA - cbSizeB : cbSizeB - cbSizeA; 2108 2112 2109 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (% zums)",2110 ObjA.szName, cbSizeA, PDMAudioPropsBytesToMi lli(&pVerJob->PCMProps, cbSizeA));2113 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%RU64us)", 2114 ObjA.szName, cbSizeA, PDMAudioPropsBytesToMicro(&pVerJob->PCMProps, cbSizeA)); 2111 2115 AssertRC(rc2); 2112 rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (% zums)",2113 ObjB.szName, cbSizeB, PDMAudioPropsBytesToMi lli(&pVerJob->PCMProps, cbSizeB));2116 rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%RU64us)", 2117 ObjB.szName, cbSizeB, PDMAudioPropsBytesToMicro(&pVerJob->PCMProps, cbSizeB)); 2114 2118 AssertRC(rc2); 2115 2119 2116 rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %u%% (%zu bytes, % zums) %s than '%s'",2120 rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %u%% (%zu bytes, %RU64us) %s than '%s'", 2117 2121 ObjA.szName, 2118 2122 cbSizeA > cbSizeB ? 100 - ((cbSizeB * 100) / cbSizeA) : 100 - ((cbSizeA * 100) / cbSizeB), 2119 cbDiffAbs, PDMAudioPropsBytesToMi lli(&pVerJob->PCMProps, (uint32_t)cbDiffAbs),2123 cbDiffAbs, PDMAudioPropsBytesToMicro(&pVerJob->PCMProps, (uint32_t)cbDiffAbs), 2120 2124 cbSizeA > cbSizeB ? "bigger" : "smaller", 2121 2125 ObjB.szName); … … 2147 2151 cbSizeB); 2148 2152 2149 Log2Func(("Test #%RU32\n", pVerJob->idxTest)); 2150 Log2Func(("File A ('%s'): cbOff=%RU64 cbSize=%RU64, cbFileSize=%RU64\n", ObjA.szName, FileA.offStart, FileA.cbSize, cbSizeA)); 2151 Log2Func(("File B ('%s'): cbOff=%RU64, cbSize=%RU64, cbFileSize=%RU64\n", ObjB.szName, FileB.offStart, FileB.cbSize, cbSizeB)); 2152 2153 uint32_t const cDiffs = audioTestFilesFindDiffsBinary(&FileA, &FileB, &ToneParmsA); 2154 2155 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' are %s (%RU32 different chunks, threshold is %RU32)", 2156 ObjA.szName, ObjB.szName, cDiffs == 0 ? "equal" : "different", cDiffs, pVerJob->cThresholdDiff); 2153 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File A ('%s'): cbOff=%RU64 cbSize=%RU64, cbFileSize=%RU64\n", 2154 ObjA.szName, FileA.offStart, FileA.cbSize, cbSizeA); 2155 AssertRC(rc2); 2156 2157 rc = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File B ('%s'): cbOff=%RU64, cbSize=%RU64, cbFileSize=%RU64\n", 2158 ObjB.szName, FileB.offStart, FileB.cbSize, cbSizeB); 2159 AssertRC(rc2); 2160 2161 uint32_t const cDiffs = audioTestFilesFindDiffsBinary(pVerJob, &FileA, &FileB, &ToneParmsA); 2162 2163 rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' are %s (%RU32 different chunks, threshold is %RU32)", 2164 ObjA.szName, ObjB.szName, cDiffs == 0 ? "equal" : "different", cDiffs, pVerJob->cThresholdDiff); 2157 2165 AssertRC(rc2); 2158 2166
Note:
See TracChangeset
for help on using the changeset viewer.