From b04e0deb68b1e245eba4bcbbf80b8d706d0250b8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 22 Oct 2009 14:30:40 -0500 Subject: Checking the category and state --- tests/test-defines.h | 2 ++ tests/test-libcustomindicator-dbus-client.c | 36 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'tests') diff --git a/tests/test-defines.h b/tests/test-defines.h index 73ab316..2afe4f4 100644 --- a/tests/test-defines.h +++ b/tests/test-defines.h @@ -3,5 +3,7 @@ #define TEST_ICON_NAME "my-icon-name" #define TEST_ATTENTION_ICON_NAME "my-attention-icon-name" #define TEST_STATE CUSTOM_INDICATOR_STATUS_ACTIVE +#define TEST_STATE_S "active" #define TEST_CATEGORY CUSTOM_INDICATOR_CATEGORY_APPLICATION_STATUS +#define TEST_CATEGORY_S "application-status" diff --git a/tests/test-libcustomindicator-dbus-client.c b/tests/test-libcustomindicator-dbus-client.c index 66922dc..bdc0fa6 100644 --- a/tests/test-libcustomindicator-dbus-client.c +++ b/tests/test-libcustomindicator-dbus-client.c @@ -50,6 +50,24 @@ prop_category_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data) { propcount++; + GError * error = NULL; + GValue value = {0}; + + if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_VALUE, &value, G_TYPE_INVALID)) { + g_warning("Getting category failed: %s", error->message); + g_error_free(error); + passed = FALSE; + check_propcount(); + return; + } + + if (g_strcmp0(TEST_CATEGORY_S, g_value_get_string(&value))) { + g_debug("Property category Returned: FAILED"); + passed = FALSE; + } else { + g_debug("Property category Returned: PASSED"); + } + check_propcount(); return; } @@ -59,6 +77,24 @@ prop_status_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data) { propcount++; + GError * error = NULL; + GValue value = {0}; + + if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_VALUE, &value, G_TYPE_INVALID)) { + g_warning("Getting status failed: %s", error->message); + g_error_free(error); + passed = FALSE; + check_propcount(); + return; + } + + if (g_strcmp0(TEST_STATE_S, g_value_get_string(&value))) { + g_debug("Property status Returned: FAILED"); + passed = FALSE; + } else { + g_debug("Property status Returned: PASSED"); + } + check_propcount(); return; } -- cgit v1.2.3