diff --git a/Tests/GoogleTest/Test/main1.cxx b/Tests/GoogleTest/Test/main1.cxx index c353d9146a..3e50398b38 100644 --- a/Tests/GoogleTest/Test/main1.cxx +++ b/Tests/GoogleTest/Test/main1.cxx @@ -20,11 +20,10 @@ int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); - if (argc > 1) { - if (argv[1] != std::string("--forceFail")) { - throw "Unexpected argument"; + for (int i = 0; i < argc; ++i) { + if (argv[i] == std::string("--forceFail")) { + shouldFail = true; } - shouldFail = true; } return RUN_ALL_TESTS(); }