diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-27 16:30:27 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-27 16:30:27 +0000 |
commit | c478a22e917cd68b1adcab7022923479809d9cb0 (patch) | |
tree | 4841a898290678bcb3fa6be4f3796d5ec867d989 /test | |
parent | 02fdaeaf41359941559dd63e24805e78a9ee27e5 (diff) | |
download | libwapcaplet-c478a22e917cd68b1adcab7022923479809d9cb0.tar.gz libwapcaplet-c478a22e917cd68b1adcab7022923479809d9cb0.tar.bz2 |
Add simple iteration API and also add brackets in lwc_string_isequal
svn path=/trunk/libwapcaplet/; revision=10163
Diffstat (limited to 'test')
-rw-r--r-- | test/basictests.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/basictests.c b/test/basictests.c index 210b82c..cd1fa32 100644 --- a/test/basictests.c +++ b/test/basictests.c @@ -426,6 +426,22 @@ START_TEST (test_lwc_substring_is_nul_terminated) } END_TEST +static void +counting_cb(lwc_string *str, void *pw) +{ + UNUSED(str); + + *((int *)pw) += 1; +} + +START_TEST (test_lwc_string_iteration) +{ + int counter = 0; + lwc_iterate_strings(counting_cb, (void*)&counter); + fail_unless(counter == 4, "Incorrect string count"); +} +END_TEST + /**** And the suites are set up here ****/ void @@ -501,6 +517,7 @@ lwc_basic_suite(SRunner *sr) tcase_add_test(tc_basic, test_lwc_substring_is_nul_terminated); tcase_add_test(tc_basic, test_lwc_intern_substring_bad_size); tcase_add_test(tc_basic, test_lwc_intern_substring_bad_offset); + tcase_add_test(tc_basic, test_lwc_string_iteration); suite_add_tcase(s, tc_basic); srunner_add_suite(sr, s); |