diff options
-rw-r--r-- | filter/filter_test.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/filter/filter_test.c b/filter/filter_test.c index 3abe095b..7adc480f 100644 --- a/filter/filter_test.c +++ b/filter/filter_test.c @@ -49,12 +49,6 @@ run_function(const void *arg) if (t->cmp) return t->result == f_same(t->fn, t->cmp); - if (!f_same(t->fn, t->fn)) { - bt_result = bt_suite_result = 0; - bt_log_suite_case_result(0, "The function doesn't compare to itself as the same"); - return 0; - } - linpool *tmp = lp_new_default(&root_pool); enum filter_return fret = f_eval(t->fn, tmp, NULL); rfree(tmp); @@ -81,23 +75,29 @@ int main(int argc, char *argv[]) { bt_init(argc, argv); + bt_bird_init(); bt_assert_hook = bt_assert_filter; struct config *c = NULL; struct parse_config_file_arg pcfa = { .cp = &c, .filename = BT_CONFIG_FILE }; + bt_test_suite_base(parse_config_file, "conf", (const void *) &pcfa, 0, 0, "parse config file"); + bt_assert(c); + bt_test_suite_base(parse_config_file, "reconf", (const void *) &pcfa, 0, 0, "reconfigure with the same file"); + bt_assert(c); - bt_bird_cleanup(); + struct symbol *s; + WALK_LIST(s, c->symbols) + if ((s->class == SYM_FUNCTION) || (s->class == SYM_FILTER)) + bt_assert_msg((s->flags & SYM_FLAG_SAME), "Symbol %s same check", s->name); - if (c) - { - struct f_bt_test_suite *t; - WALK_LIST(t, c->tests) - bt_test_suite_base(run_function, t->fn_name, t, BT_FORKING, BT_TIMEOUT, "%s", t->dsc); - } + struct f_bt_test_suite *t; + WALK_LIST(t, c->tests) + bt_test_suite_base(run_function, t->fn_name, t, BT_FORKING, BT_TIMEOUT, "%s", t->dsc); + bt_bird_cleanup(); return bt_exit_value(); } |