diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-05-26 17:49:13 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-05-26 17:49:13 -0500 |
commit | 2f1281d4faa6bed2a0be484bd722504df290880c (patch) | |
tree | 6a2cd4671e6e4c6efa1f3d3a5d77064be36ef43c | |
parent | eda15ff15c3603deb748daaa59c9b28a576a9c4d (diff) | |
download | ayatana-indicator-power-2f1281d4faa6bed2a0be484bd722504df290880c.tar.gz ayatana-indicator-power-2f1281d4faa6bed2a0be484bd722504df290880c.tar.bz2 ayatana-indicator-power-2f1281d4faa6bed2a0be484bd722504df290880c.zip |
add coverage for charging with >1 minute but <1 hour left
-rw-r--r-- | tests/test-indicator.cc | 9 |
1 files changed, 9 insertions, 0 deletions
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, |