Changeset 89966 in vbox
- Timestamp:
- Jun 30, 2021 8:24:52 AM (3 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r89890 r89966 522 522 523 523 RTMemFree(pErrEntry); 524 525 Assert(pErr->cErrors); 526 pErr->cErrors--; 527 } 528 529 Assert(pErr->cErrors == 0); 524 } 525 526 pErr->cErrors = 0; 530 527 } 531 528 … … 577 574 AssertFailedReturn(VERR_NO_MEMORY); 578 575 579 const ssize_t cch = RTStrPrintf2(pEntry->szDesc, sizeof(pEntry->szDesc), "Test #%RU32 failed: %s", idxTest, pszDescTmp); 576 const ssize_t cch = RTStrPrintf2(pEntry->szDesc, sizeof(pEntry->szDesc), "Test #%RU32 %s: %s", 577 idxTest, RT_FAILURE(rc) ? "failed" : "info", pszDescTmp); 580 578 RTStrFree(pszDescTmp); 581 579 AssertReturn(cch > 0, VERR_BUFFER_OVERFLOW); … … 585 583 RTListAppend(&pErr->List, &pEntry->Node); 586 584 587 pErr->cErrors++; 585 if (RT_FAILURE(rc)) 586 pErr->cErrors++; 588 587 589 588 return VINF_SUCCESS; … … 591 590 592 591 /** 593 * Adds a single error entry to an audio test error description , va_list version.592 * Adds a single error entry to an audio test error description. 594 593 * 595 594 * @returns VBox status code. … … 599 598 * @param ... Optional format arguments of \a pszDesc to add. 600 599 */ 601 static int audioTestErrorDescAdd (PAUDIOTESTERRORDESC pErr, uint32_t idxTest, const char *pszFormat, ...)600 static int audioTestErrorDescAddError(PAUDIOTESTERRORDESC pErr, uint32_t idxTest, const char *pszFormat, ...) 602 601 { 603 602 va_list va; … … 605 604 606 605 int rc = audioTestErrorDescAddV(pErr, idxTest, VERR_GENERAL_FAILURE /** @todo Fudge! */, pszFormat, va); 606 607 va_end(va); 608 return rc; 609 } 610 611 /** 612 * Adds a single info entry to an audio test error description, va_list version. 613 * 614 * @returns VBox status code. 615 * @param pErr Test error description to add entry for. 616 * @param idxTest Index of failing test (zero-based). 617 * @param pszFormat Error description format string to add. 618 * @param ... Optional format arguments of \a pszDesc to add. 619 */ 620 static int audioTestErrorDescAddInfo(PAUDIOTESTERRORDESC pErr, uint32_t idxTest, const char *pszFormat, ...) 621 { 622 va_list va; 623 va_start(va, pszFormat); 624 625 int rc = audioTestErrorDescAddV(pErr, idxTest, VINF_SUCCESS, pszFormat, va); 607 626 608 627 va_end(va); … … 1648 1667 if (RT_FAILURE(a_rc)) \ 1649 1668 { \ 1650 int rc3 = audioTestErrorDescAdd (a_pVerJob->pErr, a_pVerJob->idxTest, a_Msg); \1669 int rc3 = audioTestErrorDescAddError(a_pVerJob->pErr, a_pVerJob->idxTest, a_Msg); \ 1651 1670 AssertRC(rc3); \ 1652 1671 if (!a_pVerJob->fKeepGoing) \ … … 1657 1676 if (RT_FAILURE(a_rc)) \ 1658 1677 { \ 1659 int rc3 = audioTestErrorDescAdd (a_pVerJob->pErr, a_pVerJob->idxTest, a_Msg, __VA_ARGS__); \1678 int rc3 = audioTestErrorDescAddError(a_pVerJob->pErr, a_pVerJob->idxTest, a_Msg, __VA_ARGS__); \ 1660 1679 AssertRC(rc3); \ 1661 1680 if (!a_pVerJob->fKeepGoing) \ … … 1701 1720 if (!cbSizeA) 1702 1721 { 1703 int rc2 = audioTestErrorDescAdd (pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty\n", pObjA->szName);1722 int rc2 = audioTestErrorDescAddError(pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty", pObjA->szName); 1704 1723 AssertRC(rc2); 1705 1724 } … … 1707 1726 if (!cbSizeB) 1708 1727 { 1709 int rc2 = audioTestErrorDescAdd (pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty\n", pObjB->szName);1728 int rc2 = audioTestErrorDescAddError(pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty", pObjB->szName); 1710 1729 AssertRC(rc2); 1711 1730 } … … 1713 1732 if (cbSizeA != cbSizeB) 1714 1733 { 1715 int rc2 = audioTestErrorDescAdd (pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes %s than '%s'\n",1716 pObjA->szName,1717 cbSizeA > cbSizeB ? cbSizeA - cbSizeB : cbSizeB - cbSizeA,1718 cbSizeA > cbSizeB ? "bigger" : "smaller",1719 pObjB->szName);1734 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes %s than '%s'", 1735 pObjA->szName, 1736 cbSizeA > cbSizeB ? cbSizeA - cbSizeB : cbSizeB - cbSizeA, 1737 cbSizeA > cbSizeB ? "bigger" : "smaller", 1738 pObjB->szName); 1720 1739 AssertRC(rc2); 1721 1740 } 1722 else if (audioTestFilesCompareBinary(pObjA->File.hFile, pObjB->File.hFile, cbSizeA)) 1741 1742 if (!audioTestFilesCompareBinary(pObjA->File.hFile, pObjB->File.hFile, cbSizeA)) 1723 1743 { 1724 1744 /** @todo Add more sophisticated stuff here. */ 1725 1745 1726 int rc2 = audioTestErrorDescAdd (pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' have different content\n",1727 pObjA->szName, pObjB->szName);1746 int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' have different content", 1747 pObjA->szName, pObjB->szName); 1728 1748 AssertRC(rc2); 1729 1749 } … … 1787 1807 if (RT_FAILURE(rc)) 1788 1808 { 1789 int rc2 = audioTestErrorDescAdd (pVerify->pErr, pVerify->idxTest, "Verififcation of test tone data failed\n");1809 int rc2 = audioTestErrorDescAddError(pVerify->pErr, pVerify->idxTest, "Verififcation of test tone data failed\n"); 1790 1810 AssertRC(rc2); 1791 1811 } … … 1870 1890 rc = audioTestVerifyTestTone(&VerJob, &hTest, VerJob.pSetA, VerJob.pSetB); 1871 1891 else 1872 rc = audioTestErrorDescAdd (pErrDesc, i, "Playback test types don't match (set A=%#x, set B=%#x)",1873 enmTestTypeA, enmTestTypeB);1892 rc = audioTestErrorDescAddError(pErrDesc, i, "Playback test types don't match (set A=%#x, set B=%#x)", 1893 enmTestTypeA, enmTestTypeB); 1874 1894 break; 1875 1895 } … … 1880 1900 rc = audioTestVerifyTestTone(&VerJob, &hTest, VerJob.pSetB, VerJob.pSetA); 1881 1901 else 1882 rc = audioTestErrorDescAdd (pErrDesc, i, "Recording test types don't match (set A=%#x, set B=%#x)",1883 enmTestTypeA, enmTestTypeB);1902 rc = audioTestErrorDescAddError(pErrDesc, i, "Recording test types don't match (set A=%#x, set B=%#x)", 1903 enmTestTypeA, enmTestTypeB); 1884 1904 break; 1885 1905 } -
trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
r89964 r89966 879 879 if (RT_SUCCESS(rc)) 880 880 { 881 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "%RU32 errors occurred while verifying\n", AudioTestErrorDescCount(&errDesc)); 882 if (AudioTestErrorDescFailed(&errDesc)) 881 uint32_t const cErr = AudioTestErrorDescCount(&errDesc); 882 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "%RU32 errors occurred while verifying\n", cErr); 883 884 /** @todo Use some AudioTestErrorXXX API for enumeration here later. */ 885 PAUDIOTESTERRORENTRY pErrEntry; 886 RTListForEach(&errDesc.List, pErrEntry, AUDIOTESTERRORENTRY, Node) 883 887 { 884 /** @todo Use some AudioTestErrorXXX API for enumeration here later. */885 PAUDIOTESTERRORENTRY pErrEntry;886 RTListForEach(&errDesc.List, pErrEntry, AUDIOTESTERRORENTRY, Node)887 RTTest Failed(g_hTest, pErrEntry->szDesc);888 if (RT_FAILURE(pErrEntry->rc)) 889 RTTestFailed(g_hTest, "%s\n", pErrEntry->szDesc); 890 else 891 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "%s\n", pErrEntry->szDesc); 888 892 } 889 else 893 894 if (cErr == 0) 890 895 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Verification successful\n"); 891 896
Note:
See TracChangeset
for help on using the changeset viewer.