From fcad767085aa5deccaa908857daad23403b245f4 Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 18 May 2014 13:04:17 +0800 Subject: [PATCH] fix test_insert_route test --- tests/bench_str.csv | 11 +++++++++++ tests/check_tree.c | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/bench_str.csv b/tests/bench_str.csv index d4e7035..50d0976 100644 --- a/tests/bench_str.csv +++ b/tests/bench_str.csv @@ -144,3 +144,14 @@ 1400388944,10969249.80 1400388966,10116208.17 1400389005,6688733.32 +1400389070,11138537.72 +1400389087,10874695.29 +1400389125,10358558.63 +1400389184,10999293.17 +1400389215,10781509.38 +1400389227,10347289.13 +1400389233,10851573.79 +1400389241,10631550.45 +1400389267,10864289.97 +1400389287,11080291.51 +1400389343,11017300.69 diff --git a/tests/check_tree.c b/tests/check_tree.c index cde9d77..1ab4e76 100644 --- a/tests/check_tree.c +++ b/tests/check_tree.c @@ -258,15 +258,17 @@ START_TEST(test_insert_route) r2->request_method = METHOD_POST; match_entry * entry = match_entry_create("/blog/post"); + entry->request_method = METHOD_GET; node * n = r3_tree_create(2); r3_tree_insert_route(n, r1, &var1); r3_tree_insert_route(n, r2, &var2); node *m; - m = r3_tree_match(n , "/qux/bar/corge", strlen("/qux/bar/corge"), NULL); + m = r3_tree_match(n , "/blog/post", strlen("/blog/post"), entry); fail_if(m == NULL); + fail_if(m->endpoint == 0); condition *c = r3_node_match_condition(m, entry); fail_if(c == NULL); @@ -663,6 +665,7 @@ Suite* r3_suite (void) { tcase_add_test(tcase, test_compile_slug); tcase_add_test(tcase, test_compile); tcase_add_test(tcase, test_route_cmp); + tcase_add_test(tcase, test_insert_route); tcase_add_test(tcase, benchmark_str);