]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
wrap ns_client_error() for unit testing
authorEvan Hunt <each@isc.org>
Wed, 26 Feb 2025 00:23:14 +0000 (16:23 -0800)
committerEvan Hunt <each@isc.org>
Wed, 26 Feb 2025 00:23:14 +0000 (16:23 -0800)
When testing, the client object doesn't have a proper
netmgr handle, so ns_client_error() needs to be a no-op.

(cherry picked from commit ae37ef45ff45db4919842ad29d3f8dfe0c77c76c)

tests/ns/Makefile.am
tests/ns/netmgr_wrap.c [new file with mode: 0644]

index 33f91d8c7bcc51197cdc95548528ef90f20c6a12..81e36629e40450757c816a888167c19ce923f2a7 100644 (file)
@@ -20,6 +20,10 @@ check_PROGRAMS =             \
        plugin_test             \
        query_test
 
+query_test_SOURCES =           \
+       query_test.c            \
+       netmgr_wrap.c
+
 EXTRA_DIST = testdata
 
 include $(top_srcdir)/Makefile.tests
diff --git a/tests/ns/netmgr_wrap.c b/tests/ns/netmgr_wrap.c
new file mode 100644 (file)
index 0000000..6737e53
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+/*! \file */
+
+#include <isc/atomic.h>
+#include <isc/netmgr.h>
+#include <isc/util.h>
+
+#include <dns/view.h>
+
+#include <ns/client.h>
+
+void
+ns_client_error(ns_client_t *client ISC_ATTR_UNUSED,
+               isc_result_t result ISC_ATTR_UNUSED) {
+       return;
+}