8170941: Executing gtest with invalid -Xlog argument crashes gtestLauncher
authormlarsson
Tue, 23 Jan 2018 08:55:47 +0100
changeset 48804 8f451978683c
parent 48803 6738bf669314
child 48805 decc1bb41107
8170941: Executing gtest with invalid -Xlog argument crashes gtestLauncher Reviewed-by: rehn, stuefe
test/hotspot/gtest/gtestMain.cpp
--- a/test/hotspot/gtest/gtestMain.cpp	Mon Jan 22 14:14:26 2018 -0800
+++ b/test/hotspot/gtest/gtestMain.cpp	Tue Jan 23 08:55:47 2018 +0100
@@ -111,7 +111,11 @@
     const char* name = test_info.name();
     if (!_is_initialized && is_suffix("_test_vm", name)) {
       // we want to have hs_err and core files when we execute regular tests
-      ASSERT_EQ(0, init_jvm(_argc, _argv, false)) << "Could not initialize the JVM";
+      int ret_val = init_jvm(_argc, _argv, false);
+      if (ret_val != 0) {
+        ADD_FAILURE() << "Could not initialize the JVM";
+        exit(1);
+      }
       _is_initialized = true;
     }
   }