[clutter] conform/actor-graph: Add more cases
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] conform/actor-graph: Add more cases
- Date: Thu, 9 Feb 2012 14:24:47 +0000 (UTC)
commit 0c715d00264241307b53a7d167352b127b46d314
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Thu Feb 9 14:22:31 2012 +0000
conform/actor-graph: Add more cases
The actor-insert unit is not exercising the whole API and its allowed
arguments; this let sneak in the buglet found in bug 669730.
tests/conform/test-actor-graph.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/tests/conform/test-actor-graph.c b/tests/conform/test-actor-graph.c
index f0fc564..af2343b 100644
--- a/tests/conform/test-actor-graph.c
+++ b/tests/conform/test-actor-graph.c
@@ -98,6 +98,39 @@ actor_insert_child (TestConformSimpleFixture *fixture,
iter = clutter_actor_get_previous_sibling (iter);
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "bar");
+ clutter_actor_remove_all_children (actor);
+
+ clutter_actor_insert_child_at_index (actor,
+ g_object_new (CLUTTER_TYPE_ACTOR,
+ "name", "1",
+ NULL),
+ 0);
+ iter = clutter_actor_get_child_at_index (actor, 0);
+ g_assert_cmpstr (clutter_actor_get_name (iter), ==, "1");
+ g_assert (clutter_actor_get_first_child (actor) == iter);
+ g_assert (clutter_actor_get_last_child (actor) == iter);
+
+ clutter_actor_insert_child_at_index (actor,
+ g_object_new (CLUTTER_TYPE_ACTOR,
+ "name", "2",
+ NULL),
+ 0);
+ iter = clutter_actor_get_child_at_index (actor, 0);
+ g_assert_cmpstr (clutter_actor_get_name (iter), ==, "2");
+ g_assert (clutter_actor_get_first_child (actor) == iter);
+ iter = clutter_actor_get_child_at_index (actor, 1);
+ g_assert_cmpstr (clutter_actor_get_name (iter), ==, "1");
+ g_assert (clutter_actor_get_last_child (actor) == iter);
+
+ clutter_actor_insert_child_at_index (actor,
+ g_object_new (CLUTTER_TYPE_ACTOR,
+ "name", "3",
+ NULL),
+ -1);
+ iter = clutter_actor_get_child_at_index (actor, 2);
+ g_assert_cmpstr (clutter_actor_get_name (iter), ==, "3");
+ g_assert (clutter_actor_get_last_child (actor) == iter);
+
clutter_actor_destroy (actor);
g_object_unref (actor);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]