Changeset 20109 in vbox
- Timestamp:
- May 27, 2009 10:49:29 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 47863
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/test.h
r19952 r20109 203 203 204 204 /** 205 * Skips the test, destroys the test instance and return an exit code. 206 * 207 * @returns Test program exit code. 208 * @param hTest The test handle. If NIL_RTTEST we'll use the one 209 * associated with the calling thread. 210 * @param pszReasonFmt Text explaining why, optional (NULL). 211 * @param va Arguments for the reason format string. 212 */ 213 RTR3DECL(int) RTTestSkipAndDestroyV(RTTEST hTest, const char *pszReason, va_list va); 214 215 /** 216 * Skips the test, destroys the test instance and return an exit code. 217 * 218 * @returns Test program exit code. 219 * @param hTest The test handle. If NIL_RTTEST we'll use the one 220 * associated with the calling thread. 221 * @param pszReasonFmt Text explaining why, optional (NULL). 222 * @param va Arguments for the reason format string. 223 */ 224 RTR3DECL(int) RTTestSkipAndDestroy(RTTEST hTest, const char *pszReason, ...); 225 226 /** 205 227 * Starts a sub-test. 206 228 * -
trunk/src/VBox/Runtime/r3/test.cpp
r19952 r20109 166 166 *******************************************************************************/ 167 167 static void rtTestGuardedFreeOne(PRTTESTGUARDEDMEM pMem); 168 static int rtTestPrintf(PRTTESTINT pTest, const char *pszFormat, ...); 168 169 169 170 … … 304 305 305 306 /* 307 * Make sure we end with a new line. 308 */ 309 if (!pTest->fNewLine) 310 rtTestPrintf(pTest, "\n"); 311 312 /* 306 313 * Clean up. 307 314 */ … … 786 793 } 787 794 788 789 795 RTTestDestroy(pTest); 796 return rc; 797 } 798 799 800 RTR3DECL(int) RTTestSkipAndDestroyV(RTTEST hTest, const char *pszReason, va_list va) 801 { 802 PRTTESTINT pTest = hTest; 803 RTTEST_GET_VALID_RETURN_RC(pTest, 2); 804 805 RTCritSectEnter(&pTest->Lock); 806 rtTestSubTestReport(pTest); 807 RTCritSectLeave(&pTest->Lock); 808 809 int rc; 810 if (!pTest->cErrors) 811 { 812 if (pszReason) 813 RTTestPrintfNlV(hTest, RTTESTLVL_FAILURE, pszReason, va); 814 RTTestPrintfNl(hTest, RTTESTLVL_ALWAYS, "SKIPPED\n", pTest->cErrors); 815 rc = 2; 816 } 817 else 818 { 819 RTTestPrintfNl(hTest, RTTESTLVL_ALWAYS, "FAILURE - %u errors\n", pTest->cErrors); 820 rc = 1; 821 } 822 823 RTTestDestroy(pTest); 824 return rc; 825 } 826 827 828 RTR3DECL(int) RTTestSkipAndDestroy(RTTEST hTest, const char *pszReason, ...) 829 { 830 va_list va; 831 va_start(va, pszReason); 832 int rc = RTTestSkipAndDestroyV(hTest, pszReason, va); 833 va_end(va); 790 834 return rc; 791 835 }
Note:
See TracChangeset
for help on using the changeset viewer.