summaryrefslogtreecommitdiff
path: root/test/test-page-manager.c
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-05-14 12:19:21 +0200
committerP. F. Chimento <philip.chimento@gmail.com>2013-05-14 12:19:21 +0200
commitac2490118e389085081768f1d8d0238e5bfa42b0 (patch)
tree651073c0989e32cebdb4d675c26c51ba5c8c0467 /test/test-page-manager.c
parent5c935a5689feedcf1b4700c0fb145f1c061e41c8 (diff)
Treat pages with no name as having name NULL
[endlessm/eos-sdk#58]
Diffstat (limited to 'test/test-page-manager.c')
-rw-r--r--test/test-page-manager.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/test/test-page-manager.c b/test/test-page-manager.c
index 00ce0ad..b1d862f 100644
--- a/test/test-page-manager.c
+++ b/test/test-page-manager.c
@@ -176,12 +176,26 @@ test_pm_page_no_name (PageManagerFixture *fixture,
GtkWidget *new_page = gtk_label_new("new");
gtk_container_add (GTK_CONTAINER (fixture->pm), new_page);
name_get = eos_page_manager_get_page_name (EOS_PAGE_MANAGER (fixture->pm), new_page);
- g_assert_cmpstr (name_get, ==, "");
+ g_assert (name_get == NULL);
gtk_container_child_get (GTK_CONTAINER (fixture->pm), new_page,
"name", &name_prop,
NULL);
- g_assert_cmpstr (name_prop, ==, "");
- g_free (name_prop);
+ g_assert (name_prop == NULL);
+}
+
+static void
+test_pm_set_page_no_name (PageManagerFixture *fixture,
+ gconstpointer unused)
+{
+ const gchar *name;
+ eos_page_manager_set_page_name (EOS_PAGE_MANAGER (fixture->pm),
+ fixture->page1,
+ NULL);
+ name = eos_page_manager_get_page_name (EOS_PAGE_MANAGER (fixture->pm),
+ fixture->page1);
+ g_assert (name == NULL);
+ name = eos_page_manager_get_visible_page_name (EOS_PAGE_MANAGER (fixture->pm));
+ g_assert (name == NULL);
}
static void
@@ -310,6 +324,8 @@ add_page_manager_tests (void)
ADD_PAGE_MANAGER_TEST ("/page-manager/child-prop-name",
test_pm_child_prop_name);
ADD_PAGE_MANAGER_TEST ("/page-manager/page-no-name", test_pm_page_no_name);
+ ADD_PAGE_MANAGER_TEST ("/page-manager/set-page-no-name",
+ test_pm_set_page_no_name);
ADD_PAGE_MANAGER_TEST ("/page-manager/remove-page-by-name",
test_pm_remove_page_by_name);
ADD_PAGE_MANAGER_TEST ("/page-manager/duplicate-page-name",