diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-dbus-listener.cc | 19 | ||||
-rw-r--r-- | tests/test-device.cc | 26 | ||||
-rw-r--r-- | tests/test-indicator.cc | 1 |
3 files changed, 0 insertions, 46 deletions
diff --git a/tests/test-dbus-listener.cc b/tests/test-dbus-listener.cc index 8bf74bf..7764498 100644 --- a/tests/test-dbus-listener.cc +++ b/tests/test-dbus-listener.cc @@ -26,24 +26,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. **** ***/ -namespace -{ - void ensure_glib_initialized () - { - static bool initialized = false; - - if (G_UNLIKELY(!initialized)) - { - initialized = true; - g_type_init(); - } - } -} - -/*** -**** -***/ - class DbusListenerTest : public ::testing::Test { protected: @@ -138,7 +120,6 @@ class DbusListenerTest : public ::testing::Test gsd_power_error_string = NULL; // bring up the test bus - ensure_glib_initialized (); mainloop = g_main_loop_new (NULL, FALSE); bus = g_test_dbus_new (G_TEST_DBUS_NONE); g_test_dbus_up (bus); diff --git a/tests/test-device.cc b/tests/test-device.cc index d9d7956..ab329f1 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -21,20 +21,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "device.h" #include "indicator-power.h" -namespace -{ - void ensure_glib_initialized () - { - static bool initialized = false; - - if (G_UNLIKELY(!initialized)) - { - initialized = true; - g_type_init(); - } - } -} - class DeviceTest : public ::testing::Test { private: @@ -63,8 +49,6 @@ class DeviceTest : public ::testing::Test log_handler_id = g_log_set_handler ("Indicator-Power", flags, log_count_func, this); log_count_ipower_expected = 0; log_count_ipower_actual = 0; - - ensure_glib_initialized (); } virtual void TearDown() @@ -111,8 +95,6 @@ class DeviceTest : public ::testing::Test TEST_F(DeviceTest, GObjectNew) { - ensure_glib_initialized (); - GObject * o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL)); ASSERT_TRUE (o != NULL); ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o)); @@ -129,8 +111,6 @@ TEST_F(DeviceTest, Properties) guint64 u64; const gchar * key; - ensure_glib_initialized (); - o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL)); ASSERT_TRUE (o != NULL); ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o)); @@ -174,8 +154,6 @@ TEST_F(DeviceTest, Properties) TEST_F(DeviceTest, New) { - ensure_glib_initialized (); - IndicatorPowerDevice * device = indicator_power_device_new ("/object/path", UP_DEVICE_KIND_BATTERY, 50.0, @@ -195,8 +173,6 @@ TEST_F(DeviceTest, New) TEST_F(DeviceTest, NewFromVariant) { - ensure_glib_initialized (); - GVariant * variant = g_variant_new ("(susdut)", "/object/path", (guint32) UP_DEVICE_KIND_BATTERY, @@ -221,8 +197,6 @@ TEST_F(DeviceTest, NewFromVariant) TEST_F(DeviceTest, BadAccessors) { - ensure_glib_initialized (); - // test that these functions can handle being passed NULL pointers IndicatorPowerDevice * device = NULL; indicator_power_device_get_kind (device); diff --git a/tests/test-indicator.cc b/tests/test-indicator.cc index 824a5ac..6fd9bf7 100644 --- a/tests/test-indicator.cc +++ b/tests/test-indicator.cc @@ -46,7 +46,6 @@ namespace if (G_UNLIKELY(!initialized)) { initialized = true; - g_type_init(); g_log_set_handler ("Gtk", (GLogLevelFlags)(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING), quiet_log_func, NULL); g_log_set_handler ("GLib-GObject", (GLogLevelFlags)(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING), quiet_log_func, NULL); } |