diff options
author | Ted Gould <ted@gould.cx> | 2009-12-21 15:26:19 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2009-12-21 15:26:19 -0600 |
commit | c96e551eccc631c726e0987ebe8ed859c2305e42 (patch) | |
tree | 8795f32fdde259b928b574b3708e86b5b2c272a9 /tests/test-glib-objects.c | |
parent | d7480ea88bc34ac80c468e28ce8b6a0704cb3c8c (diff) | |
download | libdbusmenu-c96e551eccc631c726e0987ebe8ed859c2305e42.tar.gz libdbusmenu-c96e551eccc631c726e0987ebe8ed859c2305e42.tar.bz2 libdbusmenu-c96e551eccc631c726e0987ebe8ed859c2305e42.zip |
Testing setting the same prop multiple times of different types.
Diffstat (limited to 'tests/test-glib-objects.c')
-rw-r--r-- | tests/test-glib-objects.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test-glib-objects.c b/tests/test-glib-objects.c index d45baa0..7f79746 100644 --- a/tests/test-glib-objects.c +++ b/tests/test-glib-objects.c @@ -115,12 +115,43 @@ test_object_menuitem_props_bool (void) } void +test_object_menuitem_props_swap (void) +{ + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + + /* Setting a boolean */ + dbusmenu_menuitem_property_set_bool(item, "swapper", TRUE); + g_assert(dbusmenu_menuitem_property_get_bool(item, "swapper")); + + /* Setting a int */ + dbusmenu_menuitem_property_set_int(item, "swapper", 5432); + g_assert(dbusmenu_menuitem_property_get_int(item, "swapper") == 5432); + + /* Setting a string */ + dbusmenu_menuitem_property_set(item, "swapper", "mystring"); + g_assert(!g_strcmp0(dbusmenu_menuitem_property_get(item, "swapper"), "mystring")); + + /* Setting a boolean */ + dbusmenu_menuitem_property_set_bool(item, "swapper", FALSE); + g_assert(!dbusmenu_menuitem_property_get_bool(item, "swapper")); + + g_object_unref(item); + + return; +} + +void test_glib_objects_suite (void) { g_test_add_func ("/dbusmenu/glib/objects/menuitem/base", test_object_menuitem); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_string", test_object_menuitem_props_string); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_int", test_object_menuitem_props_int); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_bool", test_object_menuitem_props_bool); + g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_swap", test_object_menuitem_props_swap); return; } |