Ignore:
Timestamp:
Mar 19, 2014, 6:41:45 PM (10 years ago)
Author:
hock@…
Message:

added new interface: SystemQueue::am_I_in_the_SysQ_thread

for debugging and asserts..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/SystemQueue-tests.cc

    r12765 r12771  
    9494        cout << "### Check ### "<< endl;
    9595
     96        checkmark = true;
     97    }
     98
     99    void CheckThread()
     100    {
     101        EXPECT_TRUE( SystemQueue::instance().am_I_in_the_SysQ_thread() );
     102       
    96103        checkmark = true;
    97104    }
     
    345352}
    346353
     354
     355TEST_F(SystemQueueTest, ThreadDetection)
     356{
     357    SystemQueue& sysq = SystemQueue::instance();
     358   
     359    // start
     360    sysq.run();
     361   
     362    EXPECT_FALSE( sysq.am_I_in_the_SysQ_thread() );
     363   
     364    // scheduleCall
     365    sysq.scheduleCall(
     366        boost::bind(&SystemQueueTest::CheckThread, this)
     367    );
     368   
     369    wait_for_checkmark(MAX_WAIT);
     370   
     371    sysq.cancel();
     372   
     373    EXPECT_TRUE( checkmark ) << "WARNING! One of the test functions was not called at all!";
     374}
     375
     376
    347377/**
    348378 *  schedule multiple calls
Note: See TracChangeset for help on using the changeset viewer.