- Timestamp:
- May 23, 2009 2:17:33 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.cpp
r19936 r19940 79 79 { 80 80 RTTHREADPREEMPTSTATE State = RTTHREADPREEMPTSTATE_INITIALIZER; 81 if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD)) 82 RTStrPrintf(pszErr, cchErr, "RTThreadPreemptIsEnabled returns false by default"); 81 83 RTThreadPreemptDisable(&State); 82 84 if (RTThreadPreemptIsEnabled(NIL_RTTHREAD)) … … 108 110 && cNanosElapsed < UINT64_C(60)*1000U*1000U*1000U); 109 111 if (!fPending) 110 RTStrPrintf(pszErr, cchErr, "!Preempt not pending after %llu loops / %llu ns \n",112 RTStrPrintf(pszErr, cchErr, "!Preempt not pending after %llu loops / %llu ns", 111 113 cLoops, cNanosElapsed); 112 114 else if (cLoops == 1) 113 115 RTStrPrintf(pszErr, cchErr, "!cLoops=0\n"); 114 116 else 115 RTStrPrintf(pszErr, cchErr, "RTThreadPreemptIsPending returned true after %llu loops / %llu ns \n",117 RTStrPrintf(pszErr, cchErr, "RTThreadPreemptIsPending returned true after %llu loops / %llu ns", 116 118 cLoops, cNanosElapsed); 117 119 } … … 127 129 case TSTR0THREADPREMEPTION_NESTED: 128 130 { 131 bool const fDefault = RTThreadPreemptIsEnabled(NIL_RTTHREAD); 129 132 RTTHREADPREEMPTSTATE State1 = RTTHREADPREEMPTSTATE_INITIALIZER; 130 133 RTThreadPreemptDisable(&State1); … … 154 157 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns true after 1st RTThreadPreemptDisable"); 155 158 RTThreadPreemptRestore(&State1); 156 if ( !RTThreadPreemptIsEnabled(NIL_RTTHREAD)&& !*pszErr)159 if (RTThreadPreemptIsEnabled(NIL_RTTHREAD) != fDefault && !*pszErr) 157 160 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns false after 3rd RTThreadPreemptRestore"); 158 161 break; … … 160 163 161 164 default: 162 RTStrPrintf(pszErr, cchErr, "!Unknown test #%d \n", uOperation);165 RTStrPrintf(pszErr, cchErr, "!Unknown test #%d", uOperation); 163 166 break; 164 167 } -
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemptionDriver.cpp
r19936 r19940 144 144 if (RT_FAILURE(rc)) 145 145 return RTTestSummaryAndDestroy(hTest); 146 RTTESTI_CHECK_MSG(Req.szMsg[0] == '\0', ("%s", Req.szMsg));147 146 if (Req.szMsg[0] == '!') 147 { 148 RTTestIFailed("%s", &Req.szMsg[1]); 148 149 return RTTestSummaryAndDestroy(hTest); 150 } 149 151 if (Req.szMsg[0]) 150 152 RTTestIPrintf(RTTESTLVL_ALWAYS, "%s", Req.szMsg); … … 164 166 || i >= 64) 165 167 { 166 RTTESTI_CHECK_MSG(Req.szMsg[0] != '!', ("%s", Req.szMsg)); 167 if (Req.szMsg[0]) 168 if (Req.szMsg[0] == '!') 169 RTTestIFailed("%s", &Req.szMsg[1]); 170 else if (Req.szMsg[0]) 168 171 RTTestIPrintf(RTTESTLVL_ALWAYS, "%s", Req.szMsg); 169 172 break; … … 182 185 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1, 183 186 TSTR0THREADPREMEPTION_NESTED, 0, &Req.Hdr), VINF_SUCCESS); 184 RTTESTI_CHECK_MSG(Req.szMsg[0] != '!', ("%s", Req.szMsg)); 185 if (Req.szMsg[0]) 187 if (Req.szMsg[0] == '!') 188 RTTestIFailed("%s", &Req.szMsg[1]); 189 else if (Req.szMsg[0]) 186 190 RTTestIPrintf(RTTESTLVL_ALWAYS, "%s", Req.szMsg); 187 188 189 191 190 192 /* … … 194 196 #endif 195 197 } 198
Note:
See TracChangeset
for help on using the changeset viewer.