diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-05-24 18:51:51 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-05-24 18:51:51 -0500 |
commit | d2ba05cfd549a09ff8651c1700b8bf0a8e7d0451 (patch) | |
tree | 9607dae9c9dfe45ae683b4cd8bf3f38a6898e507 /tests/test-device.cc | |
parent | fd7ad85760663cf176e126d7e350b9f010630b9b (diff) | |
download | ayatana-indicator-power-d2ba05cfd549a09ff8651c1700b8bf0a8e7d0451.tar.gz ayatana-indicator-power-d2ba05cfd549a09ff8651c1700b8bf0a8e7d0451.tar.bz2 ayatana-indicator-power-d2ba05cfd549a09ff8651c1700b8bf0a8e7d0451.zip |
remove the tests that attempted to exercise the code removed in r151
Diffstat (limited to 'tests/test-device.cc')
-rw-r--r-- | tests/test-device.cc | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/tests/test-device.cc b/tests/test-device.cc index 0a86478..70beeb7 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -56,39 +56,26 @@ TEST(DeviceTest, Properties) gchar * str; guint64 u64; const gchar * key; - GValue string_value = G_VALUE_INIT; - GValue object_value = G_VALUE_INIT; ensure_glib_initialized (); - g_value_init (&string_value, G_TYPE_STRING); - g_value_init (&object_value, G_TYPE_OBJECT); - g_value_set_string (&string_value, "i am a string"); - o = G_OBJECT (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL)); ASSERT_TRUE (o != NULL); ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(o)); - /* Test getting & setting a Device's properties. - * Also test that setting a property from an unrelated type has no effect. */ + /* Test getting & setting a Device's properties. */ // KIND key = INDICATOR_POWER_DEVICE_KIND; g_object_set (o, key, UP_DEVICE_KIND_BATTERY, NULL); g_object_get (o, key, &i, NULL); ASSERT_EQ (i, UP_DEVICE_KIND_BATTERY); - g_object_set_property (o, key, &string_value); - g_object_get (o, key, &i, NULL); - ASSERT_EQ (i, UP_DEVICE_KIND_BATTERY); // STATE key = INDICATOR_POWER_DEVICE_STATE; g_object_set (o, key, UP_DEVICE_STATE_CHARGING, NULL); g_object_get (o, key, &i, NULL); ASSERT_EQ (i, UP_DEVICE_STATE_CHARGING); - g_object_set_property (o, key, &string_value); - g_object_get (o, key, &i, NULL); - ASSERT_EQ (i, UP_DEVICE_STATE_CHARGING); // OBJECT_PATH key = INDICATOR_POWER_DEVICE_OBJECT_PATH; @@ -96,10 +83,6 @@ TEST(DeviceTest, Properties) g_object_get (o, key, &str, NULL); ASSERT_STREQ (str, "/object/path"); g_free (str); - g_object_set_property (o, key, &object_value); - g_object_get (o, key, &str, NULL); - ASSERT_STREQ (str, "/object/path"); - g_free (str); // ICON key = INDICATOR_POWER_DEVICE_ICON; @@ -107,35 +90,21 @@ TEST(DeviceTest, Properties) g_object_get (o, key, &str, NULL); ASSERT_STREQ (str, "something"); g_free (str); - str = NULL; - g_object_set_property (o, key, &object_value); - g_object_get (o, key, &str, NULL); - ASSERT_STREQ (str, "something"); - g_free (str); - str = NULL; // PERCENTAGE key = INDICATOR_POWER_DEVICE_PERCENTAGE; g_object_set (o, key, 50.0, NULL); g_object_get (o, key, &d, NULL); ASSERT_EQ((int)d, 50); - g_object_set_property (o, key, &object_value); - g_object_get (o, key, &d, NULL); - ASSERT_EQ((int)d, 50); // TIME key = INDICATOR_POWER_DEVICE_TIME; - g_object_set (o, key, 30, NULL); - g_object_get (o, key, &u64, NULL); - ASSERT_EQ(u64, 30); - g_object_set_property (o, key, &object_value); + g_object_set (o, key, (guint64)30, NULL); g_object_get (o, key, &u64, NULL); ASSERT_EQ(u64, 30); // cleanup g_object_unref (o); - g_value_unset (&object_value); - g_value_unset (&string_value); } TEST(DeviceTest, New) |