diff options
author | Ted Gould <ted@gould.cx> | 2011-01-05 20:47:30 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-01-05 20:47:30 -0600 |
commit | d18000e0ab2880798650dc5c2502a5c7f75fc2a7 (patch) | |
tree | 395319170a12bef65d0edc4ffc0ea185c3dbeed9 /tests | |
parent | a02639a8849df82b563331783f5d571622d65208 (diff) | |
parent | e5f53f91d929c46914b4a02336e31724fb54ec95 (diff) | |
download | libdbusmenu-d18000e0ab2880798650dc5c2502a5c7f75fc2a7.tar.gz libdbusmenu-d18000e0ab2880798650dc5c2502a5c7f75fc2a7.tar.bz2 libdbusmenu-d18000e0ab2880798650dc5c2502a5c7f75fc2a7.zip |
Adding in the test for variant removal
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-glib-objects.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test-glib-objects.c b/tests/test-glib-objects.c index 7143814..2c8eda9 100644 --- a/tests/test-glib-objects.c +++ b/tests/test-glib-objects.c @@ -274,6 +274,29 @@ test_object_menuitem_props_boolstr (void) return; } +/* Set and then remove a prop */ +static void +test_object_menuitem_props_removal (void) +{ + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + + /* Set the property and ensure that it's set */ + dbusmenu_menuitem_property_set_variant(item, "myprop", g_variant_new_int32(34)); + g_assert(dbusmenu_menuitem_property_get_variant(item, "myprop") != NULL); + + /* Remove the property and ensure it goes away */ + dbusmenu_menuitem_property_set_variant(item, "myprop", NULL); + g_assert(dbusmenu_menuitem_property_get_variant(item, "myprop") == NULL); + + g_object_unref(item); + + return; +} + /* Build the test suite */ static void test_glib_objects_suite (void) @@ -286,6 +309,7 @@ test_glib_objects_suite (void) g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_swap", test_object_menuitem_props_swap); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_signals", test_object_menuitem_props_signals); g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_boolstr", test_object_menuitem_props_boolstr); + g_test_add_func ("/dbusmenu/glib/objects/menuitem/props_removal", test_object_menuitem_props_removal); return; } |