diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-03-13 10:32:04 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-03-13 10:32:04 -0500 |
commit | b1f0d4011ca8ff5658e5b8807350f583d41af21b (patch) | |
tree | 825eecab15581939983620f261b2bd2be24a0510 | |
parent | bee479452605a446567e4e4d0c0ae6d008ae8015 (diff) | |
download | ayatana-indicator-power-b1f0d4011ca8ff5658e5b8807350f583d41af21b.tar.gz ayatana-indicator-power-b1f0d4011ca8ff5658e5b8807350f583d41af21b.tar.bz2 ayatana-indicator-power-b1f0d4011ca8ff5658e5b8807350f583d41af21b.zip |
when expecting a NULL string, use EXPECT_EQ(NULL, str)
-rw-r--r-- | tests/test-device.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/test-device.cc b/tests/test-device.cc index dee0aa6..4d4a89f 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -87,23 +87,35 @@ class DeviceTest : public ::testing::Test char * title = NULL; title = indicator_power_device_get_readable_title (device, true, true); - EXPECT_STREQ (expected_time_and_percent, title); + if (expected_time_and_percent) + EXPECT_STREQ (expected_time_and_percent, title); + else + EXPECT_EQ(NULL, title); g_free (title); title = indicator_power_device_get_readable_title (device, true, false); - EXPECT_STREQ (expected_time, title); + if (expected_time) + EXPECT_STREQ (expected_time, title); + else + EXPECT_EQ(NULL, title); g_free (title); title = indicator_power_device_get_readable_title (device, false, true); - EXPECT_STREQ (expected_percent, title); + if (expected_percent) + EXPECT_STREQ (expected_percent, title); + else + EXPECT_EQ(NULL, title); g_free (title); title = indicator_power_device_get_readable_title (device, false, false); - EXPECT_STREQ (NULL, title); + EXPECT_EQ(NULL, title); g_free (title); a11y = indicator_power_device_get_accessible_title (device, false, false); - EXPECT_STREQ (expected_a11y, a11y); + if (expected_a11y) + EXPECT_STREQ (expected_a11y, a11y); + else + EXPECT_EQ(NULL, a11y); g_free (a11y); } }; |