Changeset 88311 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Mar 29, 2021 12:59:22 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143530
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/test.cpp
r82968 r88311 125 125 /** The number of sub tests that failed. */ 126 126 uint32_t cSubTestsFailed; 127 128 /** Error context message. */ 129 char *pszErrCtx; 127 130 128 131 /** Set if XML output is enabled. */ … … 520 523 RTStrFree((char *)pTest->pszTest); 521 524 pTest->pszTest = NULL; 525 RTStrFree(pTest->pszErrCtx); 526 pTest->pszErrCtx = NULL; 522 527 RTMemFree(pTest); 523 528 return VINF_SUCCESS; … … 1259 1264 pTest->fSubTestReported = true; 1260 1265 } 1266 RTStrFree(pTest->pszErrCtx); 1267 pTest->pszErrCtx = NULL; 1261 1268 return cch; 1262 1269 } … … 1711 1718 RTCritSectEnter(&pTest->OutputLock); 1712 1719 cch += rtTestPrintf(pTest, fHasNewLine ? "%N" : "%N\n", pszFormat, &va2); 1720 if (pTest->pszErrCtx) 1721 { 1722 cch += rtTestPrintf(pTest, "context: %s\n", pTest->pszErrCtx); 1723 RTStrFree(pTest->pszErrCtx); 1724 pTest->pszErrCtx = NULL; 1725 } 1713 1726 RTCritSectLeave(&pTest->OutputLock); 1714 1727 … … 1775 1788 1776 1789 1790 RTR3DECL(int) RTTestErrContextV(RTTEST hTest, const char *pszFormat, va_list va) 1791 { 1792 PRTTESTINT pTest = hTest; 1793 RTTEST_GET_VALID_RETURN(pTest); 1794 1795 RTStrFree(pTest->pszErrCtx); 1796 pTest->pszErrCtx = NULL; 1797 1798 if (pszFormat && *pszFormat) 1799 { 1800 pTest->pszErrCtx = RTStrAPrintf2V(pszFormat, va); 1801 AssertReturn(pTest->pszErrCtx, VERR_NO_STR_MEMORY); 1802 RTStrStripR(pTest->pszErrCtx); 1803 } 1804 1805 return VINF_SUCCESS; 1806 } 1807 1808 1809 RTR3DECL(int) RTTestErrContext(RTTEST hTest, const char *pszFormat, ...) 1810 { 1811 va_list va; 1812 va_start(va, pszFormat); 1813 int rc = RTTestErrContextV(hTest, pszFormat, va); 1814 va_end(va); 1815 return rc; 1816 } 1817 1818 1777 1819 RTR3DECL(int) RTTestDisableAssertions(RTTEST hTest) 1778 1820 { -
trunk/src/VBox/Runtime/r3/testi.cpp
r82968 r88311 176 176 177 177 178 RTR3DECL(int) RTTestIErrContextV(const char *pszFormat, va_list va) 179 { 180 return RTTestErrContextV(NIL_RTTEST, pszFormat, va); 181 } 182 183 184 RTR3DECL(int) RTTestErrContext(const char *pszFormat, ...) 185 { 186 va_list va; 187 va_start(va, pszFormat); 188 int rc = RTTestIErrContextV(pszFormat, va); 189 va_end(va); 190 return rc; 191 } 192 193 178 194 RTR3DECL(int) RTTestIDisableAssertions(void) 179 195 {
Note:
See TracChangeset
for help on using the changeset viewer.