]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test check_predecessors with chain
authorMatthijs Mekking <matthijs@isc.org>
Tue, 14 May 2024 06:55:42 +0000 (08:55 +0200)
committerEvan Hunt <each@isc.org>
Tue, 14 May 2024 19:58:46 +0000 (12:58 -0700)
In addition to testing check_qpchain in combination with qpiter,
test check_predecessors in combination with a qpchain.

tests/dns/qp_test.c

index 32d855543d51edcd126f1e0adb647296846b7ca3..19ffc7f3d984148bf9396074b558e9e0bf238c6c 100644 (file)
@@ -628,7 +628,8 @@ struct check_predecessors {
 };
 
 static void
-check_predecessors(dns_qp_t *qp, struct check_predecessors check[]) {
+check_predecessors_withchain(dns_qp_t *qp, struct check_predecessors check[],
+                            dns_qpchain_t *chain) {
        isc_result_t result;
        dns_fixedname_t fn1, fn2;
        dns_name_t *name = dns_fixedname_initname(&fn1);
@@ -652,7 +653,7 @@ check_predecessors(dns_qp_t *qp, struct check_predecessors check[]) {
                result = dns_name_tostring(expred, &predstr, mctx);
                assert_int_equal(result, ISC_R_SUCCESS);
 
-               result = dns_qp_lookup(qp, name, NULL, &it, NULL, NULL, NULL);
+               result = dns_qp_lookup(qp, name, NULL, &it, chain, NULL, NULL);
 #if 0
                fprintf(stderr, "%s: expected %s got %s\n", check[i].query,
                        isc_result_totext(check[i].result),
@@ -711,6 +712,14 @@ check_predecessors(dns_qp_t *qp, struct check_predecessors check[]) {
        }
 }
 
+static void
+check_predecessors(dns_qp_t *qp, struct check_predecessors check[]) {
+       dns_qpchain_t chain;
+       dns_qpchain_init(qp, &chain);
+       check_predecessors_withchain(qp, check, NULL);
+       check_predecessors_withchain(qp, check, &chain);
+}
+
 ISC_RUN_TEST_IMPL(predecessors) {
        dns_qp_t *qp = NULL;
        const char insert[][16] = {