Archived
1
0
Fork 0

test/t_str-list.c: test export.

This commit is contained in:
Henrik Hautakoski 2011-01-30 13:28:19 +01:00
parent cb5eef43b2
commit 33ceeca315

View file

@ -140,6 +140,31 @@ void test_lookup() {
str_list_destroy(l);
}
void test_export() {
int i = 0;
char **export;
struct str_list *l = str_list_create();
export = str_list_export(l);
assert(export && *export == NULL);
free(export);
str_list_insert(l, "a");
str_list_insert(l, "b");
str_list_insert(l, "c");
export = str_list_export(l);
for(i=0; export[i]; i++);
assert(i == 3);
free(export);
str_list_clear_fn(l, NULL);
str_list_destroy(l);
}
int main() {
test_insert();
@ -150,6 +175,7 @@ int main() {
test_foreach();
test_has();
test_lookup();
test_export();
return 0;
}