forked from enlightenment/efl
eina: add test case for eina list search function.
Summary: Added test case for eina_list_search_sorted function Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com> Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3290 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
c99d50e00b
commit
7fa841236b
|
@ -310,6 +310,7 @@ START_TEST(eina_test_sorted_insert)
|
|||
int i, count;
|
||||
Eina_List *l1, *l2, *itr;
|
||||
void *d;
|
||||
int *res, val = 2009;
|
||||
|
||||
eina_init();
|
||||
|
||||
|
@ -322,6 +323,12 @@ START_TEST(eina_test_sorted_insert)
|
|||
fail_if(l1 == NULL);
|
||||
fail_if(!eina_list_sorted_check(l1));
|
||||
|
||||
res = eina_list_search_sorted(l1, eina_int_cmp, &data[7]);
|
||||
fail_if(*res != 1664);
|
||||
|
||||
res = eina_list_search_sorted(l1, eina_int_cmp, &val);
|
||||
fail_if(res != NULL);
|
||||
|
||||
l2 = NULL;
|
||||
EINA_LIST_FOREACH(l1, itr, d)
|
||||
l2 = eina_list_sorted_insert(l2, eina_int_cmp, d);
|
||||
|
|
Loading…
Reference in New Issue