aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-01 13:43:40 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-01 13:43:40 -0500
commit5b17593fb388ab9febc2e4bc26d8054a34dd58c0 (patch)
tree280c1ff12f8207d255f1ec27f1ad49c284feeec6 /tests
parent4c433bf6980f43c5fca5d7c86b167f50cc0295fd (diff)
downloadayatana-indicator-power-5b17593fb388ab9febc2e4bc26d8054a34dd58c0.tar.gz
ayatana-indicator-power-5b17593fb388ab9febc2e4bc26d8054a34dd58c0.tar.bz2
ayatana-indicator-power-5b17593fb388ab9febc2e4bc26d8054a34dd58c0.zip
Fix edge case in indicator_power_device_get_icon_names() that returned a bad value if the caller passed in a NULL pointer as a device. Added regression test.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-device.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test-device.cc b/tests/test-device.cc
index 1233133..525eee0 100644
--- a/tests/test-device.cc
+++ b/tests/test-device.cc
@@ -224,6 +224,9 @@ TEST_F(DeviceTest, IconNames)
IndicatorPowerDevice * device = INDICATOR_POWER_DEVICE (g_object_new (INDICATOR_POWER_DEVICE_TYPE, NULL));
GObject * o = G_OBJECT(device);
+ /* bad arguments */
+ ASSERT_TRUE (indicator_power_device_get_icon_names (NULL) == NULL);
+
/* power */
g_object_set (o, INDICATOR_POWER_DEVICE_KIND, UP_DEVICE_KIND_LINE_POWER,
NULL);