diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/eina/src/tests/eina_test_list.c | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/eina/src/tests/eina_test_list.c')
-rw-r--r-- | libraries/eina/src/tests/eina_test_list.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libraries/eina/src/tests/eina_test_list.c b/libraries/eina/src/tests/eina_test_list.c index 6e08847..ce70d03 100644 --- a/libraries/eina/src/tests/eina_test_list.c +++ b/libraries/eina/src/tests/eina_test_list.c | |||
@@ -338,10 +338,50 @@ START_TEST(eina_test_sorted_insert) | |||
338 | } | 338 | } |
339 | END_TEST | 339 | END_TEST |
340 | 340 | ||
341 | START_TEST(eina_test_list_split) | ||
342 | { | ||
343 | Eina_List *left = NULL, *right = NULL ; | ||
344 | Eina_List *list = NULL; | ||
345 | Eina_List *l; | ||
346 | void *list_data; | ||
347 | int i; | ||
348 | |||
349 | eina_init(); | ||
350 | |||
351 | list = eina_list_append(list, "tigh"); | ||
352 | list = eina_list_append(list, "adar"); | ||
353 | list = eina_list_append(list, "baltar"); | ||
354 | list = eina_list_append(list, "roslin"); | ||
355 | list = eina_list_append(list, "baltar"); | ||
356 | list = eina_list_append(list, "roslin"); | ||
357 | list = eina_list_append(list, "baltar"); | ||
358 | list = eina_list_append(list, "roslin"); | ||
359 | |||
360 | fail_if(list == NULL); | ||
361 | fail_if(eina_list_count(list) != 8); | ||
362 | |||
363 | for ( i = 0; i < 200; i++) | ||
364 | { | ||
365 | left = eina_list_split_list(list, eina_list_nth_list(list, i % 2), &right); | ||
366 | |||
367 | if (i % 2 == 0) | ||
368 | fail_if(eina_list_count(left) == 1 && eina_list_count(right) + eina_list_count(left) == i + 7); | ||
369 | else | ||
370 | fail_if(eina_list_count(left) == 2 && eina_list_count(right) + eina_list_count(left) == i + 7); | ||
371 | |||
372 | list = eina_list_merge(left, right); | ||
373 | list = eina_list_append(list, "roslin"); | ||
374 | } | ||
375 | |||
376 | eina_shutdown(); | ||
377 | } | ||
378 | END_TEST | ||
379 | |||
341 | void | 380 | void |
342 | eina_test_list(TCase *tc) | 381 | eina_test_list(TCase *tc) |
343 | { | 382 | { |
344 | tcase_add_test(tc, eina_test_simple); | 383 | tcase_add_test(tc, eina_test_simple); |
345 | tcase_add_test(tc, eina_test_merge); | 384 | tcase_add_test(tc, eina_test_merge); |
346 | tcase_add_test(tc, eina_test_sorted_insert); | 385 | tcase_add_test(tc, eina_test_sorted_insert); |
386 | tcase_add_test(tc, eina_test_list_split); | ||
347 | } | 387 | } |