Lines Matching refs:tree
39 auto tree = std::make_unique<tls::CertLookupTree>();
56 tree->add_cert(hostnames[idx], idx);
59 tree->dump();
61 CU_ASSERT(0 == tree->lookup(hostnames[0]));
62 CU_ASSERT(1 == tree->lookup(hostnames[1]));
63 CU_ASSERT(2 == tree->lookup(StringRef::from_lit("2www.example.org")));
64 CU_ASSERT(-1 == tree->lookup(StringRef::from_lit("www2.example.org")));
65 CU_ASSERT(3 == tree->lookup(StringRef::from_lit("xy1.host.domain")));
68 CU_ASSERT(-1 == tree->lookup(StringRef::from_lit("yy.host.domain")));
69 CU_ASSERT(4 == tree->lookup(StringRef::from_lit("xyy.host.domain")));
70 CU_ASSERT(-1 == tree->lookup(StringRef{}));
71 CU_ASSERT(5 == tree->lookup(hostnames[5]));
72 CU_ASSERT(6 == tree->lookup(hostnames[6]));
75 CU_ASSERT(-1 == tree->lookup(StringRef{h6 + i, str_size(h6) - i}));
77 CU_ASSERT(8 == tree->lookup(StringRef::from_lit("x.foo.bar")));
78 CU_ASSERT(9 == tree->lookup(hostnames[9]));
88 tree = std::make_unique<tls::CertLookupTree>();
90 tree->add_cert(names[idx], idx);
93 CU_ASSERT((ssize_t)i == tree->lookup(names[i]));
144 tls::CertLookupTree tree;
147 rv = tls::cert_lookup_tree_add_ssl_ctx(&tree, indexed_ssl_ctx,
152 rv = tls::cert_lookup_tree_add_ssl_ctx(&tree, indexed_ssl_ctx,
157 CU_ASSERT(-1 == tree.lookup(StringRef::from_lit("not-used.nghttp2.org")));
158 CU_ASSERT(0 == tree.lookup(StringRef::from_lit("test.nghttp2.org")));
159 CU_ASSERT(1 == tree.lookup(StringRef::from_lit("w.test.nghttp2.org")));
160 CU_ASSERT(2 == tree.lookup(StringRef::from_lit("www.test.nghttp2.org")));
161 CU_ASSERT(3 == tree.lookup(StringRef::from_lit("test.example.com")));