3 #include "ausearch-string.h"
12 snode *cur = slist_get_cur(&s);
15 printf("%s\n", cur->str);
17 } while (slist_next(&s));
27 slist_add_if_uniq(&s, "test1");
28 slist_add_if_uniq(&s, "test2");
30 slist_add_if_uniq(&s, "test3");
33 if (s.cnt != 3 || rc !=3) {
34 puts("test count is wrong");
38 n.str = strdup("test4");
42 puts("should add a #4");
44 if (s.cnt != 4 || rc != 4) {
45 puts("test count is wrong");
49 slist_add_if_uniq(&s, "test2");
50 puts("should be same");
52 if (s.cnt != 4 || rc != 4) {
53 puts("test count is wrong");
58 puts("should be empty");
60 if (s.cnt != 0 || rc != 0) {
61 puts("test count is wrong");