diff options
-rw-r--r-- | src/device.c | 2 | ||||
-rw-r--r-- | tests/test-device.cc | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c index ac03009..b163682 100644 --- a/src/device.c +++ b/src/device.c @@ -307,7 +307,7 @@ indicator_power_device_get_icon_names (const IndicatorPowerDevice * device) const gchar *index_str; /* LCOV_EXCL_START */ - g_return_val_if_fail (INDICATOR_IS_POWER_DEVICE(device), UP_DEVICE_KIND_UNKNOWN); + g_return_val_if_fail (INDICATOR_IS_POWER_DEVICE(device), NULL); /* LCOV_EXCL_STOP */ gdouble percentage = indicator_power_device_get_percentage (device); 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); |