Changeset 19935 in vbox
- Timestamp:
- May 23, 2009 1:50:33 AM (16 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.cpp
r19933 r19935 88 88 case TSTR0THREADPREMEPTION_IS_PENDING: 89 89 { 90 /* This isn't 100% proof... */ 90 91 RTTHREADPREEMPTSTATE State = RTTHREADPREEMPTSTATE_INITIALIZER; 91 92 RTThreadPreemptDisable(&State); … … 121 122 } 122 123 124 case TSTR0THREADPREMEPTION_NESTED: 125 { 126 RTTHREADPREEMPTSTATE State1 = RTTHREADPREEMPTSTATE_INITIALIZER; 127 RTThreadPreemptDisable(&State1); 128 if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD)) 129 { 130 RTTHREADPREEMPTSTATE State2 = RTTHREADPREEMPTSTATE_INITIALIZER; 131 RTThreadPreemptDisable(&State2); 132 if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD)) 133 { 134 RTTHREADPREEMPTSTATE State3 = RTTHREADPREEMPTSTATE_INITIALIZER; 135 RTThreadPreemptDisable(&State3); 136 if (RTThreadPreemptIsEnabled(NIL_RTTHREAD)) 137 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns true after 3rd RTThreadPreemptDisable"); 138 139 RTThreadPreemptRestore(&State3); 140 if (RTThreadPreemptIsEnabled(NIL_RTTHREAD) && !*pszErr) 141 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns true after 1st RTThreadPreemptRestore"); 142 } 143 else 144 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns true after 2nd RTThreadPreemptDisable"); 145 146 RTThreadPreemptRestore(&State2); 147 if (RTThreadPreemptIsEnabled(NIL_RTTHREAD) && !*pszErr) 148 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns true after 2nd RTThreadPreemptRestore"); 149 } 150 else 151 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns true after 1st RTThreadPreemptDisable"); 152 RTThreadPreemptRestore(&State1); 153 if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD) && !*pszErr) 154 RTStrPrintf(pszErr, cchErr, "!RTThreadPreemptIsEnabled returns false after 3rd RTThreadPreemptRestore"); 155 break; 156 } 157 123 158 default: 124 159 RTStrPrintf(pszErr, cchErr, "!Unknown test #%d\n", uOperation); -
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.h
r19934 r19935 42 42 TSTR0THREADPREMEPTION_BASIC, 43 43 TSTR0THREADPREMEPTION_IS_PENDING, 44 TSTR0THREADPREMEPTION_NESTED 44 45 } TSTR0THREADPREMEPTION; 45 46 -
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemptionDriver.cpp
r19933 r19935 163 163 164 164 /* 165 * Stay in ring-0 until preemption is pending. 166 */ 167 RTTestSub(hTest, "Nested"); 168 Req.Hdr.u32Magic = SUPR0SERVICEREQHDR_MAGIC; 169 Req.Hdr.cbReq = sizeof(Req); 170 Req.szMsg[0] = '\0'; 171 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1, 172 TSTR0THREADPREMEPTION_NESTED, 0, &Req.Hdr), VINF_SUCCESS); 173 RTTESTI_CHECK_MSG(Req.szMsg[0] != '!', ("%s", Req.szMsg)); 174 if (Req.szMsg[0]) 175 RTTestIPrintf(RTTESTLVL_ALWAYS, "%s", Req.szMsg); 176 177 178 179 /* 165 180 * Done. 166 181 */
Note:
See TracChangeset
for help on using the changeset viewer.