From dc26cdf9a9f8699fc44acf082ae42a9fd57f0957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Ferenc=20Nagy-Egri?= Date: Mon, 23 Feb 2026 18:04:51 +0100 Subject: [PATCH] GoogleTest: Fix unit test arg parsing --- Tests/GoogleTest/Test/main1.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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(); }