conform/actor-invariants: Add tests for show-on-set-parent
authorEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 5 Mar 2012 17:26:09 +0000 (17:26 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 5 Mar 2012 17:27:37 +0000 (17:27 +0000)
The show-on-set-parent flag is mental, but it needs to be tested better
than just checking for it always been set to TRUE.

tests/conform/actor-invariants.c

index 67034e2..5553abb 100644 (file)
@@ -230,7 +230,7 @@ actor_show_on_set_parent (TestConformSimpleFixture *fixture,
                 NULL);
 
   g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
-  g_assert (show_on_set_parent == TRUE);
+  g_assert (show_on_set_parent);
 
   clutter_actor_add_child (group, actor);
   g_object_get (actor,
@@ -238,7 +238,7 @@ actor_show_on_set_parent (TestConformSimpleFixture *fixture,
                 NULL);
 
   g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
-  g_assert (show_on_set_parent == TRUE);
+  g_assert (show_on_set_parent);
 
   g_object_ref (actor);
   clutter_actor_remove_child (group, actor);
@@ -249,10 +249,35 @@ actor_show_on_set_parent (TestConformSimpleFixture *fixture,
   g_assert (!CLUTTER_ACTOR_IS_REALIZED (actor));
   g_assert (!CLUTTER_ACTOR_IS_MAPPED (actor));
   g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
-  g_assert (show_on_set_parent == TRUE);
+  g_assert (show_on_set_parent);
 
   clutter_actor_destroy (actor);
   clutter_actor_destroy (group);
+
+  actor = clutter_actor_new ();
+  clutter_actor_add_child (stage, actor);
+  clutter_actor_hide (actor);
+  g_object_get (actor,
+                "show-on-set-parent", &show_on_set_parent,
+                NULL);
+  g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor));
+  g_assert (!CLUTTER_ACTOR_IS_MAPPED (actor));
+  g_assert (show_on_set_parent);
+
+  clutter_actor_destroy (actor);
+
+  actor = clutter_actor_new ();
+  clutter_actor_hide (actor);
+  clutter_actor_add_child (stage, actor);
+  g_object_get (actor,
+                "show-on-set-parent", &show_on_set_parent,
+                NULL);
+  g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor));
+  g_assert (!CLUTTER_ACTOR_IS_MAPPED (actor));
+  g_assert (!show_on_set_parent);
+
+  clutter_actor_destroy (actor);
+
   clutter_actor_destroy (stage);
 }