summaryrefslogtreecommitdiff
path: root/src/tests/eina/eina_test_iterator.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-11-15 15:38:40 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-11-23 10:13:52 -0800
commita8f520188a19f722d4ae6dee6246d37cb46bb975 (patch)
treeb72107d23a56ffb4f682d4ae9f141261b0741bf9 /src/tests/eina/eina_test_iterator.c
parent6b26b3330e8fddf56c8a1105c7145b4c42e9f0ac (diff)
eina: add test for Eina_Iterator over pure C array.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7285
Diffstat (limited to '')
-rw-r--r--src/tests/eina/eina_test_iterator.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/eina/eina_test_iterator.c b/src/tests/eina/eina_test_iterator.c
index c60139e9e2..14650621ca 100644
--- a/src/tests/eina/eina_test_iterator.c
+++ b/src/tests/eina/eina_test_iterator.c
@@ -612,6 +612,23 @@ EFL_START_TEST(eina_iterator_rbtree_simple)
612} 612}
613EFL_END_TEST 613EFL_END_TEST
614 614
615EFL_START_TEST(eina_iterator_carray_length)
616{
617 int array[] = { 1, 4, 9, 16 };
618 Eina_Iterator *it;
619 int i;
620 int j = 1;
621
622 it = EINA_C_ARRAY_ITERATOR_NEW(array);
623 EINA_ITERATOR_FOREACH(it, i)
624 {
625 fail_if(i != j * j);
626 j++;
627 }
628 eina_iterator_free(it);
629}
630EFL_END_TEST
631
615void 632void
616eina_test_iterator(TCase *tc) 633eina_test_iterator(TCase *tc)
617{ 634{
@@ -623,4 +640,5 @@ eina_test_iterator(TCase *tc)
623 tcase_add_test(tc, eina_iterator_rbtree_simple); 640 tcase_add_test(tc, eina_iterator_rbtree_simple);
624 tcase_add_test(tc, eina_iterator_filter_simple); 641 tcase_add_test(tc, eina_iterator_filter_simple);
625 tcase_add_test(tc, eina_iterator_filter_free); 642 tcase_add_test(tc, eina_iterator_filter_free);
643 tcase_add_test(tc, eina_iterator_carray_length);
626} 644}