Skip to content

Commit 1bad29f

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#26377: test: Make system_tests/run_command test locale and platform agnostic
884304e test: Make `system_tests/run_command` locale agnostic (Hennadii Stepanov) Pull request description: Fixes bitcoin/bitcoin#26368. ACKs for top commit: Sjors: tACK 884304e Tree-SHA512: 76d4941e02b3b119dcf4dacbe60ef45a9dc8cf775bdb31b5291cd8147665285d41caaf1f5688abdfc9a47c393ddb535af7b11af839660d30ef30f1ca0d936133
2 parents f37bd15 + 884304e commit 1bad29f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/test/system_tests.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,9 @@ BOOST_AUTO_TEST_CASE(run_command)
5151
}
5252
{
5353
// An invalid command is handled by Boost
54-
#ifdef WIN32
55-
const std::string expected{"The system cannot find the file specified."};
56-
#else
57-
const std::string expected{"No such file or directory"};
58-
#endif
5954
BOOST_CHECK_EXCEPTION(RunCommandParseJSON("invalid_command"), boost::process::process_error, [&](const boost::process::process_error& e) {
60-
const std::string what(e.what());
61-
BOOST_CHECK(what.find("RunCommandParseJSON error:") == std::string::npos);
62-
BOOST_CHECK(what.find(expected) != std::string::npos);
55+
BOOST_CHECK(std::string(e.what()).find("RunCommandParseJSON error:") == std::string::npos);
56+
BOOST_CHECK_EQUAL(e.code().value(), 2);
6357
return true;
6458
});
6559
}

0 commit comments

Comments
 (0)