8174691: [TESTBUG] A number of native hotspot unit tests fail when executed in stand-alone mode
authoriignatyev
Wed, 01 Aug 2018 10:04:08 -0700
changeset 51277 dfe1cff5c2f6
parent 51276 04183bf08bff
child 51278 d56dd9798d54
8174691: [TESTBUG] A number of native hotspot unit tests fail when executed in stand-alone mode Reviewed-by: kvn, tschatzl
src/hotspot/share/gc/g1/g1Arguments.hpp
test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp
test/hotspot/gtest/runtime/test_os.cpp
test/hotspot/gtest/utilities/test_spinYield.cpp
--- a/src/hotspot/share/gc/g1/g1Arguments.hpp	Wed Aug 01 09:33:56 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1Arguments.hpp	Wed Aug 01 10:04:08 2018 -0700
@@ -31,7 +31,7 @@
 class CollectedHeap;
 
 class G1Arguments : public GCArguments {
-  friend class G1HeapVerifierTest_parse_Test;
+  friend class G1HeapVerifierTest;
 
 private:
   static void initialize_verification_types();
--- a/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp	Wed Aug 01 09:33:56 2018 -0700
+++ b/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp	Wed Aug 01 10:04:08 2018 -0700
@@ -30,9 +30,13 @@
 #include "unittest.hpp"
 
 class G1HeapVerifierTest : public LogTestFixture {
+  protected:
+    static void parse_verification_type(const char* type) {
+      G1Arguments::parse_verification_type(type);
+    }
 };
 
-TEST_F(G1HeapVerifierTest, parse) {
+TEST_VM_F(G1HeapVerifierTest, parse) {
   LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc, verify));
 
   // Default is to verify everything.
@@ -45,7 +49,7 @@
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull));
 
   // Setting one will disable all other.
-  G1Arguments::parse_verification_type("full");
+  G1HeapVerifierTest::parse_verification_type("full");
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll));
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyConcurrentStart));
@@ -55,23 +59,23 @@
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull));
 
   // Verify case sensitivity.
-  G1Arguments::parse_verification_type("YOUNG-NORMAL");
+  G1HeapVerifierTest::parse_verification_type("YOUNG-NORMAL");
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
-  G1Arguments::parse_verification_type("young-normal");
+  G1HeapVerifierTest::parse_verification_type("young-normal");
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
 
   // Verify perfect match
-  G1Arguments::parse_verification_type("mixedgc");
+  G1HeapVerifierTest::parse_verification_type("mixedgc");
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
-  G1Arguments::parse_verification_type("mixe");
+  G1HeapVerifierTest::parse_verification_type("mixe");
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
-  G1Arguments::parse_verification_type("mixed");
+  G1HeapVerifierTest::parse_verification_type("mixed");
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
 
   // Verify the last three
-  G1Arguments::parse_verification_type("concurrent-start");
-  G1Arguments::parse_verification_type("remark");
-  G1Arguments::parse_verification_type("cleanup");
+  G1HeapVerifierTest::parse_verification_type("concurrent-start");
+  G1HeapVerifierTest::parse_verification_type("remark");
+  G1HeapVerifierTest::parse_verification_type("cleanup");
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup));
 
--- a/test/hotspot/gtest/runtime/test_os.cpp	Wed Aug 01 09:33:56 2018 -0700
+++ b/test/hotspot/gtest/runtime/test_os.cpp	Wed Aug 01 10:04:08 2018 -0700
@@ -236,11 +236,11 @@
   return result;
 }
 
-TEST(os, vsnprintf) {
+TEST_VM(os, vsnprintf) {
   test_snprintf(vsnprintf_wrapper, true);
 }
 
-TEST(os, snprintf) {
+TEST_VM(os, snprintf) {
   test_snprintf(os::snprintf, true);
 }
 
@@ -260,10 +260,10 @@
   return result;
 }
 
-TEST(os, jio_vsnprintf) {
+TEST_VM(os, jio_vsnprintf) {
   test_snprintf(jio_vsnprintf_wrapper, false);
 }
 
-TEST(os, jio_snprintf) {
+TEST_VM(os, jio_snprintf) {
   test_snprintf(jio_snprintf, false);
 }
--- a/test/hotspot/gtest/utilities/test_spinYield.cpp	Wed Aug 01 09:33:56 2018 -0700
+++ b/test/hotspot/gtest/utilities/test_spinYield.cpp	Wed Aug 01 10:04:08 2018 -0700
@@ -65,7 +65,7 @@
   check_report(&spinner, "yields = 2");
 }
 
-TEST(SpinYield, one_sleep) {
+TEST_VM(SpinYield, one_sleep) {
   SpinYield spinner(0, 0);
   spinner.wait();
 
@@ -77,7 +77,7 @@
   ASSERT_TRUE(strncmp(expected, buffer, strlen(expected)) == 0);
 }
 
-TEST(SpinYield, one_spin_one_sleep) {
+TEST_VM(SpinYield, one_spin_one_sleep) {
   SpinYield spinner(1, 0);
   spinner.wait();
   spinner.wait();