aboutsummaryrefslogtreecommitdiff
path: root/tests/test-device.cc
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-05-24 19:24:11 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-05-24 19:24:11 -0500
commitebf2edadf40205a11998eb37c59cab1f2116d7f5 (patch)
tree845da2974c5989ffbd6120ed4859599f23591639 /tests/test-device.cc
parent88d486192c176f938b09ee86c5cd6f95dfd02aba (diff)
downloadayatana-indicator-power-ebf2edadf40205a11998eb37c59cab1f2116d7f5.tar.gz
ayatana-indicator-power-ebf2edadf40205a11998eb37c59cab1f2116d7f5.tar.bz2
ayatana-indicator-power-ebf2edadf40205a11998eb37c59cab1f2116d7f5.zip
test passing bad non-NULL pointers to Device's accessors
Diffstat (limited to 'tests/test-device.cc')
-rw-r--r--tests/test-device.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/test-device.cc b/tests/test-device.cc
index 0102185..3a7e8d0 100644
--- a/tests/test-device.cc
+++ b/tests/test-device.cc
@@ -163,10 +163,20 @@ TEST(DeviceTest, BadAccessors)
// test that these functions can handle being passed NULL pointers
IndicatorPowerDevice * device = NULL;
- indicator_power_device_get_kind(device);
- indicator_power_device_get_state(device);
- indicator_power_device_get_object_path(device);
- indicator_power_device_get_icon(device);
- indicator_power_device_get_percentage(device);
- indicator_power_device_get_time(device);
+ indicator_power_device_get_kind (device);
+ indicator_power_device_get_time (device);
+ indicator_power_device_get_icon (device);
+ indicator_power_device_get_state (device);
+ indicator_power_device_get_percentage (device);
+ indicator_power_device_get_object_path (device);
+
+ // test that these functions can handle being passed non-device GObjects
+ device = g_cancellable_new ();
+ indicator_power_device_get_kind (device);
+ indicator_power_device_get_time (device);
+ indicator_power_device_get_icon (device);
+ indicator_power_device_get_state (device);
+ indicator_power_device_get_percentage (device);
+ indicator_power_device_get_object_path (device);
+ g_object_unref (device);
}