Changeset 12764 for tests


Ignore:
Timestamp:
Mar 14, 2014, 7:58:45 PM (11 years ago)
Author:
hock@…
Message:

New SystemQueue...

... is passing all unit tests, now. :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/SystemQueue-tests.cc

    r12763 r12764  
    9999    void Cancel()
    100100    {
    101         cout << "### Cancel ### "<< endl;
    102 
    103         SystemQueue::instance().cancel();
     101        ASSERT_THROW(SystemQueue::instance().cancel(), std::logic_error);
     102       
    104103        checkmark = true;
    105104    }
     
    194193/**
    195194 *  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!
    196199 */
    197200TEST_F(SystemQueueTest, CancelFromInsideEvent)
     
    211214    wait_for_checkmark(MAX_WAIT);
    212215
    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() );
    215221}
    216222
     
    343349 */
    344350#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...
    346353
    347354
     
    406413
    407414    // 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);
    409416   
    410417    // wait for the event to happen
     
    475482
    476483    // noting to do until the delay is up..
    477     usleep(DELAY_TIME * 4000 + DELAY_MARGIN*100);  // XXX margin too high
     484    usleep(DELAY_TIME * 4000 + DELAY_MARGIN*10);
    478485   
    479486    // wait for the event to happen
     
    544551 * TODO
    545552 *
    546  * maybe one more complicated testcall with timing and directly scheduled events
     553 * maybe one more complicated testcase with timing and directly scheduled events
    547554 *
    548555 * but this probably only makes sense after a working SysQ implementation exists..
Note: See TracChangeset for help on using the changeset viewer.