From 2f1281d4faa6bed2a0be484bd722504df290880c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 26 May 2012 17:49:13 -0500 Subject: add coverage for charging with >1 minute but <1 hour left --- tests/test-indicator.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test-indicator.cc b/tests/test-indicator.cc index 2229d77..5875df6 100644 --- a/tests/test-indicator.cc +++ b/tests/test-indicator.cc @@ -115,6 +115,15 @@ TEST_F(IndicatorTest, DischargingStrings) { IndicatorPower * power = INDICATOR_POWER(g_object_new (INDICATOR_POWER_TYPE, NULL)); + // give the indicator a discharging battery with 30 minutes of life left + g_object_set (battery_device, + INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_DISCHARGING, + INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0, + INDICATOR_POWER_DEVICE_TIME, guint64(60*30), + NULL); + indicator_power_set_devices (power, &battery_device, 1); + ASSERT_STREQ (GetAccessibleDesc(power), "Battery (30 minutes left (50%))"); + // give the indicator a discharging battery with 1 hour of life left g_object_set (battery_device, INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_DISCHARGING, -- cgit v1.2.3