dbiterator_test.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * Copyright (C) 2011, 2012, 2016 Internet Systems Consortium, Inc. ("ISC")
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * This Source Code Form is subject to the terms of the Mozilla Public
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * License, v. 2.0. If a copy of the MPL was not distributed with this
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * file, You can obtain one at http://mozilla.org/MPL/2.0/.
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess/*! \file */
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * Helper functions
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess return (dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * Individual unit tests
cd9f05dfac570b44f26f531e01869e679c45401berikabele/* create: make sure we can create a dbiterator */
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess result = dns_test_loaddb(&db, dns_dbtype_cache, TEST_ORIGIN,
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess atf_tc_set_md_var(tc, "descr", "create a database iterator");
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess atf_tc_set_md_var(tc, "X-filename", "testdata/dbiterator/zone1.data");
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess atf_tc_set_md_var(tc, "descr", "create a database iterator (NSEC3)");
49038652341bbe660a629c860507622583f8fdf0kess atf_tc_set_md_var(tc, "X-filename", "testdata/dbiterator/zone2.data");
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess/* walk: walk a database */
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kessstatic void
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess int i = 0;
49038652341bbe660a629c860507622583f8fdf0kess result = dns_test_loaddb(&db, dns_dbtype_cache, TEST_ORIGIN,
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess ATF_CHECK_EQ(i, atoi(atf_tc_get_md_var(tc, "X-nodes")));
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess atf_tc_set_md_var(tc, "X-filename", "testdata/dbiterator/zone1.data");
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess atf_tc_set_md_var(tc, "X-filename", "testdata/dbiterator/zone2.data");
dns_fixedname_init(&f);
dns_test_end();
dns_test_end();
dns_test_end();
dns_test_end();
return (atf_no_error());