From aeb6ab59af1f325261db754aade493a949d5a1e3 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 26 May 2012 16:26:02 -0500 Subject: call g_object_run_dispose() in a standalone test to get coverage on the NULL / non-NULL branches of dispose()'s g_clear_pointer() calls --- tests/test-device.cc | 1 + tests/test-indicator.cc | 1 + 2 files changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/test-device.cc b/tests/test-device.cc index 388460e..132d762 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -45,6 +45,7 @@ TEST(DeviceTest, GObjectNew) GObject * o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL)); ASSERT_TRUE (o != NULL); ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o)); + g_object_run_dispose (o); // used to get coverage of both branches in the object's dispose func's g_clear_*() calls g_object_unref (o); } diff --git a/tests/test-indicator.cc b/tests/test-indicator.cc index 52e319f..dedf54c 100644 --- a/tests/test-indicator.cc +++ b/tests/test-indicator.cc @@ -96,6 +96,7 @@ TEST_F(IndicatorTest, GObjectNew) GObject * o = G_OBJECT (g_object_new (INDICATOR_POWER_TYPE, NULL)); ASSERT_TRUE (o != NULL); ASSERT_TRUE (IS_INDICATOR_POWER(o)); + g_object_run_dispose (o); // used to get coverage of both branches in the object's dispose func's g_clear_*() calls g_object_unref (o); } -- cgit v1.2.3