Skip to content

Commit 44ca5d5

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#26473: test: Avoid collision with valid path names in getarg_tests/logargs
c8f9147 test: Avoid collision with valid path names in `getarg_tests/logargs` (Hennadii Stepanov) Pull request description: This PR prevents test failure when "private" is a part of a valid path. For example, `/private/var` is a valid path on macOS for temporary files, which in turn causes test failure on CI for tests managed by the [CTest](bitcoin/bitcoin#25797) framework. ACKs for top commit: MarcoFalke: ACK c8f9147 Tree-SHA512: 09d257f8fa6be903ec8092b2ae92887a4bec2d05085c76c110637657f4a4bfe2714bf87e2e4727719b3624c8fa4c835ce2ca259c2c9c93033837f997b2057e4f
2 parents 50422b7 + c8f9147 commit 44ca5d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/getarg_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ BOOST_AUTO_TEST_CASE(logargs)
429429
const auto okaylog = std::make_pair("-okaylog", ArgsManager::ALLOW_ANY);
430430
const auto dontlog = std::make_pair("-dontlog", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE);
431431
SetupArgs(local_args, {okaylog_bool, okaylog_negbool, okaylog, dontlog});
432-
ResetArgs(local_args, "-okaylog-bool -nookaylog-negbool -okaylog=public -dontlog=private");
432+
ResetArgs(local_args, "-okaylog-bool -nookaylog-negbool -okaylog=public -dontlog=private42");
433433

434434
// Everything logged to debug.log will also append to str
435435
std::string str;
@@ -447,7 +447,7 @@ BOOST_AUTO_TEST_CASE(logargs)
447447
BOOST_CHECK(str.find("Command-line arg: okaylog-negbool=false") != std::string::npos);
448448
BOOST_CHECK(str.find("Command-line arg: okaylog=\"public\"") != std::string::npos);
449449
BOOST_CHECK(str.find("dontlog=****") != std::string::npos);
450-
BOOST_CHECK(str.find("private") == std::string::npos);
450+
BOOST_CHECK(str.find("private42") == std::string::npos);
451451
}
452452

453453
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)