From 292c19d6e75ee4fa83b71cea3820d0efa6ecc5b0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 5 Nov 2014 10:59:25 -0600 Subject: Fix waiting on actions to count the number of actions --- tests/indicator-fixture.h | 9 ++++++--- tests/indicator-test.cc | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index 02dd885..987c7b7 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -136,10 +136,13 @@ class IndicatorFixture : public ::testing::Test } void agWaitForActions (const std::shared_ptr& group) { - auto list = g_action_group_list_actions(group.get()); + auto list = std::shared_ptr( + g_action_group_list_actions(group.get()), + [](gchar ** list) { + g_strfreev(list); + }); - if (list != nullptr) { - g_strfreev(list); + if (g_strv_length(list.get()) != 0) { return; } diff --git a/tests/indicator-test.cc b/tests/indicator-test.cc index c919e31..7d122ee 100644 --- a/tests/indicator-test.cc +++ b/tests/indicator-test.cc @@ -51,5 +51,5 @@ TEST_F(IndicatorTest, DesktopMenu) { TEST_F(IndicatorTest, SilentActions) { setActions("/com/canonical/indicator/sound"); - expectActionExists("indicator.root"); + expectActionExists("root"); } -- cgit v1.2.3