summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorsub.mohanty@samsung.com <sub.mohanty@samsung.com>2019-08-26 08:06:51 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-08-26 08:31:08 -0400
commit5bd95c9850df0fa914dde04761065515b9d3f7e4 (patch)
tree1fffb3ff4e1cf24361f16db00333d068c86b85bb /src/tests
parentc6b52d4f09841e24f03150c457705ffe57b320db (diff)
eina/array: added eina_array_find() api to eina_array.
Summary: updated test suite for testing the api. Reviewers: zmike, Hermet, cedric, segfaultxavi Reviewed By: zmike, segfaultxavi Subscribers: segfaultxavi, ProhtMeyhet, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9734
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/eina/eina_test_array.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/tests/eina/eina_test_array.c b/src/tests/eina/eina_test_array.c
index c8c9764a5f..fbe7966af0 100644
--- a/src/tests/eina/eina_test_array.c
+++ b/src/tests/eina/eina_test_array.c
@@ -174,10 +174,39 @@ EFL_START_TEST(eina_array_remove_stuff)
174} 174}
175EFL_END_TEST 175EFL_END_TEST
176 176
177EFL_START_TEST(eina_array_find_test)
178{
179 Eina_Array sea;
180 unsigned int i;
181 unsigned int out = 0;
182
183 fail_if(eina_array_find(NULL, (void*)1, NULL) != EINA_FALSE);
184
185 eina_array_step_set(&sea, sizeof(sea), 5);
186
187 for (i =1 ; i < 10 ; i++)
188 eina_array_push(&sea, (void*)i);
189
190 fail_if(eina_array_find(&sea, (void*)15, NULL) != EINA_FALSE);
191
192 fail_if(eina_array_find(&sea, (void*)5, NULL) != EINA_TRUE);
193 fail_if(eina_array_find(&sea, (void*)6, &out) != EINA_TRUE);
194 fail_if(out != 5);
195
196 eina_array_data_set(&sea, 7, (void*)99);
197 fail_if(eina_array_find(&sea, (void*)99, &out) != EINA_TRUE);
198 fail_if(out != 7);
199
200 eina_array_flush(&sea);
201
202 }
203
204EFL_END_TEST
177void 205void
178eina_test_array(TCase *tc) 206eina_test_array(TCase *tc)
179{ 207{
180 tcase_add_test(tc, eina_array_simple); 208 tcase_add_test(tc, eina_array_simple);
181 tcase_add_test(tc, eina_array_static); 209 tcase_add_test(tc, eina_array_static);
182 tcase_add_test(tc, eina_array_remove_stuff); 210 tcase_add_test(tc, eina_array_remove_stuff);
211 tcase_add_test(tc, eina_array_find_test);
183} 212}