Code review comment for lp:~sil2100/unity/tests_glib_timeout_modifications

Revision history for this message
Francis Ginther (fginther) wrote :

The MultipleShotsRun test doesn't look very useful now as it waits until the callback count is 6, then checks that it is 6. Also, what happens if the callback count never increments? The other test changes look appropriate.

Perhaps it should test that callback count is within a given range, but I'm unsure of the appropriate tolerance. Just a suggestion:
TEST(TestGLibTimeout, MultipleShotsRun)
{
  callback_called = false;
  callback_call_count = 0;
  {
    Timeout timeout(100, &OnSourceCallbackContinue);
    Utils::WaitForTimeoutMSec(650);
    EXPECT_TRUE(timeout.IsRunning());
  }
  EXPECT_TRUE(callback_called);
  EXPECT_GE(callback_call_count, 5);
  EXPECT_LT(callback_call_count, 7);
}

« Back to merge proposal