diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-05-26 17:10:48 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-05-26 17:10:48 -0500 |
commit | eda15ff15c3603deb748daaa59c9b28a576a9c4d (patch) | |
tree | a481215431aa4529bdc91d572abc9abe305bf1de | |
parent | 194cfbc5c7be5b7b298a6e7079452af2f8331142 (diff) | |
download | ayatana-indicator-power-eda15ff15c3603deb748daaa59c9b28a576a9c4d.tar.gz ayatana-indicator-power-eda15ff15c3603deb748daaa59c9b28a576a9c4d.tar.bz2 ayatana-indicator-power-eda15ff15c3603deb748daaa59c9b28a576a9c4d.zip |
add coverage for DBusListener get_property()
-rw-r--r-- | tests/test-indicator.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test-indicator.cc b/tests/test-indicator.cc index dedf54c..2229d77 100644 --- a/tests/test-indicator.cc +++ b/tests/test-indicator.cc @@ -19,6 +19,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <gtest/gtest.h> +#include "dbus-listener.h" #include "device.h" #include "indicator-power.h" @@ -230,3 +231,19 @@ TEST_F(IndicatorTest, AvoidChargingBatteriesWithZeroSecondsLeft) g_object_unref (bad_battery_device); } +TEST_F(IndicatorTest, DbusListenerGetProperty) +{ + IndicatorPower * power = INDICATOR_POWER(g_object_new (INDICATOR_POWER_TYPE, NULL)); + GObject * dbus_listener = G_OBJECT(g_object_new (INDICATOR_POWER_DBUS_LISTENER_TYPE, + INDICATOR_POWER_DBUS_LISTENER_INDICATOR, power, + NULL)); + GObject * indicator = NULL; + g_object_get (dbus_listener, + INDICATOR_POWER_DBUS_LISTENER_INDICATOR, &indicator, + NULL); + ASSERT_EQ(INDICATOR_POWER(indicator), power); + + // cleanup + g_object_unref (dbus_listener); + g_object_unref (power); +} |