Changeset 18569 in vbox for trunk/include/iprt
- Timestamp:
- Mar 31, 2009 1:07:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/test.h
r18366 r18569 52 52 #define NIL_RTTEST ((RTTEST)0) 53 53 54 /** 55 * Test message importance level. 56 */ 57 typedef enum RTTESTLVL 58 { 59 /** Invalid 0. */ 60 RTTESTLVL_INVALID = 0, 61 /** Message should always be printed. */ 62 RTTESTLVL_ALWAYS, 63 /** Failure message. */ 64 RTTESTLVL_FAILURE, 65 /** Sub-test banner. */ 66 RTTESTLVL_SUB_TEST, 67 /** Info message. */ 68 RTTESTLVL_INFO, 69 /** Debug message. */ 70 RTTESTLVL_DEBUG, 71 /** The last (invalid). */ 72 RTTESTLVL_END 73 } RTTESTLVL; 74 54 75 55 76 /** … … 121 142 * @param hTest The test handle. If NIL_RTTEST we'll use the one 122 143 * associated with the calling thread. 144 * @param enmLevel Message importance level. 123 145 * @param pszFormat The message. 124 146 * @param va Arguments. 125 147 */ 126 RTR3DECL(int) RTTestPrintfNlV(RTTEST hTest, const char *pszFormat, va_list va);148 RTR3DECL(int) RTTestPrintfNlV(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, va_list va); 127 149 128 150 /** … … 132 154 * @param hTest The test handle. If NIL_RTTEST we'll use the one 133 155 * associated with the calling thread. 156 * @param enmLevel Message importance level. 134 157 * @param pszFormat The message. 135 158 * @param ... Arguments. 136 159 */ 137 RTR3DECL(int) RTTestPrintfNl(RTTEST hTest, const char *pszFormat, ...);160 RTR3DECL(int) RTTestPrintfNl(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, ...); 138 161 139 162 /** … … 143 166 * @param hTest The test handle. If NIL_RTTEST we'll use the one 144 167 * associated with the calling thread. 168 * @param enmLevel Message importance level. 145 169 * @param pszFormat The message. 146 170 * @param va Arguments. 147 171 */ 148 RTR3DECL(int) RTTestPrintfV(RTTEST hTest, const char *pszFormat, va_list va);172 RTR3DECL(int) RTTestPrintfV(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, va_list va); 149 173 150 174 /** … … 154 178 * @param hTest The test handle. If NIL_RTTEST we'll use the one 155 179 * associated with the calling thread. 180 * @param enmLevel Message importance level. 156 181 * @param pszFormat The message. 157 182 * @param ... Arguments. 158 183 */ 159 RTR3DECL(int) RTTestPrintf(RTTEST hTest, const char *pszFormat, ...);184 RTR3DECL(int) RTTestPrintf(RTTEST hTest, RTTESTLVL enmLevel, const char *pszFormat, ...); 160 185 161 186 /** … … 176 201 */ 177 202 RTR3DECL(int) RTTestSummaryAndDestroy(RTTEST hTest); 203 204 /** 205 * Starts a sub-test. 206 * 207 * This will perform an implicit RTTestSubDone() call if that has not been done 208 * since the last RTTestSub call. 209 * 210 * @returns Number of chars printed. 211 * @param hTest The test handle. If NIL_RTTEST we'll use the one 212 * associated with the calling thread. 213 * @param pszSubTest The sub-test name 214 */ 215 RTR3DECL(int) RTTestSub(RTTEST hTest, const char *pszSubTest); 216 217 /** 218 * Completes a sub-test. 219 * 220 * @returns Number of chars printed. 221 * @param hTest The test handle. If NIL_RTTEST we'll use the one 222 * associated with the calling thread. 223 */ 224 RTR3DECL(int) RTTestSubDone(RTTEST hTest); 178 225 179 226 /** … … 220 267 do { if (!(expr)) { RTTestFailed((hTest), "line %u: %s", __LINE__, #expr); } } while (0) 221 268 269 /** @def RTTEST_CHECK_MSG 270 * Check whether a boolean expression holds true. 271 * 272 * If the expression is false, call RTTestFailed giving the line number and expression. 273 * 274 * @param hTest The test handle. 275 * @param expr The expression to evaluate. 276 * @param TestPrintfArgs Argument list for RTTestPrintf, including 277 * parenthesis. 278 */ 279 #define RTTEST_CHECK_MSG(hTest, expr, TestPrintfArgs) \ 280 do { if (!(expr)) { \ 281 RTTestFailed((hTest), "line %u: %s", __LINE__, #expr); \ 282 RTTestPrintf TestPrintfArgs; \ 283 } \ 284 } while (0) 285 286 287 /** 288 * Prints an extended PASSED message, optional. 289 * 290 * This does not conclude the sub-test, it could be used to report the passing 291 * of a sub-sub-to-the-power-of-N-test. 292 * 293 * @returns IPRT status code. 294 * @param hTest The test handle. If NIL_RTTEST we'll use the one 295 * associated with the calling thread. 296 * @param pszFormat The message. No trailing newline. 297 * @param va The arguments. 298 */ 299 RTR3DECL(int) RTTestPassedV(RTTEST hTest, const char *pszFormat, va_list va); 300 301 /** 302 * Prints an extended PASSED message, optional. 303 * 304 * This does not conclude the sub-test, it could be used to report the passing 305 * of a sub-sub-to-the-power-of-N-test. 306 * 307 * @returns IPRT status code. 308 * @param hTest The test handle. If NIL_RTTEST we'll use the one 309 * associated with the calling thread. 310 * @param pszFormat The message. No trailing newline. 311 * @param ... The arguments. 312 */ 313 RTR3DECL(int) RTTestPassed(RTTEST hTest, const char *pszFormat, ...); 314 222 315 223 316 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.