Changeset 12757 for tests/SystemQueue-tests.cc
- Timestamp:
- Mar 10, 2014, 6:17:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/SystemQueue-tests.cc
r12756 r12757 289 289 SystemQueueTimingTest() : 290 290 SystemQueueTest() /* super constructor */, 291 sysq( SystemQueue::instance() ) 291 sysq( SystemQueue::instance() ), 292 calls(0) 292 293 { 293 294 } … … 321 322 322 323 // info 323 cout << " ///Timing difference: " << diff << " microseconds" << endl;324 cout << "### Timing difference: " << diff << " microseconds" << endl; 324 325 325 326 EXPECT_LT( abs(diff), margin ); 326 327 328 calls++; 327 329 checkmark = true; 328 330 } 329 331 330 332 SystemQueue& sysq; 333 int calls; 331 334 }; 332 335 … … 443 446 } 444 447 448 449 /** 450 * Like TimingSingleCall but tests whether the timings change when multiple events are scheduled. 451 */ 452 TEST_F(SystemQueueTimingTest, TimingMultipleCalls) 453 { 454 ptime now = microsec_clock::local_time(); 455 456 sysq.scheduleCall( 457 boost::bind(&SystemQueueTimingTest::TimeCheckingCall, this, 458 now, DELAY_TIME*1000 * 2, DELAY_MARGIN), 459 DELAY_TIME * 2 460 ); 461 462 sysq.scheduleCall( 463 boost::bind(&SystemQueueTimingTest::TimeCheckingCall, this, 464 now, DELAY_TIME*1000 * 3, DELAY_MARGIN), 465 DELAY_TIME * 3 466 ); 467 468 sysq.scheduleCall( 469 boost::bind(&SystemQueueTimingTest::TimeCheckingCall, this, 470 now, DELAY_TIME*1000, DELAY_MARGIN), 471 DELAY_TIME 472 ); 473 474 // main thread is going to sleep.. 475 usleep(DELAY_TIME * 3000 + DELAY_MARGIN * 2); 476 wait_for_checkmark(MAX_WAIT); // XXX wait_until_empty 477 478 // make sure the measurement function was called at all 479 EXPECT_EQ(3, calls) << "Not every event was performed.."; 480 }
Note:
See TracChangeset
for help on using the changeset viewer.