Changeset 47553 in vbox for trunk/src/VBox
- Timestamp:
- Aug 6, 2013 10:03:55 AM (11 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTR0Common.h
r33540 r47553 177 177 } while (0) 178 178 179 /** 180 * Macro for skipping a test in the ring-0 testcase. 181 */ 182 #define RTR0TESTR0_SKIP() \ 183 do { \ 184 RTR0TestR0Skip("line %u: SKIPPED", __LINE__); \ 185 } while (0) 186 187 /** 188 * Same as RTR0TESTR0_SKIP + break. 189 */ 190 #define RTR0TESTR0_SKIP_BREAK() \ 191 if (1) \ 192 { \ 193 RTR0TestR0Skip("line %u: SKIPPED", __LINE__); \ 194 break; \ 195 } else do { } while (0) 196 179 197 180 198 /** … … 245 263 } 246 264 265 266 /** 267 * Report an error. 268 */ 269 void RTR0TestR0Skip(const char *pszFormat, ...) 270 { 271 size_t off = RTStrNLen(g_szErr, sizeof(g_szErr) - 1); 272 size_t cbLeft = sizeof(g_szErr) - off; 273 if (cbLeft > 10) 274 { 275 char *psz = &g_szErr[off]; 276 if (off) 277 { 278 *psz++ = '\n'; 279 *psz++ = '\n'; 280 cbLeft -= 2; 281 } 282 *psz++ = '$'; 283 cbLeft--; 284 285 va_list va; 286 va_start(va, pszFormat); 287 RTStrPrintfV(psz, cbLeft, pszFormat, va); 288 va_end(va); 289 } 290 ASMAtomicIncU32(&g_cErrors); 291 } 292 293 247 294 /** 248 295 * Checks if we have any error reports. -
trunk/src/VBox/Runtime/testcase/tstRTR0CommonDriver.h
r32736 r47553 178 178 * We can have multiple failures and info messages packed into szMsg. They 179 179 * are separated by a double newline. The kind of message is indicated by 180 * the first character, '!' means error and '?' means info message. 180 * the first character, '!' means error and '?' means info message. '$' means 181 * the test was skipped because a feature is not supported on the host. 181 182 */ 182 183 bool fRc = true; … … 190 191 char *pszCur = pszNext; 191 192 do 192 pszNext = strpbrk(pszNext + 1, "!? ");193 pszNext = strpbrk(pszNext + 1, "!?$"); 193 194 while (pszNext && (pszNext[-1] != '\n' || pszNext[-2] != '\n')); 194 195 … … 203 204 fRc = false; 204 205 } 206 else if (*pszCur == '$') 207 { 208 RTTestSkipped(g_hTest, "%s", pszCur + 1); 209 } 205 210 else 206 211 RTTestPrintfNl(g_hTest, RTTESTLVL_ALWAYS, "%s", pszCur + 1); -
trunk/src/VBox/Runtime/testcase/tstRTR0Timer.cpp
r44528 r47553 481 481 { 482 482 RTR0TESTR0_CHECK_RC_BREAK(RTTimerStart(pTimer, cNsSysHz * iTest), VINF_SUCCESS); 483 for (uint32_t i = 0; i < 1000 && ASMAtomicUoReadU32(&State.cShots) < 1; i++)483 for (uint32_t i = 0; i < 1000 && (ASMAtomicUoReadU32(&State.cShots) < 1 || State.rc == VERR_IPE_UNINITIALIZED_STATUS); i++) 484 484 RTThreadSleep(5); 485 485 RTR0TESTR0_CHECK_MSG_BREAK(ASMAtomicReadU32(&State.cShots) == 1, ("cShots=%u\n", State.cShots)); … … 724 724 uint32_t fFlags = (TSTRTR0TIMER_IS_HIRES(uOperation) ? RTTIMER_FLAGS_HIGH_RES : 0) 725 725 | RTTIMER_FLAGS_CPU_ALL; 726 RTR0TESTR0_CHECK_RC_BREAK(RTTimerCreateEx(&pTimer, cNsInterval, fFlags, tstRTR0TimerCallbackOmni, paStates), 727 VINF_SUCCESS); 726 int rc = RTTimerCreateEx(&pTimer, cNsInterval, fFlags, tstRTR0TimerCallbackOmni, paStates); 727 if (rc == VERR_NOT_SUPPORTED) 728 RTR0TESTR0_SKIP_BREAK(); 729 RTR0TESTR0_CHECK_RC_BREAK(rc, VINF_SUCCESS); 728 730 729 731 for (uint32_t iTest = 0; iTest < 3 && !RTR0TestR0HaveErrors(); iTest++)
Note:
See TracChangeset
for help on using the changeset viewer.