summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-06 14:00:58 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-06 16:20:48 +0200
commit2d2e01bdecc59f87649940645dc0ee48a49caf3b (patch)
treec2339e58311b57c958950575c074b28a3311ec2c
parentc9632390864adcb3b107c7d4a5d129d3ae0d3597 (diff)
efl_ui_spec: add tests for the previous fixes
we should check that if existing is not added before, that we do not perform reparenting, and that we return false. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9863
-rw-r--r--src/tests/elementary/spec/efl_test_pack_linear.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/tests/elementary/spec/efl_test_pack_linear.c b/src/tests/elementary/spec/efl_test_pack_linear.c
index 4747ec82b3..b66f449b8d 100644
--- a/src/tests/elementary/spec/efl_test_pack_linear.c
+++ b/src/tests/elementary/spec/efl_test_pack_linear.c
@@ -161,6 +161,27 @@ EFL_START_TEST(pack_before2)
161} 161}
162EFL_END_TEST 162EFL_END_TEST
163 163
164EFL_START_TEST(pack_before3)
165{
166 Efl_Ui_Widget *wid[3];
167 Efl_Ui_Widget *inv = create_test_widget();
168 Efl_Ui_Widget *inv2 = create_test_widget();
169
170 _fill_array(wid);
171
172 for (int i = 0; i < 3; i++)
173 efl_pack_end(widget, wid[i]);
174
175 EXPECT_ERROR_START;
176 ck_assert_int_eq(efl_pack_before(widget, inv, inv2), EINA_FALSE);
177 EXPECT_ERROR_END;
178 ck_assert_ptr_ne(efl_test_parent_get(inv), widget);
179
180 ck_assert_int_eq(efl_pack_before(widget, inv, wid[0]), EINA_TRUE);
181 ck_assert_ptr_eq(efl_test_parent_get(inv), widget);
182}
183EFL_END_TEST
184
164EFL_START_TEST(pack_after1) 185EFL_START_TEST(pack_after1)
165{ 186{
166 Efl_Ui_Widget *wid[3]; 187 Efl_Ui_Widget *wid[3];
@@ -205,6 +226,27 @@ EFL_START_TEST(pack_after2)
205} 226}
206EFL_END_TEST 227EFL_END_TEST
207 228
229EFL_START_TEST(pack_after3)
230{
231 Efl_Ui_Widget *wid[3];
232 Efl_Ui_Widget *inv = create_test_widget();
233 Efl_Ui_Widget *inv2 = create_test_widget();
234
235 _fill_array(wid);
236
237 for (int i = 0; i < 3; i++)
238 efl_pack_end(widget, wid[i]);
239
240 EXPECT_ERROR_START;
241 ck_assert_int_eq(efl_pack_after(widget, inv, inv2), EINA_FALSE);
242 EXPECT_ERROR_END;
243 ck_assert_ptr_ne(efl_test_parent_get(inv), widget);
244
245 ck_assert_int_eq(efl_pack_after(widget, inv, wid[0]), EINA_TRUE);
246 ck_assert_ptr_eq(efl_test_parent_get(inv), widget);
247}
248EFL_END_TEST
249
208EFL_START_TEST(pack_at1) 250EFL_START_TEST(pack_at1)
209{ 251{
210 for (int x = -3; x < 3; ++x) 252 for (int x = -3; x < 3; ++x)
@@ -406,8 +448,10 @@ efl_pack_linear_behavior_test(TCase *tc)
406 tcase_add_test(tc, pack_end2); 448 tcase_add_test(tc, pack_end2);
407 tcase_add_test(tc, pack_before1); 449 tcase_add_test(tc, pack_before1);
408 tcase_add_test(tc, pack_before2); 450 tcase_add_test(tc, pack_before2);
451 tcase_add_test(tc, pack_before3);
409 tcase_add_test(tc, pack_after1); 452 tcase_add_test(tc, pack_after1);
410 tcase_add_test(tc, pack_after2); 453 tcase_add_test(tc, pack_after2);
454 tcase_add_test(tc, pack_after3);
411 tcase_add_test(tc, pack_at1); 455 tcase_add_test(tc, pack_at1);
412 tcase_add_test(tc, pack_at2); 456 tcase_add_test(tc, pack_at2);
413 tcase_add_test(tc, pack_at3); 457 tcase_add_test(tc, pack_at3);