2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 10:10:06 +00:00

fix ns_plugin_expandpath tests with no extension

Parts of ns_plugin_expandpath() test expected the plugin extension to be
appened automatically (the plugin name/path is provided without the
extension), this enable to test the logic which adds the correct
extension based on the platfrom.

But the expected expanded paths from the test were hard coded with the
`.so` extension, so the test can't pass on macOS platform. This fixes
the test by using the macro providing the current-platform extension.
This commit is contained in:
Colin Vidal 2025-07-30 10:35:26 +02:00
parent 1b6347483e
commit 32909254f5

View File

@ -150,7 +150,7 @@ ISC_RUN_TEST_IMPL(ns_plugin_expandpath) {
.exists = false, .exists = false,
.output_size = PATH_MAX, .output_size = PATH_MAX,
.result = ISC_R_SUCCESS, .result = ISC_R_SUCCESS,
.output = "/usr/lib/named/foo.so", .output = "/usr/lib/named/foo" NAMED_PLUGINEXT,
}, },
{ {
NS_TEST_ID("correct use with a relative path and no " NS_TEST_ID("correct use with a relative path and no "
@ -159,7 +159,7 @@ ISC_RUN_TEST_IMPL(ns_plugin_expandpath) {
.exists = false, .exists = false,
.output_size = PATH_MAX, .output_size = PATH_MAX,
.result = ISC_R_SUCCESS, .result = ISC_R_SUCCESS,
.output = "../../foo.so", .output = "../../foo" NAMED_PLUGINEXT,
}, },
{ {
NS_TEST_ID("correct use with a filename and no " NS_TEST_ID("correct use with a filename and no "
@ -168,7 +168,7 @@ ISC_RUN_TEST_IMPL(ns_plugin_expandpath) {
.exists = false, .exists = false,
.output_size = PATH_MAX, .output_size = PATH_MAX,
.result = ISC_R_SUCCESS, .result = ISC_R_SUCCESS,
.output = NAMED_PLUGINDIR "/foo.so", .output = NAMED_PLUGINDIR "/foo" NAMED_PLUGINEXT,
}, },
{ {
NS_TEST_ID("correct use with a filename and no " NS_TEST_ID("correct use with a filename and no "
@ -177,7 +177,7 @@ ISC_RUN_TEST_IMPL(ns_plugin_expandpath) {
.exists = false, .exists = false,
.output_size = PATH_MAX, .output_size = PATH_MAX,
.result = ISC_R_SUCCESS, .result = ISC_R_SUCCESS,
.output = NAMED_PLUGINDIR "/foo.bar.so", .output = NAMED_PLUGINDIR "/foo.bar" NAMED_PLUGINEXT,
}, },
{ {
NS_TEST_ID("no space at all in target buffer"), NS_TEST_ID("no space at all in target buffer"),