aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-10-28 08:40:44 +0100
committerCharles Kerr <charles.kerr@canonical.com>2012-10-28 08:40:44 +0100
commita76e4749d62fb24b89c879d2bdf1164dbdac233f (patch)
tree1bb3b69d1478a2eb87210a8a206a920a31828e0f
parent8867ec9433122b225a22667b1f25a53d21ca1fd1 (diff)
downloadayatana-indicator-power-a76e4749d62fb24b89c879d2bdf1164dbdac233f.tar.gz
ayatana-indicator-power-a76e4749d62fb24b89c879d2bdf1164dbdac233f.tar.bz2
ayatana-indicator-power-a76e4749d62fb24b89c879d2bdf1164dbdac233f.zip
in TestDevice, make the log variable names a little more consistent
-rw-r--r--tests/test-device.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/test-device.cc b/tests/test-device.cc
index 02493dc..18bdc08 100644
--- a/tests/test-device.cc
+++ b/tests/test-device.cc
@@ -39,38 +39,38 @@ class DeviceTest : public ::testing::Test
{
private:
- guint handler_id;
+ guint log_handler_id;
- int log_count;
+ int log_count_ipower_actual;
static void log_count_func (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer user_data)
{
- reinterpret_cast<DeviceTest*>(user_data)->log_count++;
+ reinterpret_cast<DeviceTest*>(user_data)->log_count_ipower_actual++;
}
protected:
- int expected_ipower_log_messages;
+ int log_count_ipower_expected;
protected:
virtual void SetUp()
{
const GLogLevelFlags flags = GLogLevelFlags(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING);
- handler_id = g_log_set_handler ("Indicator-Power", flags, log_count_func, this);
- expected_ipower_log_messages = 0;
- log_count = 0;
+ log_handler_id = g_log_set_handler ("Indicator-Power", flags, log_count_func, this);
+ log_count_ipower_expected = 0;
+ log_count_ipower_actual = 0;
ensure_glib_initialized ();
}
virtual void TearDown()
{
- ASSERT_EQ (expected_ipower_log_messages, log_count);
- g_log_remove_handler ("Indicator-Power", handler_id);
+ ASSERT_EQ (log_count_ipower_expected, log_count_ipower_actual);
+ g_log_remove_handler ("Indicator-Power", log_handler_id);
}
protected:
@@ -230,7 +230,7 @@ TEST_F(DeviceTest, BadAccessors)
indicator_power_device_get_state (device);
indicator_power_device_get_percentage (device);
indicator_power_device_get_object_path (device);
- expected_ipower_log_messages += 5;
+ log_count_ipower_expected += 5;
// test that these functions can handle being passed non-device GObjects
device = reinterpret_cast<IndicatorPowerDevice*>(g_cancellable_new ());
@@ -239,7 +239,7 @@ TEST_F(DeviceTest, BadAccessors)
indicator_power_device_get_state (device);
indicator_power_device_get_percentage (device);
indicator_power_device_get_object_path (device);
- expected_ipower_log_messages += 5;
+ log_count_ipower_expected += 5;
g_object_unref (device);
}
@@ -254,7 +254,7 @@ TEST_F(DeviceTest, IconNames)
GObject * o = G_OBJECT(device);
// bad arguments
- expected_ipower_log_messages++;
+ log_count_ipower_expected++;
ASSERT_TRUE (indicator_power_device_get_icon_names (NULL) == NULL);
// power
@@ -481,11 +481,11 @@ TEST_F(DeviceTest, Labels)
g_setenv ("LANG", "en_US.UTF-8", TRUE);
// bad args: NULL device
- expected_ipower_log_messages++;
+ log_count_ipower_expected++;
check_strings (NULL, NULL, NULL, NULL);
// bad args: a GObject that isn't a device
- expected_ipower_log_messages++;
+ log_count_ipower_expected++;
GObject * o = G_OBJECT(g_cancellable_new());
check_strings ((IndicatorPowerDevice*)o, NULL, NULL, NULL);
g_object_unref (o);