aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-09 11:49:28 -0600
committerTed Gould <ted@gould.cx>2015-02-09 11:49:28 -0600
commit52dafd6b57679d35d7bdedda447da37ebdf4493a (patch)
tree524d370576c13a59d00f9ddd701bffbfc1f91505 /tests
parent38b5f26e19facc5571723d122f4fa97eea8ba395 (diff)
downloadayatana-indicator-sound-52dafd6b57679d35d7bdedda447da37ebdf4493a.tar.gz
ayatana-indicator-sound-52dafd6b57679d35d7bdedda447da37ebdf4493a.tar.bz2
ayatana-indicator-sound-52dafd6b57679d35d7bdedda447da37ebdf4493a.zip
Fixes the timeout
Diffstat (limited to 'tests')
-rw-r--r--tests/indicator-fixture.h10
1 files changed, 2 insertions, 8 deletions
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<void(void)> 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<std::function<void(void)> *>(data);
(*func)();