aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-10-21 11:14:09 -0500
committerTed Gould <ted@canonical.com>2009-10-21 11:14:09 -0500
commit795f7d94377f9093e8b3b064e7e020c4f753293d (patch)
tree3bae0515cb350fb959758aa3ea8e10a09083a930
parent0093c378498e9d203012a143e49137f72d8168ce (diff)
downloadayatana-indicator-application-795f7d94377f9093e8b3b064e7e020c4f753293d.tar.gz
ayatana-indicator-application-795f7d94377f9093e8b3b064e7e020c4f753293d.tar.bz2
ayatana-indicator-application-795f7d94377f9093e8b3b064e7e020c4f753293d.zip
Adding a test that sets a bunch of properties.
-rw-r--r--tests/test-libcustomindicator.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/test-libcustomindicator.c b/tests/test-libcustomindicator.c
index c264bfa..1736efa 100644
--- a/tests/test-libcustomindicator.c
+++ b/tests/test-libcustomindicator.c
@@ -5,6 +5,28 @@
#include <libcustomindicator/custom-indicator.h>
void
+test_libcustomindicator_init_with_props (void)
+{
+ CustomIndicator * ci = CUSTOM_INDICATOR(g_object_new(CUSTOM_INDICATOR_TYPE,
+ "id", "my-id",
+ "category", CUSTOM_INDICATOR_CATEGORY_APPLICATION_STATUS,
+ "status", CUSTOM_INDICATOR_STATUS_ON,
+ "icon-name", "my-name",
+ "attention-icon-name", "my-attention-name",
+ NULL));
+ g_assert(ci != NULL);
+
+ g_assert(!g_strcmp0("my-id", custom_indicator_get_id(ci)));
+ g_assert(!g_strcmp0("my-name", custom_indicator_get_icon(ci)));
+ g_assert(!g_strcmp0("my-attention-name", custom_indicator_get_attention_icon(ci)));
+ g_assert(custom_indicator_get_status(ci) == CUSTOM_INDICATOR_STATUS_ON);
+ g_assert(custom_indicator_get_category(ci) == CUSTOM_INDICATOR_CATEGORY_APPLICATION_STATUS);
+
+ g_object_unref(G_OBJECT(ci));
+ return;
+}
+
+void
test_libcustomindicator_init (void)
{
CustomIndicator * ci = CUSTOM_INDICATOR(g_object_new(CUSTOM_INDICATOR_TYPE, NULL));
@@ -16,7 +38,8 @@ test_libcustomindicator_init (void)
void
test_libcustomindicator_props_suite (void)
{
- g_test_add_func ("/indicator-custom/libcustomindicator/init", test_libcustomindicator_init);
+ g_test_add_func ("/indicator-custom/libcustomindicator/init", test_libcustomindicator_init);
+ g_test_add_func ("/indicator-custom/libcustomindicator/init_props", test_libcustomindicator_init_with_props);
return;