summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-31 09:02:45 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-31 09:59:11 -0400
commit2f17b4c391504ac3f10bc6b41eeaa03701571906 (patch)
tree553bafce63118a7963004789299f687b5c7d7efe
parentee0f23389c694673e8449f03c06a502d85423659 (diff)
tests/spec: reduce looping of pack content tests
Summary: this was hugely over-testing before; simply verifying one item outside the limit is sufficient here Depends on D10567 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10568
-rw-r--r--src/tests/elementary/spec/efl_test_pack_linear.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tests/elementary/spec/efl_test_pack_linear.c b/src/tests/elementary/spec/efl_test_pack_linear.c
index ad7644206e..3886dfde9b 100644
--- a/src/tests/elementary/spec/efl_test_pack_linear.c
+++ b/src/tests/elementary/spec/efl_test_pack_linear.c
@@ -367,6 +367,7 @@ EFL_END_TEST
367EFL_START_TEST(pack_content_get1) 367EFL_START_TEST(pack_content_get1)
368{ 368{
369 Efl_Ui_Widget *wid[3]; 369 Efl_Ui_Widget *wid[3];
370 int num_widgets = EINA_C_ARRAY_LENGTH(wid);
370 371
371 for (int i = 0; i < 3; i++) 372 for (int i = 0; i < 3; i++)
372 { 373 {
@@ -374,14 +375,14 @@ EFL_START_TEST(pack_content_get1)
374 efl_pack_end(widget, wid[i]); 375 efl_pack_end(widget, wid[i]);
375 } 376 }
376 377
377 for (int i = -100000; i <= 100000; i++) 378 for (int i = -num_widgets - 1; i <= num_widgets + 1; i++)
378 { 379 {
379 if (i < -3) 380 if (i <= -num_widgets)
380 ck_assert_ptr_eq(efl_pack_content_get(widget, i), efl_pack_content_get(widget, 0)); 381 ck_assert_ptr_eq(efl_pack_content_get(widget, i), efl_pack_content_get(widget, 0));
381 else if (i >= -3 && i < 3) 382 else if (i >= num_widgets)
382 ck_assert_ptr_eq(efl_pack_content_get(widget, i), wid[(i + 3) % 3]);
383 else
384 ck_assert_ptr_eq(efl_pack_content_get(widget, i), efl_pack_content_get(widget, 2)); 383 ck_assert_ptr_eq(efl_pack_content_get(widget, i), efl_pack_content_get(widget, 2));
384 else
385 ck_assert_ptr_eq(efl_pack_content_get(widget, i), wid[(i + num_widgets) % num_widgets]);
385 } 386 }
386} 387}
387EFL_END_TEST 388EFL_END_TEST