Skip to content

Instantly share code, notes, and snippets.

@jsbattig
Created March 5, 2014 23:57
Show Gist options
  • Save jsbattig/9379341 to your computer and use it in GitHub Desktop.
Save jsbattig/9379341 to your computer and use it in GitHub Desktop.
ThreadPoolTimer test
TEST_F(SvcBusThreadPoolTest, SvcBusConsumer_testThreadPoolTimer) {
SvcBusThreadPoolTimer timer[1];
int int_value = 0;
ASSERT_TRUE(SvcBusThreadPoolTimer_init( timer, thread_pool, &TestCallback, &int_value, 100 ) == SVCBUS_THREADPOOL_OK);
EXPECT_EQ(0, SvcBusThreadPoolTimer_getThreadId( timer));
SvcBus_crossSleep(500);
EXPECT_TRUE( int_value > 0 );
EXPECT_NE(0, SvcBusThreadPoolTimer_getThreadId( timer));
SvcBusThreadPoolTimer_destroy( timer );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment