- Timestamp:
- Mar 14, 2014, 7:58:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/SystemQueue-tests.cc
r12763 r12764 99 99 void Cancel() 100 100 { 101 cout << "### Cancel ### "<< endl; 102 103 SystemQueue::instance().cancel(); 101 ASSERT_THROW(SystemQueue::instance().cancel(), std::logic_error); 102 104 103 checkmark = true; 105 104 } … … 194 193 /** 195 194 * cancels the SystemQueue from inside a scheduled event 195 * 196 * --> and expects that this throws an exception 197 * 198 * NOTE: due to the SystemQueue singleton design, explicit cleanup is necessary! 196 199 */ 197 200 TEST_F(SystemQueueTest, CancelFromInsideEvent) … … 211 214 wait_for_checkmark(MAX_WAIT); 212 215 213 EXPECT_FALSE( sysq.isRunning() ) << "SystemQueue has not stopped properly."; 214 EXPECT_TRUE( sysq.isEmpty() ) << "SystemQueue has not stopped properly."; 216 // CLEANUP 217 sysq.cancel(); 218 219 EXPECT_FALSE( sysq.isRunning() ); 220 EXPECT_TRUE( sysq.isEmpty() ); 215 221 } 216 222 … … 343 349 */ 344 350 #define DELAY_TIME 20 // ms 345 #define DELAY_MARGIN 2000 // microseconds (1/1000 ms) // TODO maybe this is too much.. 351 #define DELAY_MARGIN 1000 // microseconds (1/1000 ms) // NOTE: maybe a meaningful value depends 352 // on the target hardwarde and system load... 346 353 347 354 … … 406 413 407 414 // noting to do until the delay is up.. 408 usleep(DELAY_TIME*1000 + DELAY_MARGIN*10); // XXX margin too high (TODO lower when SysQ is reimplemented)415 usleep(DELAY_TIME*1000 + DELAY_MARGIN*10); 409 416 410 417 // wait for the event to happen … … 475 482 476 483 // noting to do until the delay is up.. 477 usleep(DELAY_TIME * 4000 + DELAY_MARGIN*10 0); // XXX margin too high484 usleep(DELAY_TIME * 4000 + DELAY_MARGIN*10); 478 485 479 486 // wait for the event to happen … … 544 551 * TODO 545 552 * 546 * maybe one more complicated testca llwith timing and directly scheduled events553 * maybe one more complicated testcase with timing and directly scheduled events 547 554 * 548 555 * but this probably only makes sense after a working SysQ implementation exists..
Note:
See TracChangeset
for help on using the changeset viewer.