2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Replace custom isc_boolean_t with C standard bool type

This commit is contained in:
Ondřej Surý
2018-04-17 08:29:14 -07:00
parent cb6a185c69
commit 994e656977
546 changed files with 10785 additions and 10367 deletions

View File

@@ -16,6 +16,7 @@
#include <atf-c.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
@@ -44,7 +45,7 @@
#define TEST_ORIGIN "test"
static dns_masterrawheader_t header;
static isc_boolean_t headerset;
static bool headerset;
dns_name_t dns_origin;
char origin[sizeof(TEST_ORIGIN)];
@@ -64,7 +65,7 @@ add_callback(void *arg, const dns_name_t *owner, dns_rdataset_t *dataset) {
UNUSED(arg);
isc_buffer_init(&target, buf, BIGBUFLEN);
result = dns_rdataset_totext(dataset, owner, ISC_FALSE, ISC_FALSE,
result = dns_rdataset_totext(dataset, owner, false, false,
&target);
return(result);
}
@@ -73,7 +74,7 @@ static void
rawdata_callback(dns_zone_t *zone, dns_masterrawheader_t *h) {
UNUSED(zone);
header = *h;
headerset = ISC_TRUE;
headerset = true;
}
static isc_result_t
@@ -107,7 +108,7 @@ setup_master(void (*warn)(struct dns_rdatacallbacks *, const char *, ...),
callbacks.warn = warn;
if (error != NULL)
callbacks.error = error;
headerset = ISC_FALSE;
headerset = false;
return (result);
}
@@ -123,7 +124,7 @@ test_master(const char *testfile, dns_masterformat_t format,
return(result);
result = dns_master_loadfile(testfile, &dns_origin, &dns_origin,
dns_rdataclass_in, ISC_TRUE, 0,
dns_rdataclass_in, true, 0,
&callbacks, NULL, NULL, mctx, format, 0);
return (result);
}
@@ -149,7 +150,7 @@ ATF_TC_BODY(load, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master1.data",
@@ -172,7 +173,7 @@ ATF_TC_BODY(unexpected, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master2.data",
@@ -195,7 +196,7 @@ ATF_TC_BODY(noowner, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master3.data",
@@ -219,7 +220,7 @@ ATF_TC_BODY(nottl, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master4.data",
@@ -242,7 +243,7 @@ ATF_TC_BODY(badclass, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master5.data",
@@ -263,7 +264,7 @@ ATF_TC_BODY(toobig, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master15.data",
@@ -285,7 +286,7 @@ ATF_TC_BODY(maxrdata, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master16.data",
@@ -306,7 +307,7 @@ ATF_TC_BODY(dnskey, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master6.data",
@@ -328,7 +329,7 @@ ATF_TC_BODY(dnsnokey, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master7.data",
@@ -349,7 +350,7 @@ ATF_TC_BODY(include, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master8.data",
@@ -371,7 +372,7 @@ ATF_TC_BODY(master_includelist, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = setup_master(NULL, NULL);
@@ -379,7 +380,7 @@ ATF_TC_BODY(master_includelist, tc) {
result = dns_master_loadfile("testdata/master/master8.data",
&dns_origin, &dns_origin,
dns_rdataclass_in, 0, ISC_TRUE,
dns_rdataclass_in, 0, true,
&callbacks, include_callback,
&filename, mctx, dns_masterformat_text, 0);
ATF_CHECK_EQ(result, DNS_R_SEENINCLUDE);
@@ -403,7 +404,7 @@ ATF_TC_BODY(includefail, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master9.data",
@@ -425,7 +426,7 @@ ATF_TC_BODY(blanklines, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master10.data",
@@ -446,7 +447,7 @@ ATF_TC_BODY(leadingzero, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = test_master("testdata/master/master11.data",
@@ -469,7 +470,7 @@ ATF_TC_BODY(totext, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
/* First, test with an empty rdataset */
@@ -509,7 +510,7 @@ ATF_TC_BODY(loadraw, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
/* Raw format version 0 */
@@ -566,7 +567,7 @@ ATF_TC_BODY(dumpraw, tc) {
0, &target);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_db_create(mctx, "rbt", &dnsorigin, dns_dbtype_zone,
@@ -606,13 +607,13 @@ ATF_TC_BODY(dumpraw, tc) {
ATF_CHECK_EQ(header.sourceserial, 12345);
unlink("test.dump");
dns_db_closeversion(db, &version, ISC_FALSE);
dns_db_closeversion(db, &version, false);
dns_db_detach(&db);
dns_test_end();
}
static const char *warn_expect_value;
static isc_boolean_t warn_expect_result;
static bool warn_expect_result;
static void
warn_expect(struct dns_rdatacallbacks *mycallbacks, const char *fmt, ...) {
@@ -625,7 +626,7 @@ warn_expect(struct dns_rdatacallbacks *mycallbacks, const char *fmt, ...) {
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
if (warn_expect_value != NULL && strstr(buf, warn_expect_value) != NULL)
warn_expect_result = ISC_TRUE;
warn_expect_result = true;
}
/* Origin change test */
@@ -640,11 +641,11 @@ ATF_TC_BODY(neworigin, tc) {
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
result = dns_test_begin(NULL, false);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
warn_expect_value = "record with inherited owner";
warn_expect_result = ISC_FALSE;
warn_expect_result = false;
result = test_master("testdata/master/master17.data",
dns_masterformat_text, warn_expect, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);