fix test_insert_route test

This commit is contained in:
c9s 2014-05-18 13:04:17 +08:00
parent 1632f9807e
commit fcad767085
2 changed files with 15 additions and 1 deletions

View file

@ -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

1 1400242718 5649455.80
144 1400388944 10969249.80
145 1400388966 10116208.17
146 1400389005 6688733.32
147 1400389070 11138537.72
148 1400389087 10874695.29
149 1400389125 10358558.63
150 1400389184 10999293.17
151 1400389215 10781509.38
152 1400389227 10347289.13
153 1400389233 10851573.79
154 1400389241 10631550.45
155 1400389267 10864289.97
156 1400389287 11080291.51
157 1400389343 11017300.69

View file

@ -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);