aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-10-28 11:31:43 +0200
committerMacroFake <falke.marco@gmail.com>2022-10-28 11:32:13 +0200
commit1bad29fe02096b269858b192a4a91c785a44e505 (patch)
treeac9bbfa4d04bd3f1ef3dab6d2f10a76d0e4923b5 /src
parentf37bd15d472fdc7dd3d40cafaba9e8dfddd6b530 (diff)
parent884304e6c6a250719a64752fe52d1283cd5e36ab (diff)
downloadbitcoin-1bad29fe02096b269858b192a4a91c785a44e505.tar.xz
Merge bitcoin/bitcoin#26377: test: Make `system_tests/run_command` test locale and platform agnostic
884304e6c6a250719a64752fe52d1283cd5e36ab test: Make `system_tests/run_command` locale agnostic (Hennadii Stepanov) Pull request description: Fixes bitcoin/bitcoin#26368. ACKs for top commit: Sjors: tACK 884304e6c6a250719a64752fe52d1283cd5e36ab Tree-SHA512: 76d4941e02b3b119dcf4dacbe60ef45a9dc8cf775bdb31b5291cd8147665285d41caaf1f5688abdfc9a47c393ddb535af7b11af839660d30ef30f1ca0d936133
Diffstat (limited to 'src')
-rw-r--r--src/test/system_tests.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/test/system_tests.cpp b/src/test/system_tests.cpp
index 11f4be7fef..d5b65b9c08 100644
--- a/src/test/system_tests.cpp
+++ b/src/test/system_tests.cpp
@@ -51,15 +51,9 @@ BOOST_AUTO_TEST_CASE(run_command)
}
{
// An invalid command is handled by Boost
-#ifdef WIN32
- const std::string expected{"The system cannot find the file specified."};
-#else
- const std::string expected{"No such file or directory"};
-#endif
BOOST_CHECK_EXCEPTION(RunCommandParseJSON("invalid_command"), boost::process::process_error, [&](const boost::process::process_error& e) {
- const std::string what(e.what());
- BOOST_CHECK(what.find("RunCommandParseJSON error:") == std::string::npos);
- BOOST_CHECK(what.find(expected) != std::string::npos);
+ BOOST_CHECK(std::string(e.what()).find("RunCommandParseJSON error:") == std::string::npos);
+ BOOST_CHECK_EQUAL(e.code().value(), 2);
return true;
});
}