{
bt_init(argc, argv);
- bt_test_case(t_mkmask, "u32_mkmask()");
- bt_test_case(t_masklen, "u32_masklen()");
- bt_test_case(t_log2, "u32_log2()");
+ bt_test_suite(t_mkmask, "u32_mkmask()");
+ bt_test_suite(t_masklen, "u32_masklen()");
+ bt_test_suite(t_log2, "u32_log2()");
return 0;
}
{
bt_init(argc, argv);
- bt_test_case(t_buffer_push, "Pushing new elements");
- bt_test_case(t_buffer_pop, "Fill whole buffer (PUSH), a half of elements POP and PUSH new elements");
- bt_test_case(t_buffer_resize, "Init a small buffer and try overfill");
- bt_test_case(t_buffer_flush, "Fill and flush all elements");
+ bt_test_suite(t_buffer_push, "Pushing new elements");
+ bt_test_suite(t_buffer_pop, "Fill whole buffer (PUSH), a half of elements POP and PUSH new elements");
+ bt_test_suite(t_buffer_resize, "Init a small buffer and try overfill");
+ bt_test_suite(t_buffer_flush, "Fill and flush all elements");
return 0;
}
{
bt_init(argc, argv);
- bt_test_case(t_calculate, "Checksum of pseudo-random data");
- bt_test_case(t_verify, "Verification of pseudo-random data.");
+ bt_test_suite(t_calculate, "Checksum of pseudo-random data");
+ bt_test_suite(t_verify, "Verification of pseudo-random data.");
return 0;
}
{
bt_init(argc, argv);
- bt_test_case(t_ev_run_list, "Schedule and run 3 events in right order.");
+ bt_test_suite(t_ev_run_list, "Schedule and run 3 events in right order.");
return 0;
}
{
bt_init(argc, argv);
- bt_test_case(t_insert_find, "HASH_INSERT and HASH_FIND");
- bt_test_case(t_insert_find_random, "HASH_INSERT pseudo-random keys and HASH_FIND");
- bt_test_case(t_insert2_find, "HASH_INSERT2 and HASH_FIND. HASH_INSERT2 is HASH_INSERT and a smart auto-resize function");
- bt_test_case(t_walk, "HASH_WALK");
- bt_test_case(t_walk_delsafe_delete, "HASH_WALK_DELSAFE and HASH_DELETE");
+ bt_test_suite(t_insert_find, "HASH_INSERT and HASH_FIND");
+ bt_test_suite(t_insert_find_random, "HASH_INSERT pseudo-random keys and HASH_FIND");
+ bt_test_suite(t_insert2_find, "HASH_INSERT2 and HASH_FIND. HASH_INSERT2 is HASH_INSERT and a smart auto-resize function");
+ bt_test_suite(t_walk, "HASH_WALK");
+ bt_test_suite(t_walk_delsafe_delete, "HASH_WALK_DELSAFE and HASH_DELETE");
//bt_test_case(t_walk_delsafe_delete2, "HASH_WALK_DELSAFE and HASH_DELETE2. HASH_DELETE2 is HASH_DELETE and smart auto-resize function");
- bt_test_case(t_walk_delsafe_remove, "HASH_WALK_DELSAFE and HASH_REMOVE");
+ bt_test_suite(t_walk_delsafe_remove, "HASH_WALK_DELSAFE and HASH_REMOVE");
//bt_test_case(t_walk_delsafe_remove2, "HASH_WALK_DELSAFE and HASH_REMOVE2. HASH_REMOVE2 is HASH_REMOVE and smart auto-resize function");
- bt_test_case(t_walk_filter, "HASH_WALK_FILTER");
+ bt_test_suite(t_walk_filter, "HASH_WALK_FILTER");
return 0;
}
{
bt_init(argc, argv);
- bt_test_case(t_heap_insert, "Inserting a descending sequence of numbers (the worst case)");
- bt_test_case(t_heap_insert_random, "Inserting pseudo-random numbers");
- bt_test_case(t_heap_increase_decrease, "Increasing/Decreasing");
- bt_test_case(t_heap_delete, "Deleting");
- bt_test_case(t_heap_0, "Is a heap[0] really unused?");
+ bt_test_suite(t_heap_insert, "Inserting a descending sequence of numbers (the worst case)");
+ bt_test_suite(t_heap_insert_random, "Inserting pseudo-random numbers");
+ bt_test_suite(t_heap_increase_decrease, "Increasing/Decreasing");
+ bt_test_suite(t_heap_delete, "Deleting");
+ bt_test_suite(t_heap_0, "Is a heap[0] really unused?");
return 0;
}
}
static u32
-ip4_pton_(char* s)
+ip4_pton_(char *s)
{
ip4_addr ip;
ip4_pton(s,&ip);
{
bt_init(argc, argv);
- bt_test_case(t_ip4_pton, "Converting IPv4 string to IPv4 ip4_addr struct");
+ bt_test_suite(t_ip4_pton, "Converting IPv4 string to ip4_addr struct");
return 0;
}
{
bt_init(argc, argv);
- bt_test_case(t_add_tail, "Adding nodes to tail of list");
- bt_test_case(t_add_head, "Adding nodes to head of list");
- bt_test_case(t_insert_node, "Inserting nodes to list");
- bt_test_case(t_remove_node, "Removing nodes from list");
- bt_test_case(t_replace_node, "Replacing nodes in list");
- bt_test_case(t_add_tail_list, "At the tail of a list adding the another list");
-
- return 0;
+ bt_test_suite(t_add_tail, "Adding nodes to tail of list");
+ bt_test_suite(t_add_head, "Adding nodes to head of list");
+ bt_test_suite(t_insert_node, "Inserting nodes to list");
+ bt_test_suite(t_remove_node, "Removing nodes from list");
+ bt_test_suite(t_replace_node, "Replacing nodes in list");
+ bt_test_suite(t_add_tail_list, "At the tail of a list adding the another list");
+
+ return bt_end();
}
{
bt_init(argc, argv);
- bt_test_case(t_md5, "Test Suite from RFC1321");
+ bt_test_suite(t_md5, "Test Suite from RFC1321");
return 0;
}
if (optind != argc)
goto usage;
-
if (do_core)
{
struct rlimit rl = {RLIM_INFINITY, RLIM_INFINITY};
}
void
-bt_test_case5(int (*test_fn)(void), const char *test_id, const char *dsc, int forked, int timeout)
+bt_test_suite5(int (*test_fn)(void), const char *test_id, const char *dsc, int forked, int timeout)
{
if (list_tests)
{
extern const char *bt_test_id;
void bt_init(int argc, char *argv[]);
-void bt_test_case5(int (*fn)(void), const char *id, const char *dsc, int forked, int timeout);
+void bt_test_suite5(int (*fn)(void), const char *id, const char *dsc, int forked, int timeout);
int bt_rand_num(void);
#define BT_SUCCESS 0
#define bt_test_case(fn,dsc) \
bt_test_case4(fn, dsc, BT_DEFAULT_FORKING, BT_DEFAULT_TIMEOUT)
-#define bt_test_case4(fn,dsc,f,t) \
- bt_test_case5(fn, #fn, dsc, f, t)
+#define bt_test_suite(fn,dsc) \
+ bt_test_suite4(fn, dsc, BT_DEFAULT_FORKING, BT_DEFAULT_TIMEOUT)
+
+#define bt_test_suite4(fn,dsc,f,t) \
+ bt_test_suite5(fn, #fn, dsc, f, t)
#define bt_log(format, ...) \
fprintf(stderr, "%s: " format "\n", bt_filename, ##__VA_ARGS__)