File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,6 @@ bool checkMessage(const std::runtime_error& ex)
37
37
return true ;
38
38
}
39
39
40
- bool checkMessageFalse (const std::runtime_error& ex)
41
- {
42
- BOOST_CHECK_EQUAL (ex.what (), std::string (" RunCommandParseJSON error: process(false) returned 1: \n " ));
43
- return true ;
44
- }
45
-
46
40
bool checkMessageStdErr (const std::runtime_error& ex)
47
41
{
48
42
const std::string what (ex.what ());
@@ -73,7 +67,15 @@ BOOST_AUTO_TEST_CASE(run_command)
73
67
}
74
68
{
75
69
// Return non-zero exit code, no output to stderr
76
- BOOST_CHECK_EXCEPTION (RunCommandParseJSON (" false" ), std::runtime_error, checkMessageFalse);
70
+ #ifdef WIN32
71
+ const std::string command{" cmd.exe /c call" };
72
+ #else
73
+ const std::string command{" false" };
74
+ #endif
75
+ BOOST_CHECK_EXCEPTION (RunCommandParseJSON (command), std::runtime_error, [&](const std::runtime_error& e) {
76
+ BOOST_CHECK (std::string (e.what ()).find (strprintf (" RunCommandParseJSON error: process(%s) returned 1: \n " , command)) != std::string::npos);
77
+ return true ;
78
+ });
77
79
}
78
80
{
79
81
// Return non-zero exit code, with error message for stderr
You can’t perform that action at this time.
0 commit comments