aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-04-21 11:22:56 -0500
committerCharles Kerr <charles.kerr@canonical.com>2016-04-21 11:22:56 -0500
commitb37db33c628675971f118fb3e241dc32a9f0a5d0 (patch)
tree967abb87a826de3122f905aae32c3b3f096b0156 /tests/unit
parentd4e82e7d4fa1937d27d1397a036af2b6b03349b3 (diff)
downloadayatana-indicator-display-b37db33c628675971f118fb3e241dc32a9f0a5d0.tar.gz
ayatana-indicator-display-b37db33c628675971f118fb3e241dc32a9f0a5d0.tar.bz2
ayatana-indicator-display-b37db33c628675971f118fb3e241dc32a9f0a5d0.zip
tell glib not to exit when the gdbusconnection is closed
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/greeter-test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/greeter-test.cpp b/tests/unit/greeter-test.cpp
index b33c300..72df3bc 100644
--- a/tests/unit/greeter-test.cpp
+++ b/tests/unit/greeter-test.cpp
@@ -41,6 +41,7 @@ protected:
std::shared_ptr<QtDBusTest::DBusTestRunner> m_dbus_runner;
std::shared_ptr<QtDBusMock::DBusMock> m_dbus_mock;
+ GDBusConnection* m_bus {};
void SetUp() override
{
@@ -49,6 +50,18 @@ protected:
// use a fresh bus for each test run
m_dbus_runner.reset(new QtDBusTest::DBusTestRunner());
m_dbus_mock.reset(new QtDBusMock::DBusMock(*m_dbus_runner.get()));
+
+ GError* error {};
+ m_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, nullptr, &error);
+ g_assert_no_error(error);
+ g_dbus_connection_set_exit_on_close(m_bus, FALSE);
+ }
+
+ void TearDown() override
+ {
+ g_clear_object(&m_bus);
+
+ super::TearDown();
}
void start_greeter_service(bool is_active)