summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-30 14:50:32 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-08-30 14:50:32 -0400
commit333a0709152241f08771a95cc5315afef74b5f3e (patch)
treef5dcbf0000d66eaf0204d7a2fb81b243ae256072 /src/tests
parent6f68e327377144a09aab00a8dbf0870c8f47ad77 (diff)
efl_ui_collection: prevent the invalid insertion of items.
Summary: the group hirachy that you can build up with group items is flattend down in the collection, as a linear list. Based on that a user might be able to insert items at invalid positions, like between groups, without having set the proper group item, which ... is a problem. This commit ensures that no new item ever destroys the neightboor hood between two items of the same group or a item with a group and its group leader. Reviewers: stefan_schmidt, zmike, segfaultxavi, SanghyeonLee Reviewed By: SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9778
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/efl_ui_test_collection_common.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/tests/elementary/efl_ui_test_collection_common.c b/src/tests/elementary/efl_ui_test_collection_common.c
index 7be3c7c532..5bd2c5cd55 100644
--- a/src/tests/elementary/efl_ui_test_collection_common.c
+++ b/src/tests/elementary/efl_ui_test_collection_common.c
@@ -22,6 +22,42 @@ fill_items(const Efl_Class *klass)
22 } 22 }
23} 23}
24 24
25void efl_ui_test_item_container_common_add(TCase *tc EINA_UNUSED) 25EFL_START_TEST(finalizer_group_middle_insert)
26{ 26{
27 Efl_Ui_Group_Item *group_item = efl_add(EFL_UI_GROUP_ITEM_CLASS, item_container);
28 efl_pack_end(item_container, group_item);
29 Efl_Ui_Group_Item *i1 = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, item_container);
30 efl_pack_end(group_item, i1);
31 Efl_Ui_Group_Item *i2 = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, item_container);
32 efl_pack_end(group_item, i2);
33 Efl_Ui_Group_Item *e = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, item_container);
34
35 EXPECT_ERROR_START;
36 efl_pack_after(item_container, e, group_item);
37 EXPECT_ERROR_END;
38 EXPECT_ERROR_START;
39 efl_pack_after(item_container, e, i1);
40 EXPECT_ERROR_END;
41
42 EXPECT_ERROR_START;
43 efl_pack_before(item_container, e, i1);
44 EXPECT_ERROR_END;
45 EXPECT_ERROR_START;
46 efl_pack_before(item_container, e, i2);
47 EXPECT_ERROR_END;
48
49 EXPECT_ERROR_START;
50 efl_pack_at(item_container, e, 1);
51 EXPECT_ERROR_END;
52 EXPECT_ERROR_START;
53 efl_pack_at(item_container, e, 2);
54 EXPECT_ERROR_END;
55
56 efl_del(item_container);
57}
58EFL_END_TEST
59
60void efl_ui_test_item_container_common_add(TCase *tc)
61{
62 tcase_add_test(tc, finalizer_group_middle_insert);
27} 63}