From 5b17593fb388ab9febc2e4bc26d8054a34dd58c0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 1 Jun 2012 13:43:40 -0500 Subject: 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. --- tests/test-device.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/test-device.cc') 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); -- cgit v1.2.3