From 52dafd6b57679d35d7bdedda447da37ebdf4493a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 9 Feb 2015 11:49:28 -0600 Subject: Fixes the timeout --- tests/indicator-fixture.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/indicator-fixture.h') diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index e16d254..c269be5 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -36,6 +36,7 @@ class IndicatorFixture : public ::testing::Test protected: std::chrono::milliseconds _eventuallyTime; + private: class PerRunData { public: /* We're private in the fixture but other than that we don't care, @@ -209,9 +210,8 @@ class IndicatorFixture : public ::testing::Test /* The core of the idle function as an object so we can use the C++-isms of attaching the variables and make this code reasonably readable */ - auto idlefunc = [&loop, &retpromise, &testfunc, &start, this]() -> void { + std::function idlefunc = [&loop, &retpromise, &testfunc, &start, this]() -> void { auto result = testfunc(); - g_debug("Idle Ran"); if (result == false && _eventuallyTime > (std::chrono::steady_clock::now() - start)) { return; @@ -221,12 +221,6 @@ class IndicatorFixture : public ::testing::Test g_main_loop_quit(loop.get()); }; - /* Run once to see if we can avoid waiting */ - idlefunc(); - if (retfuture.valid()) { - return retfuture.get(); - } - auto idlesrc = g_idle_add([](gpointer data) -> gboolean { auto func = reinterpret_cast *>(data); (*func)(); -- cgit v1.2.3