Changeset 12753 for tests


Ignore:
Timestamp:
Mar 7, 2014, 7:16:51 PM (10 years ago)
Author:
hock@…
Message:

moved some (usually needed) code in the fixture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/SystemQueue-tests.cc

    r12752 r12753  
    266266{
    267267public:
    268    
     268
    269269/**
    270270 *  typical delay time
     
    275275#define DELAY_TIME 10  // ms
    276276#define DELAY_MARGIN 1000  // microseconds (1/1000 ms)
    277    
     277
     278
     279    /// constructor
     280    SystemQueueTimingTest() :
     281        SystemQueueTest()  /* super constructor */,
     282        sysq( SystemQueue::instance() )
     283    {
     284    }
     285   
     286    virtual void SetUp()
     287    {
     288        // start SystemQueue
     289        sysq.run();
     290    }
     291   
     292
     293    virtual void TearDown()
     294    {
     295        // stop SystemQueue
     296        sysq.cancel();
     297    }
     298
     299    SystemQueue& sysq;
    278300};
    279301
     
    284306TEST_F(SystemQueueTimingTest, DelayedCall)
    285307{
    286     SystemQueue& sysq = SystemQueue::instance();
    287     checkmark = false;  // just to be sure..
    288    
    289     // start
    290     sysq.run();
    291    
    292308    // scheduleCall
    293309    sysq.scheduleCall(
     
    301317    wait_for_checkmark(MAX_WAIT);
    302318   
    303     // stop
    304     sysq.cancel();
    305    
    306319    EXPECT_TRUE( checkmark ) << "Deleyed function was not called within delaytime ("
    307320        << DELAY_TIME << " ms) + " << (MAX_WAIT + DELAY_MARGIN) << " microseconds.";
Note: See TracChangeset for help on using the changeset viewer.