diff --git a/gen_route_tests.rb b/gen_route_tests.rb new file mode 100644 index 0000000..fbf7a20 --- /dev/null +++ b/gen_route_tests.rb @@ -0,0 +1,76 @@ +#!/usr/bin/env ruby + +puts < +#include +#include +#include +#include "r3.h" +#include "r3_str.h" +#include "zmalloc.h" + +START_TEST (test_routes) +{ + node * n = r3_tree_create(10); + node * m = NULL; + +END + + +arr = ["foo", "bar", "baz", "qux", "quux", "corge", "grault", "garply"] +paths = arr.permutation(3).map { |a| "/#{a.join '/'}" } +paths.each_index do |idx| + path = paths.fetch(idx) + puts " char *data#{idx} = \"#{path}\";" + puts " r3_tree_insert_path(n, \"#{path}\", (void*) data#{idx});" +end + + + puts <data == data#{idx});" + puts " ck_assert(m->endpoint > 0);" +end + + + +puts <pattern = (char*) pattern; e->pattern_len = pattern_len; @@ -54,7 +54,7 @@ node * r3_edge_branch(edge *e, int dl) { // the suffix edge of the leaf new_child = r3_tree_create(3); s1_len = e->pattern_len - dl; - e1 = r3_edge_create(zstrndup(s1, s1_len), s1_len, new_child); + e1 = r3_edge_createl(zstrndup(s1, s1_len), s1_len, new_child); // Migrate the child edges to the new edge we just created. for ( int i = 0 ; i < e->child->edge_len ; i++ ) { diff --git a/src/node.c b/src/node.c index 4a7b126..c288c24 100644 --- a/src/node.c +++ b/src/node.c @@ -82,6 +82,11 @@ void r3_tree_free(node * tree) { tree = NULL; } + + +/** + * Connect two node objects, and create an edge object between them. + */ edge * r3_node_connectl(node * n, const char * pat, int len, int dupl, node *child) { // find the same sub-pattern, if it does not exist, create one edge * e; @@ -94,7 +99,7 @@ edge * r3_node_connectl(node * n, const char * pat, int len, int dupl, node *chi if (dupl) { pat = zstrndup(pat, len); } - e = r3_edge_create(pat, len, child); + e = r3_edge_createl(pat, len, child); CHECK_PTR(e); r3_node_append_edge(n, e); return e; @@ -118,10 +123,13 @@ void r3_node_append_edge(node *n, edge *e) { /** * Find the existing edge with specified pattern (include slug) + * + * if "pat" is a slug, we should compare with the specified pattern. */ edge * r3_node_find_edge(const node * n, const char * pat, int pat_len) { edge * e; - for (int i = 0 ; i < n->edge_len ; i++ ) { + int i; + for (i = 0 ; i < n->edge_len ; i++ ) { e = n->edges[i]; // there is a case: "{foo}" vs "{foo:xxx}", @@ -473,37 +481,90 @@ node * r3_tree_insert_pathl(node *tree, const char *path, int path_len, void * d /** - * Return the last inserted node. + * Find common prefix from the edges of the node. + * + * Some cases of the common prefix: + * + * 1. "/foo/{slug}" vs "/foo/bar" => common prefix = "/foo/" + * 2. "{slug}/hate" vs "{slug}/bar" => common prefix = "{slug}/" + * 2. "/z/{slug}/hate" vs "/z/{slog}/bar" => common prefix = "/z/" + * 3. "{slug:xxx}/hate" vs "{slug:yyy}/bar" => common prefix = "" + * 4. "aaa{slug:xxx}/hate" vs "aab{slug:yyy}/bar" => common prefix = "aa" + * 5. "/foo/{slug}/hate" vs "/fo{slug}/bar" => common prefix = "/fo" */ -node * r3_tree_insert_pathl_(node *tree, const char *path, int path_len, route * route, void * data, char **errstr) -{ - node * n = tree; - edge * e = NULL; - - /* length of common prefix */ - int prefix_len = 0; - for( int i = 0 ; i < n->edge_len ; i++ ) { +edge * r3_node_find_common_prefix(node *n, char *path, int path_len, int *prefix_len) { + int i = 0; + int prefix = 0; + edge *e = NULL; + for(i = 0 ; i < n->edge_len ; i++ ) { // ignore all edges with slug - if (n->edges[i]->has_slug) - continue; - - prefix_len = strndiff( (char*) path, n->edges[i]->pattern, n->edges[i]->pattern_len); - - // printf("prefix_len: %d %s vs %s\n", prefix_len, path, n->edges[i]->pattern ); + prefix = strndiff( (char*) path, n->edges[i]->pattern, n->edges[i]->pattern_len); // no common, consider insert a new edge - if ( prefix_len > 0 ) { + if ( prefix > 0 ) { e = n->edges[i]; break; } } - // branch the edge at correct position (avoid broken slugs) - const char *slug_s; - if ( (slug_s = inside_slug(path, path_len, ((char*) path + prefix_len), NULL)) != NULL ) { - prefix_len = slug_s - path; + // found common prefix edge + if (prefix > 0) { + r3_slug_t *slug; + int ret = 0; + char *p = NULL; + char *offset = NULL; + + offset = path; + p = path + prefix; + + slug = r3_slug_new(path, path_len); + + do { + ret = r3_slug_parse(slug, path, path_len, offset, NULL); + // found slug + if (ret == 1) { + // inside slug, backtrace to the begin of the slug + if ( p >= slug->begin && p <= slug->end ) { + prefix = slug->begin - path - 1; + break; + } else if ( p < slug->begin ) { + break; + } else if ( p >= slug->end && p < (path + path_len) ) { + offset = slug->end + 1; + prefix = p - path; + continue; + } else { + break; + } + } else { + break; + } + } while(ret == 1); } + *prefix_len = prefix; + return e; +} + + + + +/** + * Return the last inserted node. + */ +node * r3_tree_insert_pathl_(node *tree, const char *path, int path_len, route * route, void * data, char **errstr) +{ + node * n = tree; + + + // common edge + edge * e = NULL; + + + /* length of common prefix */ + int prefix_len = 0; + e = r3_node_find_common_prefix(tree, path, path_len, &prefix_len); + const char * subpath = path + prefix_len; const int subpath_len = path_len - prefix_len; diff --git a/src/slug.c b/src/slug.c index e729a9e..12cfd23 100644 --- a/src/slug.c +++ b/src/slug.c @@ -72,19 +72,17 @@ r3_slug_t * r3_slug_parse_next(r3_slug_t *s, char **errstr) { } */ -r3_slug_t * r3_slug_parse(char *needle, int needle_len, char *offset, char **errstr) { - r3_slug_t * s = r3_slug_new(needle, needle_len); - if (!s) { - return NULL; - } +int r3_slug_parse(r3_slug_t *s, char *needle, int needle_len, char *offset, char **errstr) { + s->path = needle; + s->path_len = needle_len; - if (!offset) { + if (offset == NULL) { offset = (char*) needle; // from the begining of the needle } // there is no slug if (!r3_path_contains_slug_char(offset)) { - return NULL; + return 0; } int cnt = 0; @@ -92,7 +90,6 @@ r3_slug_t * r3_slug_parse(char *needle, int needle_len, char *offset, char **err char * p = offset; while( (p-needle) < needle_len) { - // escape one character if (*p == '\\' ) { p++; p++; @@ -135,13 +132,14 @@ r3_slug_t * r3_slug_parse(char *needle, int needle_len, char *offset, char **err p++; }; - if (state > 0) { + if (state != 0) { if (errstr) { asprintf(errstr, "Incomplete slug pattern. PATH (%d): '%s', OFFSET: %ld, STATE: %d", needle_len, needle, p - needle, state); } - return NULL; + return -1; } - return s; + info("found slug\n"); + return 1; } diff --git a/src/slug.h b/src/slug.h index 7a44ea8..b42f6dd 100644 --- a/src/slug.h +++ b/src/slug.h @@ -43,7 +43,7 @@ r3_slug_t * r3_slug_new(char * path, int path_len); int r3_slug_check(r3_slug_t *s); -r3_slug_t * r3_slug_parse(char *needle, int needle_len, char *offset, char **errstr); +int r3_slug_parse(r3_slug_t *s, char *needle, int needle_len, char *offset, char **errstr); char * r3_slug_to_str(const r3_slug_t *s); diff --git a/tests/Makefile.am b/tests/Makefile.am index 8b3a270..4a96e3c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -21,6 +21,12 @@ check_slug_SOURCES = check_slug.c TESTS += check_tree check_tree_SOURCES = check_tree.c +TESTS += check_routes +check_routes_SOURCES = check_routes.c + +TESTS += check_str_array +check_str_array_SOURCES = check_str_array.c + if ENABLE_JSON TESTS += check_json diff --git a/tests/check_routes.c b/tests/check_routes.c new file mode 100644 index 0000000..60d6594 --- /dev/null +++ b/tests/check_routes.c @@ -0,0 +1,2062 @@ + +/** DO NOT MODIFY THIS FILE, THIS TEST FILE IS AUTO-GENERATED. **/ + +#include "config.h" +#include +#include +#include +#include +#include "r3.h" +#include "r3_str.h" +#include "zmalloc.h" + +START_TEST (test_routes) +{ + node * n = r3_tree_create(10); + node * m = NULL; + + char *data0 = "/foo/bar/baz"; + r3_tree_insert_path(n, "/foo/bar/baz", (void*) data0); + char *data1 = "/foo/bar/qux"; + r3_tree_insert_path(n, "/foo/bar/qux", (void*) data1); + char *data2 = "/foo/bar/quux"; + r3_tree_insert_path(n, "/foo/bar/quux", (void*) data2); + char *data3 = "/foo/bar/corge"; + r3_tree_insert_path(n, "/foo/bar/corge", (void*) data3); + char *data4 = "/foo/bar/grault"; + r3_tree_insert_path(n, "/foo/bar/grault", (void*) data4); + char *data5 = "/foo/bar/garply"; + r3_tree_insert_path(n, "/foo/bar/garply", (void*) data5); + char *data6 = "/foo/baz/bar"; + r3_tree_insert_path(n, "/foo/baz/bar", (void*) data6); + char *data7 = "/foo/baz/qux"; + r3_tree_insert_path(n, "/foo/baz/qux", (void*) data7); + char *data8 = "/foo/baz/quux"; + r3_tree_insert_path(n, "/foo/baz/quux", (void*) data8); + char *data9 = "/foo/baz/corge"; + r3_tree_insert_path(n, "/foo/baz/corge", (void*) data9); + char *data10 = "/foo/baz/grault"; + r3_tree_insert_path(n, "/foo/baz/grault", (void*) data10); + char *data11 = "/foo/baz/garply"; + r3_tree_insert_path(n, "/foo/baz/garply", (void*) data11); + char *data12 = "/foo/qux/bar"; + r3_tree_insert_path(n, "/foo/qux/bar", (void*) data12); + char *data13 = "/foo/qux/baz"; + r3_tree_insert_path(n, "/foo/qux/baz", (void*) data13); + char *data14 = "/foo/qux/quux"; + r3_tree_insert_path(n, "/foo/qux/quux", (void*) data14); + char *data15 = "/foo/qux/corge"; + r3_tree_insert_path(n, "/foo/qux/corge", (void*) data15); + char *data16 = "/foo/qux/grault"; + r3_tree_insert_path(n, "/foo/qux/grault", (void*) data16); + char *data17 = "/foo/qux/garply"; + r3_tree_insert_path(n, "/foo/qux/garply", (void*) data17); + char *data18 = "/foo/quux/bar"; + r3_tree_insert_path(n, "/foo/quux/bar", (void*) data18); + char *data19 = "/foo/quux/baz"; + r3_tree_insert_path(n, "/foo/quux/baz", (void*) data19); + char *data20 = "/foo/quux/qux"; + r3_tree_insert_path(n, "/foo/quux/qux", (void*) data20); + char *data21 = "/foo/quux/corge"; + r3_tree_insert_path(n, "/foo/quux/corge", (void*) data21); + char *data22 = "/foo/quux/grault"; + r3_tree_insert_path(n, "/foo/quux/grault", (void*) data22); + char *data23 = "/foo/quux/garply"; + r3_tree_insert_path(n, "/foo/quux/garply", (void*) data23); + char *data24 = "/foo/corge/bar"; + r3_tree_insert_path(n, "/foo/corge/bar", (void*) data24); + char *data25 = "/foo/corge/baz"; + r3_tree_insert_path(n, "/foo/corge/baz", (void*) data25); + char *data26 = "/foo/corge/qux"; + r3_tree_insert_path(n, "/foo/corge/qux", (void*) data26); + char *data27 = "/foo/corge/quux"; + r3_tree_insert_path(n, "/foo/corge/quux", (void*) data27); + char *data28 = "/foo/corge/grault"; + r3_tree_insert_path(n, "/foo/corge/grault", (void*) data28); + char *data29 = "/foo/corge/garply"; + r3_tree_insert_path(n, "/foo/corge/garply", (void*) data29); + char *data30 = "/foo/grault/bar"; + r3_tree_insert_path(n, "/foo/grault/bar", (void*) data30); + char *data31 = "/foo/grault/baz"; + r3_tree_insert_path(n, "/foo/grault/baz", (void*) data31); + char *data32 = "/foo/grault/qux"; + r3_tree_insert_path(n, "/foo/grault/qux", (void*) data32); + char *data33 = "/foo/grault/quux"; + r3_tree_insert_path(n, "/foo/grault/quux", (void*) data33); + char *data34 = "/foo/grault/corge"; + r3_tree_insert_path(n, "/foo/grault/corge", (void*) data34); + char *data35 = "/foo/grault/garply"; + r3_tree_insert_path(n, "/foo/grault/garply", (void*) data35); + char *data36 = "/foo/garply/bar"; + r3_tree_insert_path(n, "/foo/garply/bar", (void*) data36); + char *data37 = "/foo/garply/baz"; + r3_tree_insert_path(n, "/foo/garply/baz", (void*) data37); + char *data38 = "/foo/garply/qux"; + r3_tree_insert_path(n, "/foo/garply/qux", (void*) data38); + char *data39 = "/foo/garply/quux"; + r3_tree_insert_path(n, "/foo/garply/quux", (void*) data39); + char *data40 = "/foo/garply/corge"; + r3_tree_insert_path(n, "/foo/garply/corge", (void*) data40); + char *data41 = "/foo/garply/grault"; + r3_tree_insert_path(n, "/foo/garply/grault", (void*) data41); + char *data42 = "/bar/foo/baz"; + r3_tree_insert_path(n, "/bar/foo/baz", (void*) data42); + char *data43 = "/bar/foo/qux"; + r3_tree_insert_path(n, "/bar/foo/qux", (void*) data43); + char *data44 = "/bar/foo/quux"; + r3_tree_insert_path(n, "/bar/foo/quux", (void*) data44); + char *data45 = "/bar/foo/corge"; + r3_tree_insert_path(n, "/bar/foo/corge", (void*) data45); + char *data46 = "/bar/foo/grault"; + r3_tree_insert_path(n, "/bar/foo/grault", (void*) data46); + char *data47 = "/bar/foo/garply"; + r3_tree_insert_path(n, "/bar/foo/garply", (void*) data47); + char *data48 = "/bar/baz/foo"; + r3_tree_insert_path(n, "/bar/baz/foo", (void*) data48); + char *data49 = "/bar/baz/qux"; + r3_tree_insert_path(n, "/bar/baz/qux", (void*) data49); + char *data50 = "/bar/baz/quux"; + r3_tree_insert_path(n, "/bar/baz/quux", (void*) data50); + char *data51 = "/bar/baz/corge"; + r3_tree_insert_path(n, "/bar/baz/corge", (void*) data51); + char *data52 = "/bar/baz/grault"; + r3_tree_insert_path(n, "/bar/baz/grault", (void*) data52); + char *data53 = "/bar/baz/garply"; + r3_tree_insert_path(n, "/bar/baz/garply", (void*) data53); + char *data54 = "/bar/qux/foo"; + r3_tree_insert_path(n, "/bar/qux/foo", (void*) data54); + char *data55 = "/bar/qux/baz"; + r3_tree_insert_path(n, "/bar/qux/baz", (void*) data55); + char *data56 = "/bar/qux/quux"; + r3_tree_insert_path(n, "/bar/qux/quux", (void*) data56); + char *data57 = "/bar/qux/corge"; + r3_tree_insert_path(n, "/bar/qux/corge", (void*) data57); + char *data58 = "/bar/qux/grault"; + r3_tree_insert_path(n, "/bar/qux/grault", (void*) data58); + char *data59 = "/bar/qux/garply"; + r3_tree_insert_path(n, "/bar/qux/garply", (void*) data59); + char *data60 = "/bar/quux/foo"; + r3_tree_insert_path(n, "/bar/quux/foo", (void*) data60); + char *data61 = "/bar/quux/baz"; + r3_tree_insert_path(n, "/bar/quux/baz", (void*) data61); + char *data62 = "/bar/quux/qux"; + r3_tree_insert_path(n, "/bar/quux/qux", (void*) data62); + char *data63 = "/bar/quux/corge"; + r3_tree_insert_path(n, "/bar/quux/corge", (void*) data63); + char *data64 = "/bar/quux/grault"; + r3_tree_insert_path(n, "/bar/quux/grault", (void*) data64); + char *data65 = "/bar/quux/garply"; + r3_tree_insert_path(n, "/bar/quux/garply", (void*) data65); + char *data66 = "/bar/corge/foo"; + r3_tree_insert_path(n, "/bar/corge/foo", (void*) data66); + char *data67 = "/bar/corge/baz"; + r3_tree_insert_path(n, "/bar/corge/baz", (void*) data67); + char *data68 = "/bar/corge/qux"; + r3_tree_insert_path(n, "/bar/corge/qux", (void*) data68); + char *data69 = "/bar/corge/quux"; + r3_tree_insert_path(n, "/bar/corge/quux", (void*) data69); + char *data70 = "/bar/corge/grault"; + r3_tree_insert_path(n, "/bar/corge/grault", (void*) data70); + char *data71 = "/bar/corge/garply"; + r3_tree_insert_path(n, "/bar/corge/garply", (void*) data71); + char *data72 = "/bar/grault/foo"; + r3_tree_insert_path(n, "/bar/grault/foo", (void*) data72); + char *data73 = "/bar/grault/baz"; + r3_tree_insert_path(n, "/bar/grault/baz", (void*) data73); + char *data74 = "/bar/grault/qux"; + r3_tree_insert_path(n, "/bar/grault/qux", (void*) data74); + char *data75 = "/bar/grault/quux"; + r3_tree_insert_path(n, "/bar/grault/quux", (void*) data75); + char *data76 = "/bar/grault/corge"; + r3_tree_insert_path(n, "/bar/grault/corge", (void*) data76); + char *data77 = "/bar/grault/garply"; + r3_tree_insert_path(n, "/bar/grault/garply", (void*) data77); + char *data78 = "/bar/garply/foo"; + r3_tree_insert_path(n, "/bar/garply/foo", (void*) data78); + char *data79 = "/bar/garply/baz"; + r3_tree_insert_path(n, "/bar/garply/baz", (void*) data79); + char *data80 = "/bar/garply/qux"; + r3_tree_insert_path(n, "/bar/garply/qux", (void*) data80); + char *data81 = "/bar/garply/quux"; + r3_tree_insert_path(n, "/bar/garply/quux", (void*) data81); + char *data82 = "/bar/garply/corge"; + r3_tree_insert_path(n, "/bar/garply/corge", (void*) data82); + char *data83 = "/bar/garply/grault"; + r3_tree_insert_path(n, "/bar/garply/grault", (void*) data83); + char *data84 = "/baz/foo/bar"; + r3_tree_insert_path(n, "/baz/foo/bar", (void*) data84); + char *data85 = "/baz/foo/qux"; + r3_tree_insert_path(n, "/baz/foo/qux", (void*) data85); + char *data86 = "/baz/foo/quux"; + r3_tree_insert_path(n, "/baz/foo/quux", (void*) data86); + char *data87 = "/baz/foo/corge"; + r3_tree_insert_path(n, "/baz/foo/corge", (void*) data87); + char *data88 = "/baz/foo/grault"; + r3_tree_insert_path(n, "/baz/foo/grault", (void*) data88); + char *data89 = "/baz/foo/garply"; + r3_tree_insert_path(n, "/baz/foo/garply", (void*) data89); + char *data90 = "/baz/bar/foo"; + r3_tree_insert_path(n, "/baz/bar/foo", (void*) data90); + char *data91 = "/baz/bar/qux"; + r3_tree_insert_path(n, "/baz/bar/qux", (void*) data91); + char *data92 = "/baz/bar/quux"; + r3_tree_insert_path(n, "/baz/bar/quux", (void*) data92); + char *data93 = "/baz/bar/corge"; + r3_tree_insert_path(n, "/baz/bar/corge", (void*) data93); + char *data94 = "/baz/bar/grault"; + r3_tree_insert_path(n, "/baz/bar/grault", (void*) data94); + char *data95 = "/baz/bar/garply"; + r3_tree_insert_path(n, "/baz/bar/garply", (void*) data95); + char *data96 = "/baz/qux/foo"; + r3_tree_insert_path(n, "/baz/qux/foo", (void*) data96); + char *data97 = "/baz/qux/bar"; + r3_tree_insert_path(n, "/baz/qux/bar", (void*) data97); + char *data98 = "/baz/qux/quux"; + r3_tree_insert_path(n, "/baz/qux/quux", (void*) data98); + char *data99 = "/baz/qux/corge"; + r3_tree_insert_path(n, "/baz/qux/corge", (void*) data99); + char *data100 = "/baz/qux/grault"; + r3_tree_insert_path(n, "/baz/qux/grault", (void*) data100); + char *data101 = "/baz/qux/garply"; + r3_tree_insert_path(n, "/baz/qux/garply", (void*) data101); + char *data102 = "/baz/quux/foo"; + r3_tree_insert_path(n, "/baz/quux/foo", (void*) data102); + char *data103 = "/baz/quux/bar"; + r3_tree_insert_path(n, "/baz/quux/bar", (void*) data103); + char *data104 = "/baz/quux/qux"; + r3_tree_insert_path(n, "/baz/quux/qux", (void*) data104); + char *data105 = "/baz/quux/corge"; + r3_tree_insert_path(n, "/baz/quux/corge", (void*) data105); + char *data106 = "/baz/quux/grault"; + r3_tree_insert_path(n, "/baz/quux/grault", (void*) data106); + char *data107 = "/baz/quux/garply"; + r3_tree_insert_path(n, "/baz/quux/garply", (void*) data107); + char *data108 = "/baz/corge/foo"; + r3_tree_insert_path(n, "/baz/corge/foo", (void*) data108); + char *data109 = "/baz/corge/bar"; + r3_tree_insert_path(n, "/baz/corge/bar", (void*) data109); + char *data110 = "/baz/corge/qux"; + r3_tree_insert_path(n, "/baz/corge/qux", (void*) data110); + char *data111 = "/baz/corge/quux"; + r3_tree_insert_path(n, "/baz/corge/quux", (void*) data111); + char *data112 = "/baz/corge/grault"; + r3_tree_insert_path(n, "/baz/corge/grault", (void*) data112); + char *data113 = "/baz/corge/garply"; + r3_tree_insert_path(n, "/baz/corge/garply", (void*) data113); + char *data114 = "/baz/grault/foo"; + r3_tree_insert_path(n, "/baz/grault/foo", (void*) data114); + char *data115 = "/baz/grault/bar"; + r3_tree_insert_path(n, "/baz/grault/bar", (void*) data115); + char *data116 = "/baz/grault/qux"; + r3_tree_insert_path(n, "/baz/grault/qux", (void*) data116); + char *data117 = "/baz/grault/quux"; + r3_tree_insert_path(n, "/baz/grault/quux", (void*) data117); + char *data118 = "/baz/grault/corge"; + r3_tree_insert_path(n, "/baz/grault/corge", (void*) data118); + char *data119 = "/baz/grault/garply"; + r3_tree_insert_path(n, "/baz/grault/garply", (void*) data119); + char *data120 = "/baz/garply/foo"; + r3_tree_insert_path(n, "/baz/garply/foo", (void*) data120); + char *data121 = "/baz/garply/bar"; + r3_tree_insert_path(n, "/baz/garply/bar", (void*) data121); + char *data122 = "/baz/garply/qux"; + r3_tree_insert_path(n, "/baz/garply/qux", (void*) data122); + char *data123 = "/baz/garply/quux"; + r3_tree_insert_path(n, "/baz/garply/quux", (void*) data123); + char *data124 = "/baz/garply/corge"; + r3_tree_insert_path(n, "/baz/garply/corge", (void*) data124); + char *data125 = "/baz/garply/grault"; + r3_tree_insert_path(n, "/baz/garply/grault", (void*) data125); + char *data126 = "/qux/foo/bar"; + r3_tree_insert_path(n, "/qux/foo/bar", (void*) data126); + char *data127 = "/qux/foo/baz"; + r3_tree_insert_path(n, "/qux/foo/baz", (void*) data127); + char *data128 = "/qux/foo/quux"; + r3_tree_insert_path(n, "/qux/foo/quux", (void*) data128); + char *data129 = "/qux/foo/corge"; + r3_tree_insert_path(n, "/qux/foo/corge", (void*) data129); + char *data130 = "/qux/foo/grault"; + r3_tree_insert_path(n, "/qux/foo/grault", (void*) data130); + char *data131 = "/qux/foo/garply"; + r3_tree_insert_path(n, "/qux/foo/garply", (void*) data131); + char *data132 = "/qux/bar/foo"; + r3_tree_insert_path(n, "/qux/bar/foo", (void*) data132); + char *data133 = "/qux/bar/baz"; + r3_tree_insert_path(n, "/qux/bar/baz", (void*) data133); + char *data134 = "/qux/bar/quux"; + r3_tree_insert_path(n, "/qux/bar/quux", (void*) data134); + char *data135 = "/qux/bar/corge"; + r3_tree_insert_path(n, "/qux/bar/corge", (void*) data135); + char *data136 = "/qux/bar/grault"; + r3_tree_insert_path(n, "/qux/bar/grault", (void*) data136); + char *data137 = "/qux/bar/garply"; + r3_tree_insert_path(n, "/qux/bar/garply", (void*) data137); + char *data138 = "/qux/baz/foo"; + r3_tree_insert_path(n, "/qux/baz/foo", (void*) data138); + char *data139 = "/qux/baz/bar"; + r3_tree_insert_path(n, "/qux/baz/bar", (void*) data139); + char *data140 = "/qux/baz/quux"; + r3_tree_insert_path(n, "/qux/baz/quux", (void*) data140); + char *data141 = "/qux/baz/corge"; + r3_tree_insert_path(n, "/qux/baz/corge", (void*) data141); + char *data142 = "/qux/baz/grault"; + r3_tree_insert_path(n, "/qux/baz/grault", (void*) data142); + char *data143 = "/qux/baz/garply"; + r3_tree_insert_path(n, "/qux/baz/garply", (void*) data143); + char *data144 = "/qux/quux/foo"; + r3_tree_insert_path(n, "/qux/quux/foo", (void*) data144); + char *data145 = "/qux/quux/bar"; + r3_tree_insert_path(n, "/qux/quux/bar", (void*) data145); + char *data146 = "/qux/quux/baz"; + r3_tree_insert_path(n, "/qux/quux/baz", (void*) data146); + char *data147 = "/qux/quux/corge"; + r3_tree_insert_path(n, "/qux/quux/corge", (void*) data147); + char *data148 = "/qux/quux/grault"; + r3_tree_insert_path(n, "/qux/quux/grault", (void*) data148); + char *data149 = "/qux/quux/garply"; + r3_tree_insert_path(n, "/qux/quux/garply", (void*) data149); + char *data150 = "/qux/corge/foo"; + r3_tree_insert_path(n, "/qux/corge/foo", (void*) data150); + char *data151 = "/qux/corge/bar"; + r3_tree_insert_path(n, "/qux/corge/bar", (void*) data151); + char *data152 = "/qux/corge/baz"; + r3_tree_insert_path(n, "/qux/corge/baz", (void*) data152); + char *data153 = "/qux/corge/quux"; + r3_tree_insert_path(n, "/qux/corge/quux", (void*) data153); + char *data154 = "/qux/corge/grault"; + r3_tree_insert_path(n, "/qux/corge/grault", (void*) data154); + char *data155 = "/qux/corge/garply"; + r3_tree_insert_path(n, "/qux/corge/garply", (void*) data155); + char *data156 = "/qux/grault/foo"; + r3_tree_insert_path(n, "/qux/grault/foo", (void*) data156); + char *data157 = "/qux/grault/bar"; + r3_tree_insert_path(n, "/qux/grault/bar", (void*) data157); + char *data158 = "/qux/grault/baz"; + r3_tree_insert_path(n, "/qux/grault/baz", (void*) data158); + char *data159 = "/qux/grault/quux"; + r3_tree_insert_path(n, "/qux/grault/quux", (void*) data159); + char *data160 = "/qux/grault/corge"; + r3_tree_insert_path(n, "/qux/grault/corge", (void*) data160); + char *data161 = "/qux/grault/garply"; + r3_tree_insert_path(n, "/qux/grault/garply", (void*) data161); + char *data162 = "/qux/garply/foo"; + r3_tree_insert_path(n, "/qux/garply/foo", (void*) data162); + char *data163 = "/qux/garply/bar"; + r3_tree_insert_path(n, "/qux/garply/bar", (void*) data163); + char *data164 = "/qux/garply/baz"; + r3_tree_insert_path(n, "/qux/garply/baz", (void*) data164); + char *data165 = "/qux/garply/quux"; + r3_tree_insert_path(n, "/qux/garply/quux", (void*) data165); + char *data166 = "/qux/garply/corge"; + r3_tree_insert_path(n, "/qux/garply/corge", (void*) data166); + char *data167 = "/qux/garply/grault"; + r3_tree_insert_path(n, "/qux/garply/grault", (void*) data167); + char *data168 = "/quux/foo/bar"; + r3_tree_insert_path(n, "/quux/foo/bar", (void*) data168); + char *data169 = "/quux/foo/baz"; + r3_tree_insert_path(n, "/quux/foo/baz", (void*) data169); + char *data170 = "/quux/foo/qux"; + r3_tree_insert_path(n, "/quux/foo/qux", (void*) data170); + char *data171 = "/quux/foo/corge"; + r3_tree_insert_path(n, "/quux/foo/corge", (void*) data171); + char *data172 = "/quux/foo/grault"; + r3_tree_insert_path(n, "/quux/foo/grault", (void*) data172); + char *data173 = "/quux/foo/garply"; + r3_tree_insert_path(n, "/quux/foo/garply", (void*) data173); + char *data174 = "/quux/bar/foo"; + r3_tree_insert_path(n, "/quux/bar/foo", (void*) data174); + char *data175 = "/quux/bar/baz"; + r3_tree_insert_path(n, "/quux/bar/baz", (void*) data175); + char *data176 = "/quux/bar/qux"; + r3_tree_insert_path(n, "/quux/bar/qux", (void*) data176); + char *data177 = "/quux/bar/corge"; + r3_tree_insert_path(n, "/quux/bar/corge", (void*) data177); + char *data178 = "/quux/bar/grault"; + r3_tree_insert_path(n, "/quux/bar/grault", (void*) data178); + char *data179 = "/quux/bar/garply"; + r3_tree_insert_path(n, "/quux/bar/garply", (void*) data179); + char *data180 = "/quux/baz/foo"; + r3_tree_insert_path(n, "/quux/baz/foo", (void*) data180); + char *data181 = "/quux/baz/bar"; + r3_tree_insert_path(n, "/quux/baz/bar", (void*) data181); + char *data182 = "/quux/baz/qux"; + r3_tree_insert_path(n, "/quux/baz/qux", (void*) data182); + char *data183 = "/quux/baz/corge"; + r3_tree_insert_path(n, "/quux/baz/corge", (void*) data183); + char *data184 = "/quux/baz/grault"; + r3_tree_insert_path(n, "/quux/baz/grault", (void*) data184); + char *data185 = "/quux/baz/garply"; + r3_tree_insert_path(n, "/quux/baz/garply", (void*) data185); + char *data186 = "/quux/qux/foo"; + r3_tree_insert_path(n, "/quux/qux/foo", (void*) data186); + char *data187 = "/quux/qux/bar"; + r3_tree_insert_path(n, "/quux/qux/bar", (void*) data187); + char *data188 = "/quux/qux/baz"; + r3_tree_insert_path(n, "/quux/qux/baz", (void*) data188); + char *data189 = "/quux/qux/corge"; + r3_tree_insert_path(n, "/quux/qux/corge", (void*) data189); + char *data190 = "/quux/qux/grault"; + r3_tree_insert_path(n, "/quux/qux/grault", (void*) data190); + char *data191 = "/quux/qux/garply"; + r3_tree_insert_path(n, "/quux/qux/garply", (void*) data191); + char *data192 = "/quux/corge/foo"; + r3_tree_insert_path(n, "/quux/corge/foo", (void*) data192); + char *data193 = "/quux/corge/bar"; + r3_tree_insert_path(n, "/quux/corge/bar", (void*) data193); + char *data194 = "/quux/corge/baz"; + r3_tree_insert_path(n, "/quux/corge/baz", (void*) data194); + char *data195 = "/quux/corge/qux"; + r3_tree_insert_path(n, "/quux/corge/qux", (void*) data195); + char *data196 = "/quux/corge/grault"; + r3_tree_insert_path(n, "/quux/corge/grault", (void*) data196); + char *data197 = "/quux/corge/garply"; + r3_tree_insert_path(n, "/quux/corge/garply", (void*) data197); + char *data198 = "/quux/grault/foo"; + r3_tree_insert_path(n, "/quux/grault/foo", (void*) data198); + char *data199 = "/quux/grault/bar"; + r3_tree_insert_path(n, "/quux/grault/bar", (void*) data199); + char *data200 = "/quux/grault/baz"; + r3_tree_insert_path(n, "/quux/grault/baz", (void*) data200); + char *data201 = "/quux/grault/qux"; + r3_tree_insert_path(n, "/quux/grault/qux", (void*) data201); + char *data202 = "/quux/grault/corge"; + r3_tree_insert_path(n, "/quux/grault/corge", (void*) data202); + char *data203 = "/quux/grault/garply"; + r3_tree_insert_path(n, "/quux/grault/garply", (void*) data203); + char *data204 = "/quux/garply/foo"; + r3_tree_insert_path(n, "/quux/garply/foo", (void*) data204); + char *data205 = "/quux/garply/bar"; + r3_tree_insert_path(n, "/quux/garply/bar", (void*) data205); + char *data206 = "/quux/garply/baz"; + r3_tree_insert_path(n, "/quux/garply/baz", (void*) data206); + char *data207 = "/quux/garply/qux"; + r3_tree_insert_path(n, "/quux/garply/qux", (void*) data207); + char *data208 = "/quux/garply/corge"; + r3_tree_insert_path(n, "/quux/garply/corge", (void*) data208); + char *data209 = "/quux/garply/grault"; + r3_tree_insert_path(n, "/quux/garply/grault", (void*) data209); + char *data210 = "/corge/foo/bar"; + r3_tree_insert_path(n, "/corge/foo/bar", (void*) data210); + char *data211 = "/corge/foo/baz"; + r3_tree_insert_path(n, "/corge/foo/baz", (void*) data211); + char *data212 = "/corge/foo/qux"; + r3_tree_insert_path(n, "/corge/foo/qux", (void*) data212); + char *data213 = "/corge/foo/quux"; + r3_tree_insert_path(n, "/corge/foo/quux", (void*) data213); + char *data214 = "/corge/foo/grault"; + r3_tree_insert_path(n, "/corge/foo/grault", (void*) data214); + char *data215 = "/corge/foo/garply"; + r3_tree_insert_path(n, "/corge/foo/garply", (void*) data215); + char *data216 = "/corge/bar/foo"; + r3_tree_insert_path(n, "/corge/bar/foo", (void*) data216); + char *data217 = "/corge/bar/baz"; + r3_tree_insert_path(n, "/corge/bar/baz", (void*) data217); + char *data218 = "/corge/bar/qux"; + r3_tree_insert_path(n, "/corge/bar/qux", (void*) data218); + char *data219 = "/corge/bar/quux"; + r3_tree_insert_path(n, "/corge/bar/quux", (void*) data219); + char *data220 = "/corge/bar/grault"; + r3_tree_insert_path(n, "/corge/bar/grault", (void*) data220); + char *data221 = "/corge/bar/garply"; + r3_tree_insert_path(n, "/corge/bar/garply", (void*) data221); + char *data222 = "/corge/baz/foo"; + r3_tree_insert_path(n, "/corge/baz/foo", (void*) data222); + char *data223 = "/corge/baz/bar"; + r3_tree_insert_path(n, "/corge/baz/bar", (void*) data223); + char *data224 = "/corge/baz/qux"; + r3_tree_insert_path(n, "/corge/baz/qux", (void*) data224); + char *data225 = "/corge/baz/quux"; + r3_tree_insert_path(n, "/corge/baz/quux", (void*) data225); + char *data226 = "/corge/baz/grault"; + r3_tree_insert_path(n, "/corge/baz/grault", (void*) data226); + char *data227 = "/corge/baz/garply"; + r3_tree_insert_path(n, "/corge/baz/garply", (void*) data227); + char *data228 = "/corge/qux/foo"; + r3_tree_insert_path(n, "/corge/qux/foo", (void*) data228); + char *data229 = "/corge/qux/bar"; + r3_tree_insert_path(n, "/corge/qux/bar", (void*) data229); + char *data230 = "/corge/qux/baz"; + r3_tree_insert_path(n, "/corge/qux/baz", (void*) data230); + char *data231 = "/corge/qux/quux"; + r3_tree_insert_path(n, "/corge/qux/quux", (void*) data231); + char *data232 = "/corge/qux/grault"; + r3_tree_insert_path(n, "/corge/qux/grault", (void*) data232); + char *data233 = "/corge/qux/garply"; + r3_tree_insert_path(n, "/corge/qux/garply", (void*) data233); + char *data234 = "/corge/quux/foo"; + r3_tree_insert_path(n, "/corge/quux/foo", (void*) data234); + char *data235 = "/corge/quux/bar"; + r3_tree_insert_path(n, "/corge/quux/bar", (void*) data235); + char *data236 = "/corge/quux/baz"; + r3_tree_insert_path(n, "/corge/quux/baz", (void*) data236); + char *data237 = "/corge/quux/qux"; + r3_tree_insert_path(n, "/corge/quux/qux", (void*) data237); + char *data238 = "/corge/quux/grault"; + r3_tree_insert_path(n, "/corge/quux/grault", (void*) data238); + char *data239 = "/corge/quux/garply"; + r3_tree_insert_path(n, "/corge/quux/garply", (void*) data239); + char *data240 = "/corge/grault/foo"; + r3_tree_insert_path(n, "/corge/grault/foo", (void*) data240); + char *data241 = "/corge/grault/bar"; + r3_tree_insert_path(n, "/corge/grault/bar", (void*) data241); + char *data242 = "/corge/grault/baz"; + r3_tree_insert_path(n, "/corge/grault/baz", (void*) data242); + char *data243 = "/corge/grault/qux"; + r3_tree_insert_path(n, "/corge/grault/qux", (void*) data243); + char *data244 = "/corge/grault/quux"; + r3_tree_insert_path(n, "/corge/grault/quux", (void*) data244); + char *data245 = "/corge/grault/garply"; + r3_tree_insert_path(n, "/corge/grault/garply", (void*) data245); + char *data246 = "/corge/garply/foo"; + r3_tree_insert_path(n, "/corge/garply/foo", (void*) data246); + char *data247 = "/corge/garply/bar"; + r3_tree_insert_path(n, "/corge/garply/bar", (void*) data247); + char *data248 = "/corge/garply/baz"; + r3_tree_insert_path(n, "/corge/garply/baz", (void*) data248); + char *data249 = "/corge/garply/qux"; + r3_tree_insert_path(n, "/corge/garply/qux", (void*) data249); + char *data250 = "/corge/garply/quux"; + r3_tree_insert_path(n, "/corge/garply/quux", (void*) data250); + char *data251 = "/corge/garply/grault"; + r3_tree_insert_path(n, "/corge/garply/grault", (void*) data251); + char *data252 = "/grault/foo/bar"; + r3_tree_insert_path(n, "/grault/foo/bar", (void*) data252); + char *data253 = "/grault/foo/baz"; + r3_tree_insert_path(n, "/grault/foo/baz", (void*) data253); + char *data254 = "/grault/foo/qux"; + r3_tree_insert_path(n, "/grault/foo/qux", (void*) data254); + char *data255 = "/grault/foo/quux"; + r3_tree_insert_path(n, "/grault/foo/quux", (void*) data255); + char *data256 = "/grault/foo/corge"; + r3_tree_insert_path(n, "/grault/foo/corge", (void*) data256); + char *data257 = "/grault/foo/garply"; + r3_tree_insert_path(n, "/grault/foo/garply", (void*) data257); + char *data258 = "/grault/bar/foo"; + r3_tree_insert_path(n, "/grault/bar/foo", (void*) data258); + char *data259 = "/grault/bar/baz"; + r3_tree_insert_path(n, "/grault/bar/baz", (void*) data259); + char *data260 = "/grault/bar/qux"; + r3_tree_insert_path(n, "/grault/bar/qux", (void*) data260); + char *data261 = "/grault/bar/quux"; + r3_tree_insert_path(n, "/grault/bar/quux", (void*) data261); + char *data262 = "/grault/bar/corge"; + r3_tree_insert_path(n, "/grault/bar/corge", (void*) data262); + char *data263 = "/grault/bar/garply"; + r3_tree_insert_path(n, "/grault/bar/garply", (void*) data263); + char *data264 = "/grault/baz/foo"; + r3_tree_insert_path(n, "/grault/baz/foo", (void*) data264); + char *data265 = "/grault/baz/bar"; + r3_tree_insert_path(n, "/grault/baz/bar", (void*) data265); + char *data266 = "/grault/baz/qux"; + r3_tree_insert_path(n, "/grault/baz/qux", (void*) data266); + char *data267 = "/grault/baz/quux"; + r3_tree_insert_path(n, "/grault/baz/quux", (void*) data267); + char *data268 = "/grault/baz/corge"; + r3_tree_insert_path(n, "/grault/baz/corge", (void*) data268); + char *data269 = "/grault/baz/garply"; + r3_tree_insert_path(n, "/grault/baz/garply", (void*) data269); + char *data270 = "/grault/qux/foo"; + r3_tree_insert_path(n, "/grault/qux/foo", (void*) data270); + char *data271 = "/grault/qux/bar"; + r3_tree_insert_path(n, "/grault/qux/bar", (void*) data271); + char *data272 = "/grault/qux/baz"; + r3_tree_insert_path(n, "/grault/qux/baz", (void*) data272); + char *data273 = "/grault/qux/quux"; + r3_tree_insert_path(n, "/grault/qux/quux", (void*) data273); + char *data274 = "/grault/qux/corge"; + r3_tree_insert_path(n, "/grault/qux/corge", (void*) data274); + char *data275 = "/grault/qux/garply"; + r3_tree_insert_path(n, "/grault/qux/garply", (void*) data275); + char *data276 = "/grault/quux/foo"; + r3_tree_insert_path(n, "/grault/quux/foo", (void*) data276); + char *data277 = "/grault/quux/bar"; + r3_tree_insert_path(n, "/grault/quux/bar", (void*) data277); + char *data278 = "/grault/quux/baz"; + r3_tree_insert_path(n, "/grault/quux/baz", (void*) data278); + char *data279 = "/grault/quux/qux"; + r3_tree_insert_path(n, "/grault/quux/qux", (void*) data279); + char *data280 = "/grault/quux/corge"; + r3_tree_insert_path(n, "/grault/quux/corge", (void*) data280); + char *data281 = "/grault/quux/garply"; + r3_tree_insert_path(n, "/grault/quux/garply", (void*) data281); + char *data282 = "/grault/corge/foo"; + r3_tree_insert_path(n, "/grault/corge/foo", (void*) data282); + char *data283 = "/grault/corge/bar"; + r3_tree_insert_path(n, "/grault/corge/bar", (void*) data283); + char *data284 = "/grault/corge/baz"; + r3_tree_insert_path(n, "/grault/corge/baz", (void*) data284); + char *data285 = "/grault/corge/qux"; + r3_tree_insert_path(n, "/grault/corge/qux", (void*) data285); + char *data286 = "/grault/corge/quux"; + r3_tree_insert_path(n, "/grault/corge/quux", (void*) data286); + char *data287 = "/grault/corge/garply"; + r3_tree_insert_path(n, "/grault/corge/garply", (void*) data287); + char *data288 = "/grault/garply/foo"; + r3_tree_insert_path(n, "/grault/garply/foo", (void*) data288); + char *data289 = "/grault/garply/bar"; + r3_tree_insert_path(n, "/grault/garply/bar", (void*) data289); + char *data290 = "/grault/garply/baz"; + r3_tree_insert_path(n, "/grault/garply/baz", (void*) data290); + char *data291 = "/grault/garply/qux"; + r3_tree_insert_path(n, "/grault/garply/qux", (void*) data291); + char *data292 = "/grault/garply/quux"; + r3_tree_insert_path(n, "/grault/garply/quux", (void*) data292); + char *data293 = "/grault/garply/corge"; + r3_tree_insert_path(n, "/grault/garply/corge", (void*) data293); + char *data294 = "/garply/foo/bar"; + r3_tree_insert_path(n, "/garply/foo/bar", (void*) data294); + char *data295 = "/garply/foo/baz"; + r3_tree_insert_path(n, "/garply/foo/baz", (void*) data295); + char *data296 = "/garply/foo/qux"; + r3_tree_insert_path(n, "/garply/foo/qux", (void*) data296); + char *data297 = "/garply/foo/quux"; + r3_tree_insert_path(n, "/garply/foo/quux", (void*) data297); + char *data298 = "/garply/foo/corge"; + r3_tree_insert_path(n, "/garply/foo/corge", (void*) data298); + char *data299 = "/garply/foo/grault"; + r3_tree_insert_path(n, "/garply/foo/grault", (void*) data299); + char *data300 = "/garply/bar/foo"; + r3_tree_insert_path(n, "/garply/bar/foo", (void*) data300); + char *data301 = "/garply/bar/baz"; + r3_tree_insert_path(n, "/garply/bar/baz", (void*) data301); + char *data302 = "/garply/bar/qux"; + r3_tree_insert_path(n, "/garply/bar/qux", (void*) data302); + char *data303 = "/garply/bar/quux"; + r3_tree_insert_path(n, "/garply/bar/quux", (void*) data303); + char *data304 = "/garply/bar/corge"; + r3_tree_insert_path(n, "/garply/bar/corge", (void*) data304); + char *data305 = "/garply/bar/grault"; + r3_tree_insert_path(n, "/garply/bar/grault", (void*) data305); + char *data306 = "/garply/baz/foo"; + r3_tree_insert_path(n, "/garply/baz/foo", (void*) data306); + char *data307 = "/garply/baz/bar"; + r3_tree_insert_path(n, "/garply/baz/bar", (void*) data307); + char *data308 = "/garply/baz/qux"; + r3_tree_insert_path(n, "/garply/baz/qux", (void*) data308); + char *data309 = "/garply/baz/quux"; + r3_tree_insert_path(n, "/garply/baz/quux", (void*) data309); + char *data310 = "/garply/baz/corge"; + r3_tree_insert_path(n, "/garply/baz/corge", (void*) data310); + char *data311 = "/garply/baz/grault"; + r3_tree_insert_path(n, "/garply/baz/grault", (void*) data311); + char *data312 = "/garply/qux/foo"; + r3_tree_insert_path(n, "/garply/qux/foo", (void*) data312); + char *data313 = "/garply/qux/bar"; + r3_tree_insert_path(n, "/garply/qux/bar", (void*) data313); + char *data314 = "/garply/qux/baz"; + r3_tree_insert_path(n, "/garply/qux/baz", (void*) data314); + char *data315 = "/garply/qux/quux"; + r3_tree_insert_path(n, "/garply/qux/quux", (void*) data315); + char *data316 = "/garply/qux/corge"; + r3_tree_insert_path(n, "/garply/qux/corge", (void*) data316); + char *data317 = "/garply/qux/grault"; + r3_tree_insert_path(n, "/garply/qux/grault", (void*) data317); + char *data318 = "/garply/quux/foo"; + r3_tree_insert_path(n, "/garply/quux/foo", (void*) data318); + char *data319 = "/garply/quux/bar"; + r3_tree_insert_path(n, "/garply/quux/bar", (void*) data319); + char *data320 = "/garply/quux/baz"; + r3_tree_insert_path(n, "/garply/quux/baz", (void*) data320); + char *data321 = "/garply/quux/qux"; + r3_tree_insert_path(n, "/garply/quux/qux", (void*) data321); + char *data322 = "/garply/quux/corge"; + r3_tree_insert_path(n, "/garply/quux/corge", (void*) data322); + char *data323 = "/garply/quux/grault"; + r3_tree_insert_path(n, "/garply/quux/grault", (void*) data323); + char *data324 = "/garply/corge/foo"; + r3_tree_insert_path(n, "/garply/corge/foo", (void*) data324); + char *data325 = "/garply/corge/bar"; + r3_tree_insert_path(n, "/garply/corge/bar", (void*) data325); + char *data326 = "/garply/corge/baz"; + r3_tree_insert_path(n, "/garply/corge/baz", (void*) data326); + char *data327 = "/garply/corge/qux"; + r3_tree_insert_path(n, "/garply/corge/qux", (void*) data327); + char *data328 = "/garply/corge/quux"; + r3_tree_insert_path(n, "/garply/corge/quux", (void*) data328); + char *data329 = "/garply/corge/grault"; + r3_tree_insert_path(n, "/garply/corge/grault", (void*) data329); + char *data330 = "/garply/grault/foo"; + r3_tree_insert_path(n, "/garply/grault/foo", (void*) data330); + char *data331 = "/garply/grault/bar"; + r3_tree_insert_path(n, "/garply/grault/bar", (void*) data331); + char *data332 = "/garply/grault/baz"; + r3_tree_insert_path(n, "/garply/grault/baz", (void*) data332); + char *data333 = "/garply/grault/qux"; + r3_tree_insert_path(n, "/garply/grault/qux", (void*) data333); + char *data334 = "/garply/grault/quux"; + r3_tree_insert_path(n, "/garply/grault/quux", (void*) data334); + char *data335 = "/garply/grault/corge"; + r3_tree_insert_path(n, "/garply/grault/corge", (void*) data335); + char *err = NULL; + r3_tree_compile(n, &err); + ck_assert(err == NULL); + m = r3_tree_match(n, "/foo/bar/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data0); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/bar/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data1); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/bar/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data2); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/bar/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data3); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/bar/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data4); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/bar/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data5); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/baz/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data6); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/baz/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data7); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/baz/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data8); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/baz/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data9); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/baz/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data10); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/baz/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data11); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/qux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data12); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/qux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data13); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/qux/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data14); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/qux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data15); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/qux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data16); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/qux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data17); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/quux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data18); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/quux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data19); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/quux/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data20); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/quux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data21); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/quux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data22); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/quux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data23); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/corge/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data24); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/corge/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data25); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/corge/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data26); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/corge/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data27); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/corge/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data28); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/corge/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data29); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/grault/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data30); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/grault/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data31); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/grault/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data32); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/grault/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data33); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/grault/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data34); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/grault/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data35); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/garply/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data36); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/garply/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data37); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/garply/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data38); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/garply/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data39); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/garply/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data40); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/foo/garply/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data41); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/foo/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data42); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/foo/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data43); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/foo/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data44); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/foo/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data45); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/foo/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data46); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/foo/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data47); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/baz/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data48); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/baz/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data49); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/baz/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data50); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/baz/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data51); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/baz/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data52); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/baz/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data53); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/qux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data54); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/qux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data55); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/qux/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data56); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/qux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data57); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/qux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data58); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/qux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data59); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/quux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data60); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/quux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data61); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/quux/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data62); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/quux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data63); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/quux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data64); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/quux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data65); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/corge/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data66); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/corge/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data67); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/corge/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data68); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/corge/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data69); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/corge/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data70); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/corge/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data71); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/grault/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data72); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/grault/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data73); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/grault/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data74); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/grault/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data75); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/grault/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data76); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/grault/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data77); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/garply/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data78); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/garply/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data79); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/garply/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data80); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/garply/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data81); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/garply/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data82); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/bar/garply/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data83); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/foo/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data84); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/foo/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data85); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/foo/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data86); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/foo/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data87); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/foo/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data88); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/foo/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data89); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/bar/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data90); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/bar/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data91); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/bar/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data92); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/bar/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data93); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/bar/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data94); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/bar/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data95); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/qux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data96); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/qux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data97); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/qux/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data98); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/qux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data99); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/qux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data100); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/qux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data101); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/quux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data102); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/quux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data103); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/quux/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data104); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/quux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data105); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/quux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data106); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/quux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data107); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/corge/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data108); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/corge/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data109); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/corge/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data110); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/corge/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data111); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/corge/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data112); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/corge/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data113); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/grault/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data114); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/grault/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data115); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/grault/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data116); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/grault/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data117); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/grault/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data118); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/grault/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data119); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/garply/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data120); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/garply/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data121); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/garply/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data122); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/garply/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data123); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/garply/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data124); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/baz/garply/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data125); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/foo/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data126); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/foo/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data127); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/foo/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data128); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/foo/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data129); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/foo/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data130); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/foo/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data131); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/bar/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data132); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/bar/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data133); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/bar/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data134); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/bar/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data135); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/bar/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data136); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/bar/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data137); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/baz/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data138); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/baz/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data139); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/baz/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data140); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/baz/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data141); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/baz/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data142); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/baz/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data143); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/quux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data144); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/quux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data145); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/quux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data146); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/quux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data147); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/quux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data148); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/quux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data149); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/corge/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data150); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/corge/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data151); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/corge/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data152); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/corge/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data153); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/corge/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data154); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/corge/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data155); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/grault/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data156); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/grault/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data157); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/grault/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data158); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/grault/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data159); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/grault/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data160); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/grault/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data161); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/garply/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data162); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/garply/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data163); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/garply/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data164); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/garply/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data165); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/garply/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data166); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/qux/garply/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data167); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/foo/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data168); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/foo/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data169); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/foo/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data170); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/foo/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data171); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/foo/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data172); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/foo/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data173); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/bar/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data174); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/bar/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data175); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/bar/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data176); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/bar/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data177); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/bar/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data178); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/bar/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data179); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/baz/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data180); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/baz/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data181); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/baz/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data182); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/baz/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data183); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/baz/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data184); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/baz/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data185); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/qux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data186); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/qux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data187); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/qux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data188); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/qux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data189); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/qux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data190); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/qux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data191); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/corge/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data192); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/corge/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data193); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/corge/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data194); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/corge/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data195); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/corge/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data196); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/corge/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data197); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/grault/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data198); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/grault/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data199); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/grault/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data200); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/grault/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data201); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/grault/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data202); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/grault/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data203); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/garply/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data204); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/garply/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data205); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/garply/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data206); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/garply/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data207); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/garply/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data208); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/quux/garply/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data209); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/foo/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data210); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/foo/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data211); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/foo/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data212); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/foo/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data213); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/foo/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data214); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/foo/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data215); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/bar/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data216); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/bar/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data217); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/bar/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data218); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/bar/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data219); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/bar/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data220); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/bar/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data221); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/baz/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data222); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/baz/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data223); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/baz/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data224); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/baz/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data225); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/baz/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data226); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/baz/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data227); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/qux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data228); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/qux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data229); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/qux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data230); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/qux/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data231); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/qux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data232); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/qux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data233); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/quux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data234); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/quux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data235); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/quux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data236); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/quux/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data237); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/quux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data238); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/quux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data239); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/grault/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data240); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/grault/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data241); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/grault/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data242); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/grault/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data243); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/grault/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data244); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/grault/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data245); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/garply/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data246); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/garply/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data247); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/garply/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data248); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/garply/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data249); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/garply/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data250); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/corge/garply/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data251); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/foo/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data252); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/foo/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data253); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/foo/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data254); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/foo/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data255); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/foo/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data256); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/foo/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data257); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/bar/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data258); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/bar/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data259); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/bar/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data260); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/bar/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data261); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/bar/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data262); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/bar/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data263); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/baz/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data264); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/baz/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data265); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/baz/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data266); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/baz/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data267); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/baz/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data268); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/baz/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data269); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/qux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data270); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/qux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data271); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/qux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data272); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/qux/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data273); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/qux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data274); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/qux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data275); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/quux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data276); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/quux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data277); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/quux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data278); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/quux/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data279); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/quux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data280); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/quux/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data281); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/corge/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data282); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/corge/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data283); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/corge/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data284); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/corge/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data285); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/corge/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data286); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/corge/garply", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data287); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/garply/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data288); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/garply/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data289); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/garply/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data290); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/garply/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data291); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/garply/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data292); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/grault/garply/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data293); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/foo/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data294); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/foo/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data295); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/foo/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data296); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/foo/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data297); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/foo/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data298); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/foo/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data299); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/bar/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data300); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/bar/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data301); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/bar/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data302); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/bar/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data303); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/bar/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data304); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/bar/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data305); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/baz/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data306); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/baz/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data307); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/baz/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data308); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/baz/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data309); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/baz/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data310); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/baz/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data311); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/qux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data312); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/qux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data313); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/qux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data314); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/qux/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data315); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/qux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data316); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/qux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data317); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/quux/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data318); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/quux/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data319); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/quux/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data320); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/quux/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data321); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/quux/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data322); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/quux/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data323); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/corge/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data324); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/corge/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data325); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/corge/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data326); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/corge/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data327); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/corge/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data328); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/corge/grault", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data329); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/grault/foo", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data330); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/grault/bar", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data331); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/grault/baz", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data332); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/grault/qux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data333); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/grault/quux", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data334); + ck_assert(m->endpoint > 0); + m = r3_tree_match(n, "/garply/grault/corge", NULL); + ck_assert(m != NULL); + ck_assert(m->data == data335); + ck_assert(m->endpoint > 0); + + r3_tree_free(n); + +} +END_TEST + + + +Suite* r3_suite (void) { + Suite *suite = suite_create("r3 routes tests"); + TCase *tcase = tcase_create("testcase"); + tcase_add_test(tcase, test_routes); + suite_add_tcase(suite, tcase); + return suite; +} + +int main (int argc, char *argv[]) { + int number_failed; + Suite *suite = r3_suite(); + SRunner *runner = srunner_create(suite); + srunner_run_all(runner, CK_NORMAL); + number_failed = srunner_ntests_failed(runner); + srunner_free(runner); + return number_failed; +} + diff --git a/tests/check_slug.c b/tests/check_slug.c index 2107187..9b05a2e 100644 --- a/tests/check_slug.c +++ b/tests/check_slug.c @@ -96,19 +96,20 @@ START_TEST (test_incomplete_slug) END_TEST +/* START_TEST (test_slug_parse_with_pattern) { char * pattern = "/user/{name:\\d{3}}"; char * errstr = NULL; - r3_slug_t *s = r3_slug_parse(pattern, strlen(pattern), pattern, &errstr); - ck_assert(s); + r3_slug_t s; + int ret; + ret = r3_slug_parse(&s, pattern, strlen(pattern), pattern, &errstr); + ck_assert(ret); - char * out = r3_slug_to_str(s); + char * out = r3_slug_to_str(&s); ck_assert(out); printf("%s\n",out); free(out); - - r3_slug_free(s); } END_TEST @@ -117,7 +118,9 @@ START_TEST (test_slug_parse_without_pattern) { char * pattern = "/user/{name}"; char * errstr = NULL; - r3_slug_t *s = r3_slug_parse(pattern, strlen(pattern), pattern, &errstr); + r3_slug_t *s = r3_slug_new(pattern, strlen(pattern)); + int ret; + ret = r3_slug_parse(s, pattern, strlen(pattern), pattern, &errstr); ck_assert(s); char * out = r3_slug_to_str(s); @@ -128,6 +131,7 @@ START_TEST (test_slug_parse_without_pattern) r3_slug_free(s); } END_TEST +*/ @@ -177,8 +181,8 @@ Suite* r3_suite (void) { tcase_add_test(tcase, test_slug_compile); tcase_add_test(tcase, test_pattern_to_opcode); tcase_add_test(tcase, test_incomplete_slug); - tcase_add_test(tcase, test_slug_parse_with_pattern); - tcase_add_test(tcase, test_slug_parse_without_pattern); + // tcase_add_test(tcase, test_slug_parse_with_pattern); + // tcase_add_test(tcase, test_slug_parse_without_pattern); suite_add_tcase(suite, tcase); return suite; diff --git a/tests/check_str_array.c b/tests/check_str_array.c new file mode 100644 index 0000000..911591e --- /dev/null +++ b/tests/check_str_array.c @@ -0,0 +1,53 @@ +/* + * check_str_array.c + * Copyright (C) 2014 c9s + * + * Distributed under terms of the MIT license. + */ +#include "config.h" +#include +#include +#include +#include "r3.h" +#include "r3_str.h" +#include "zmalloc.h" + +START_TEST (test_str_array) +{ + str_array * l = str_array_create(3); + ck_assert(l); + + ck_assert(str_array_append(l, zstrdup("abc"))); + ck_assert( l->len == 1 ); + + ck_assert(str_array_append(l, zstrdup("foo") )); + ck_assert( l->len == 2 ); + + ck_assert( str_array_append(l, zstrdup("bar") ) ); + ck_assert( l->len == 3 ); + + ck_assert( str_array_append(l, zstrdup("zoo") ) ); + ck_assert( l->len == 4 ); + + ck_assert( str_array_resize(l, l->cap * 2) ); + str_array_free(l); +} +END_TEST + +Suite* r3_suite (void) { + Suite *suite = suite_create("str_array test"); + TCase *tcase = tcase_create("testcase"); + tcase_add_test(tcase, test_str_array); + suite_add_tcase(suite, tcase); + return suite; +} + +int main (int argc, char *argv[]) { + int number_failed; + Suite *suite = r3_suite(); + SRunner *runner = srunner_create(suite); + srunner_run_all(runner, CK_NORMAL); + number_failed = srunner_ntests_failed(runner); + srunner_free(runner); + return number_failed; +} diff --git a/tests/check_tree.c b/tests/check_tree.c index 5bb381a..beae505 100644 --- a/tests/check_tree.c +++ b/tests/check_tree.c @@ -10,6 +10,198 @@ +START_TEST (test_find_common_prefix) +{ + node * n = r3_tree_create(10); + edge * e = r3_edge_createl(zstrdup("/foo/{slug}"), sizeof("/foo/{slug}")-1, NULL); + r3_node_append_edge(n,e); + + int prefix_len; + edge *ret_edge = NULL; + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo", sizeof("/foo")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 4); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo/", sizeof("/foo/")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 5); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo/{slog}", sizeof("/foo/{slog}")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 5); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo/{bar}", sizeof("/foo/{bar}")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 5); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo/bar", sizeof("/foo/bar")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 5); + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/bar/", sizeof("/bar/")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 1); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "{bar}", sizeof("{bar}")-1, &prefix_len); + ck_assert(!ret_edge); + ck_assert_int_eq(prefix_len, 0); + + + r3_tree_free(n); +} +END_TEST + + + + + +START_TEST (test_find_common_prefix_after) +{ + node * n = r3_tree_create(10); + edge * e = r3_edge_createl(zstrdup("{slug}/foo"), sizeof("{slug}/foo")-1, NULL); + r3_node_append_edge(n,e); + + int prefix_len; + edge *ret_edge = NULL; + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo", sizeof("/foo")-1, &prefix_len); + ck_assert(ret_edge == NULL); + ck_assert_int_eq(prefix_len, 0); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "{slug}/bar", sizeof("{slug}/bar")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 7); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "{slug}/foo", sizeof("{slug}/foo")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 10); + + + r3_tree_free(n); +} +END_TEST + + + +START_TEST (test_find_common_prefix_double_middle) +{ + node * n = r3_tree_create(10); + edge * e = r3_edge_createl(zstrdup("{slug}/foo/{name}"), sizeof("{slug}/foo/{name}")-1, NULL); + r3_node_append_edge(n,e); + + int prefix_len; + edge *ret_edge = NULL; + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "{slug}/foo/{number}", sizeof("{slug}/foo/{number}")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 11); + + r3_tree_free(n); +} +END_TEST + + + +START_TEST (test_find_common_prefix_middle) +{ + node * n = r3_tree_create(10); + edge * e = r3_edge_createl(zstrdup("/foo/{slug}/hate"), sizeof("/foo/{slug}/hate")-1, NULL); + r3_node_append_edge(n,e); + + int prefix_len; + edge *ret_edge = NULL; + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo/{slug}/bar", sizeof("/foo/{slug}/bar")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 12); + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/fo/{slug}/bar", sizeof("/fo/{slug}/bar")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 3); + + r3_tree_free(n); +} +END_TEST + +START_TEST (test_find_common_prefix_same_pattern) +{ + node * n = r3_tree_create(10); + edge * e = r3_edge_createl(zstrdup("/foo/{slug:xxx}/hate"), sizeof("/foo/{slug:xxx}/hate")-1, NULL); + r3_node_append_edge(n,e); + + int prefix_len; + edge *ret_edge = NULL; + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo/{slug:yyy}/hate", sizeof("/foo/{slug:yyy}/hate")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 5); + + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "/foo/{slug}/hate", sizeof("/foo/{slug}/hate")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 5); + + r3_tree_free(n); +} +END_TEST + +START_TEST (test_find_common_prefix_same_pattern2) +{ + node * n = r3_tree_create(10); + edge * e = r3_edge_createl(zstrdup("{slug:xxx}/hate"), sizeof("{slug:xxx}/hate")-1, NULL); + r3_node_append_edge(n,e); + + int prefix_len; + edge *ret_edge = NULL; + + prefix_len = 0; + ret_edge = r3_node_find_common_prefix(n, "{slug:yyy}/hate", sizeof("{slug:yyy}/hate")-1, &prefix_len); + ck_assert(ret_edge); + ck_assert_int_eq(prefix_len, 0); + + r3_tree_free(n); +} +END_TEST + + + + + + + + + + + + + + + + START_TEST (test_ltrim_slash) { fail_if( strcmp( ltrim_slash("/blog") , "blog" ) != 0 ); @@ -17,7 +209,7 @@ START_TEST (test_ltrim_slash) } END_TEST -START_TEST (test_r3_node_construct_and_free) +START_TEST (test_node_construct_and_free) { node * n = r3_tree_create(10); node * another_tree = r3_tree_create(3); @@ -112,12 +304,17 @@ START_TEST (test_incomplete_slug_path) r3_tree_insert_path(n, "/post/{handle:\\d{3}}/{a}", NULL); ret_node = r3_tree_insert_path(n, "/users/{idx:\\d{3}}/{idy}", NULL); - assert(ret_node); + ck_assert(ret_node); // OK to insert, but should return error when compiling patterns - // FIXME: this one returns the inserted node object. - ret_node = r3_tree_insert_path(n, "/users/{idx:\\d{3}}/{idy:aaa}", NULL); - assert(ret_node); + node * ret_node2 = r3_tree_insert_path(n, "/users/{idx:\\d{3}}/{idy:aaa}", NULL); + ck_assert(ret_node2); + ck_assert(ret_node2 != ret_node); // make sure it's another node + + + char *errstr = NULL; + r3_tree_compile(n, &errstr); + ck_assert(errstr == NULL); // no error r3_tree_dump(n, NULL); @@ -243,32 +440,73 @@ END_TEST -START_TEST (testr3_tree_insert_pathl) +START_TEST (test_insert_pathl) { node * n = r3_tree_create(10); - r3_tree_insert_path(n, "/foo/bar", NULL); - // r3_tree_dump(n, 0); + node * ret; - r3_tree_insert_path(n, "/foo/zoo", NULL); - // r3_tree_dump(n, 0); + ret = r3_tree_insert_path(n, "/foo/bar", NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/foo/zoo", NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/foo/{id}", NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/foo/{number:\\d+}", NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/foo/{name:\\w+}", NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/foo/{name:\\d+}", NULL); + ck_assert(ret); - r3_tree_insert_path(n, "/f/id" , NULL); - // r3_tree_dump(n, 0); + ret = r3_tree_insert_path(n, "/foo/{name:\\d{5}}", NULL); + ck_assert(ret); - r3_tree_insert_path(n, "/post/{id}", NULL); - // r3_tree_dump(n, 0); + ret = r3_tree_insert_path(n, "/foo/{idx}/{idy}", NULL); + ck_assert(ret); - r3_tree_insert_path(n, "/post/{handle}", NULL); + ret = r3_tree_insert_path(n, "/foo/{idx}/{idh}", NULL); + ck_assert(ret); - r3_tree_insert_path(n, "/post/{handle}-{id}", NULL); + ret = r3_tree_insert_path(n, "/f/id" , NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/post/{id}", NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/post/{handle}", NULL); + ck_assert(ret); + ret = r3_tree_insert_path(n, "/post/{handle}-{id}", NULL); + ck_assert(ret); char * errstr = NULL; r3_tree_compile(n, &errstr); + ck_assert(errstr == NULL); + + r3_tree_dump(n, 0); + r3_tree_free(n); +} +END_TEST + + + +START_TEST (test_compile_fail) +{ + node * n = r3_tree_create(10); + + node * ret; + + ret = r3_tree_insert_path(n, "/foo/{idx}/{idy:)}", NULL); + ck_assert(ret); + + ret = r3_tree_insert_path(n, "/foo/{idx}/{idh:(}", NULL); + ck_assert(ret); + + char * errstr = NULL; + r3_tree_compile(n, &errstr); + ck_assert(errstr); + fprintf(stderr, "Compile failed: %s\n", errstr); + free(errstr); -#ifdef DEBUG r3_tree_dump(n, 0); -#endif r3_tree_free(n); } END_TEST @@ -277,28 +515,23 @@ END_TEST -START_TEST (test_str_array) -{ - str_array * l = str_array_create(3); - ck_assert(l); - ck_assert(str_array_append(l, zstrdup("abc"))); - ck_assert( l->len == 1 ); - ck_assert(str_array_append(l, zstrdup("foo") )); - ck_assert( l->len == 2 ); - fail_if( FALSE == str_array_append(l, zstrdup("bar") ) ); - fail_if( l->len != 3 ); - fail_if( FALSE == str_array_append(l, zstrdup("zoo") ) ); - fail_if( l->len != 4 ); - fail_if( FALSE == str_array_resize(l, l->cap * 2) ); - str_array_free(l); -} -END_TEST + + + + + + + + + + + START_TEST(test_route_cmp) { @@ -421,11 +654,18 @@ Suite* r3_suite (void) { Suite *suite = suite_create("r3 core tests"); TCase *tcase = tcase_create("testcase"); - tcase_add_test(tcase, test_r3_node_construct_and_free); - tcase_add_test(tcase, test_str_array); + + tcase_add_test(tcase, test_find_common_prefix); + tcase_add_test(tcase, test_find_common_prefix_after); + tcase_add_test(tcase, test_find_common_prefix_double_middle); + tcase_add_test(tcase, test_find_common_prefix_middle); + tcase_add_test(tcase, test_find_common_prefix_same_pattern); + tcase_add_test(tcase, test_find_common_prefix_same_pattern2); + tcase_add_test(tcase, test_insert_pathl); + tcase_add_test(tcase, test_node_construct_and_free); tcase_add_test(tcase, test_ltrim_slash); - tcase_add_test(tcase, testr3_tree_insert_pathl); tcase_add_test(tcase, test_compile); + tcase_add_test(tcase, test_compile_fail); tcase_add_test(tcase, test_route_cmp); tcase_add_test(tcase, test_insert_route); tcase_add_test(tcase, test_pcre_pattern_simple); @@ -434,7 +674,6 @@ Suite* r3_suite (void) { tcase_add_test(tcase, test_pcre_patterns_insert_2); tcase_add_test(tcase, test_pcre_patterns_insert_3); tcase_add_test(tcase, test_incomplete_slug_path); - suite_add_tcase(suite, tcase); return suite;