fix test_insert_route test
This commit is contained in:
parent
1632f9807e
commit
fcad767085
2 changed files with 15 additions and 1 deletions
|
@ -144,3 +144,14 @@
|
||||||
1400388944,10969249.80
|
1400388944,10969249.80
|
||||||
1400388966,10116208.17
|
1400388966,10116208.17
|
||||||
1400389005,6688733.32
|
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
|
||||||
|
|
|
|
@ -258,15 +258,17 @@ START_TEST(test_insert_route)
|
||||||
r2->request_method = METHOD_POST;
|
r2->request_method = METHOD_POST;
|
||||||
|
|
||||||
match_entry * entry = match_entry_create("/blog/post");
|
match_entry * entry = match_entry_create("/blog/post");
|
||||||
|
entry->request_method = METHOD_GET;
|
||||||
|
|
||||||
node * n = r3_tree_create(2);
|
node * n = r3_tree_create(2);
|
||||||
r3_tree_insert_route(n, r1, &var1);
|
r3_tree_insert_route(n, r1, &var1);
|
||||||
r3_tree_insert_route(n, r2, &var2);
|
r3_tree_insert_route(n, r2, &var2);
|
||||||
|
|
||||||
node *m;
|
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 == NULL);
|
||||||
|
fail_if(m->endpoint == 0);
|
||||||
condition *c = r3_node_match_condition(m, entry);
|
condition *c = r3_node_match_condition(m, entry);
|
||||||
fail_if(c == NULL);
|
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_slug);
|
||||||
tcase_add_test(tcase, test_compile);
|
tcase_add_test(tcase, test_compile);
|
||||||
tcase_add_test(tcase, test_route_cmp);
|
tcase_add_test(tcase, test_route_cmp);
|
||||||
|
tcase_add_test(tcase, test_insert_route);
|
||||||
|
|
||||||
tcase_add_test(tcase, benchmark_str);
|
tcase_add_test(tcase, benchmark_str);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue