From eda15ff15c3603deb748daaa59c9b28a576a9c4d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 26 May 2012 17:10:48 -0500 Subject: add coverage for DBusListener get_property() --- tests/test-indicator.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test-indicator.cc') 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 . #include +#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); +} -- cgit v1.2.3