Пример #1
0
/**
 * Test the MultiCallback works with a 0 limit
 */
void MultiCallbackTest::testZeroLimit() {
  BaseCallback0<void> *callback = NewSingleCallback(
      this,
      &MultiCallbackTest::CallbackMethod);

  CPPUNIT_ASSERT_EQUAL(0, m_callback_count);
  BaseCallback0<void> *multi_callback = NewMultiCallback(0, callback);
  CPPUNIT_ASSERT_EQUAL(1, m_callback_count);

  (void) multi_callback;
}
Пример #2
0
/**
 * Test the MultiCallback works with a single limit
 */
void MultiCallbackTest::testSingleLimit() {
  BaseCallback0<void> *callback = NewSingleCallback(
      this,
      &MultiCallbackTest::CallbackMethod);

  CPPUNIT_ASSERT_EQUAL(0, m_callback_count);
  BaseCallback0<void> *multi_callback = NewMultiCallback(1, callback);
  CPPUNIT_ASSERT_EQUAL(0, m_callback_count);

  multi_callback->Run();
  CPPUNIT_ASSERT_EQUAL(1, m_callback_count);
}