--- a/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp Mon Mar 26 09:35:20 2018 -0400
+++ b/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp Mon Mar 26 12:44:39 2018 +0200
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
+#include "gc/g1/g1Arguments.hpp"
#include "gc/g1/g1HeapVerifier.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logTestFixture.hpp"
@@ -32,50 +33,48 @@
};
TEST_F(G1HeapVerifierTest, parse) {
- G1HeapVerifier verifier(NULL);
-
LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc, verify));
// Default is to verify everything.
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyAll));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyYoungOnly));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyInitialMark));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyMixed));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyRemark));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyCleanup));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyFull));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyInitialMark));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull));
// Setting one will disable all other.
- verifier.parse_verification_type("full");
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyAll));
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyYoungOnly));
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyInitialMark));
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyMixed));
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyRemark));
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyCleanup));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyFull));
+ G1Arguments::parse_verification_type("full");
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll));
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyInitialMark));
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull));
// Verify case sensitivity.
- verifier.parse_verification_type("YOUNG-ONLY");
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyYoungOnly));
- verifier.parse_verification_type("young-only");
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyYoungOnly));
+ G1Arguments::parse_verification_type("YOUNG-ONLY");
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
+ G1Arguments::parse_verification_type("young-only");
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
// Verify perfect match
- verifier.parse_verification_type("mixedgc");
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyMixed));
- verifier.parse_verification_type("mixe");
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyMixed));
- verifier.parse_verification_type("mixed");
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyMixed));
+ G1Arguments::parse_verification_type("mixedgc");
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
+ G1Arguments::parse_verification_type("mixe");
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
+ G1Arguments::parse_verification_type("mixed");
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
// Verify the last three
- verifier.parse_verification_type("initial-mark");
- verifier.parse_verification_type("remark");
- verifier.parse_verification_type("cleanup");
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyRemark));
- ASSERT_TRUE(verifier.should_verify(G1HeapVerifier::G1VerifyCleanup));
+ G1Arguments::parse_verification_type("initial-mark");
+ G1Arguments::parse_verification_type("remark");
+ G1Arguments::parse_verification_type("cleanup");
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
+ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup));
// Enabling all is not the same as G1VerifyAll
- ASSERT_FALSE(verifier.should_verify(G1HeapVerifier::G1VerifyAll));
+ ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll));
}