Skip to content

Commit

Permalink
Replace use of deprecated libcheck API fail_if()
Browse files Browse the repository at this point in the history
Fixes [-Wformat-extra-args] warnings when built using GCC,
See details in:
libcheck/check#298
  • Loading branch information
bjosv committed Sep 22, 2023
1 parent 8d59147 commit b8c5741
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/check_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,19 +714,19 @@ START_TEST(test_route_cmp)
R3Route *r1 = r3_node_append_route(n,test_str, strlen(test_str),0,0);
match_entry * m = match_entry_create("/blog/post");

fail_if( r3_route_cmp(r1, m) == -1, "should match");
ck_assert_msg(r3_route_cmp(r1, m) == 0, "should match");

r1->request_method = METHOD_GET;
m->request_method = METHOD_GET;
fail_if( r3_route_cmp(r1, m) == -1, "should match");
ck_assert_msg(r3_route_cmp(r1, m) == 0, "should match");

r1->request_method = METHOD_GET;
m->request_method = METHOD_POST;
fail_if( r3_route_cmp(r1, m) == 0, "should be different");
ck_assert_msg(r3_route_cmp(r1, m) == -1, "should be different");

r1->request_method = METHOD_GET;
m->request_method = METHOD_POST | METHOD_GET;
fail_if( r3_route_cmp(r1, m) == -1, "should match");
ck_assert_msg(r3_route_cmp(r1, m) == 0, "should match");

match_entry_free(m);
r3_tree_free(n);
Expand Down

0 comments on commit b8c5741

Please sign in to comment.