5 #include "eruntime/list.h"
7 static int t_list_init (void);
8 static int t_list_create (void);
10 typedef int (*test_case_func
) (void);
12 typedef struct _test_case_struct
20 /* {{{ static test_case_t list_tests[] = { ... } */
21 static test_case_t list_tests
[] =
25 "function list_init()",
30 "function list_create()",
44 for (i
= 0; list_tests
[i
].name
; ++i
)
46 printf("Testing %s...\n", list_tests
[i
].desc
);
48 ret
= list_tests
[i
].func();
49 if (ret
== EXIT_SUCCESS
)
52 fprintf(stderr
, "\n``` Test case '%s' failed.\n", list_tests
[i
].name
);
59 /* {{{ #define LIST_INIT_IS_SANE() */
60 #define LIST_INIT_IS_SANE(list) \
63 list_t *__list = (list); \
66 return EXIT_FAILURE; \
67 if (__list->head || __list->tail) \
68 return EXIT_FAILURE; \
73 /* {{{ static int t_list_init() */
79 if (list_init(&list
) < 0)
82 LIST_INIT_IS_SANE(&list
);
88 /* {{{ static int t_list_create() */
98 LIST_INIT_IS_SANE(list
);
105 * vim: ts=8 sw=8 noet fdm=marker tw=80