Changeset 33033 in vbox for trunk/src/VBox/HostDrivers/Support/testcase
- Timestamp:
- Oct 11, 2010 9:55:12 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66549
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
r33032 r33033 282 282 283 283 #endif /* !OS2 && !WINDOWS */ 284 285 if (RTTestErrorCount(hTest) == 0) 286 { 287 RTTestSub(hTest, "SRE Timeout Accuracy"); 288 RTTESTI_CHECK_RC(SUPSemEventCreate(pSession, &hEvent), VINF_SUCCESS); 289 290 static unsigned const s_acMsIntervals[] = { 0, 1, 2, 3, 4, 8, 10, 16, 32 }; 291 for (unsigned i = 0; i < RT_ELEMENTS(s_acMsIntervals); i++) 292 { 293 uint64_t cMs = s_acMsIntervals[i]; 294 uint64_t cNsMinSys = UINT64_MAX; 295 uint64_t cNsMin = UINT64_MAX; 296 uint64_t cNsTotalSys= 0; 297 uint64_t cNsTotal = 0; 298 for (unsigned j = 0; j < 10; j++) 299 { 300 uint64_t u64StartSys = RTTimeSystemNanoTS(); 301 uint64_t u64Start = RTTimeNanoTS(); 302 int rcX = SUPSemEventWaitNoResume(pSession, hEvent, cMs); 303 if (rc == VERR_TIMEOUT) 304 RTTestFailed(hTest, "%Rrc j=%u cMs=%u", rcX, j, cMs); 305 uint64_t cNsElapsedSys = RTTimeSystemNanoTS() - u64StartSys; 306 uint64_t cNsElapsed = RTTimeNanoTS() - u64Start; 307 if (cNsElapsedSys < cNsMinSys) 308 cNsMinSys = cNsElapsedSys; 309 if (cNsElapsed < cNsMin) 310 cNsMin = cNsElapsed; 311 cNsTotalSys += cNsElapsedSys; 312 cNsTotal += cNsElapsed; 313 } 314 RTTestValueF(hTest, cNsMinSys, RTTESTUNIT_NS, "%u ms min (clock=sys)", cMs); 315 RTTestValueF(hTest, cNsTotalSys / 10, RTTESTUNIT_NS, "%u ms avg - (clock=sys)", cMs); 316 RTTestValueF(hTest, cNsMin, RTTESTUNIT_NS, "%u ms min (clock=gip)", cMs); 317 RTTestValueF(hTest, cNsTotal / 10, RTTESTUNIT_NS, "%u ms avg - (clock=gip)", cMs); 318 } 319 320 RTTESTI_CHECK_RC(SUPSemEventClose(pSession, hEvent), VINF_OBJECT_DESTROYED); 321 } 284 322 285 323 if (RTTestErrorCount(hTest) == 0)
Note:
See TracChangeset
for help on using the changeset viewer.