8174691: [TESTBUG] A number of native hotspot unit tests fail when executed in stand-alone mode

Reviewed-by: kvn, tschatzl
This commit is contained in:
Igor Ignatyev 2018-08-01 10:04:08 -07:00
parent 4ab515f85c
commit 65091f8c6d
4 changed files with 21 additions and 17 deletions

View file

@ -31,7 +31,7 @@
class CollectedHeap; class CollectedHeap;
class G1Arguments : public GCArguments { class G1Arguments : public GCArguments {
friend class G1HeapVerifierTest_parse_Test; friend class G1HeapVerifierTest;
private: private:
static void initialize_verification_types(); static void initialize_verification_types();

View file

@ -30,9 +30,13 @@
#include "unittest.hpp" #include "unittest.hpp"
class G1HeapVerifierTest : public LogTestFixture { 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)); LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc, verify));
// Default is to verify everything. // Default is to verify everything.
@ -45,7 +49,7 @@ TEST_F(G1HeapVerifierTest, parse) {
ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull));
// Setting one will disable all other. // 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::G1VerifyAll));
ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal)); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyConcurrentStart)); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyConcurrentStart));
@ -55,23 +59,23 @@ TEST_F(G1HeapVerifierTest, parse) {
ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull));
// Verify case sensitivity. // Verify case sensitivity.
G1Arguments::parse_verification_type("YOUNG-NORMAL"); G1HeapVerifierTest::parse_verification_type("YOUNG-NORMAL");
ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal)); 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)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
// Verify perfect match // Verify perfect match
G1Arguments::parse_verification_type("mixedgc"); G1HeapVerifierTest::parse_verification_type("mixedgc");
ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed)); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
G1Arguments::parse_verification_type("mixe"); G1HeapVerifierTest::parse_verification_type("mixe");
ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed)); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
G1Arguments::parse_verification_type("mixed"); G1HeapVerifierTest::parse_verification_type("mixed");
ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
// Verify the last three // Verify the last three
G1Arguments::parse_verification_type("concurrent-start"); G1HeapVerifierTest::parse_verification_type("concurrent-start");
G1Arguments::parse_verification_type("remark"); G1HeapVerifierTest::parse_verification_type("remark");
G1Arguments::parse_verification_type("cleanup"); G1HeapVerifierTest::parse_verification_type("cleanup");
ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup));

View file

@ -236,11 +236,11 @@ static int vsnprintf_wrapper(char* buf, size_t len, const char* fmt, ...) {
return result; return result;
} }
TEST(os, vsnprintf) { TEST_VM(os, vsnprintf) {
test_snprintf(vsnprintf_wrapper, true); test_snprintf(vsnprintf_wrapper, true);
} }
TEST(os, snprintf) { TEST_VM(os, snprintf) {
test_snprintf(os::snprintf, true); test_snprintf(os::snprintf, true);
} }
@ -260,10 +260,10 @@ static int jio_vsnprintf_wrapper(char* buf, size_t len, const char* fmt, ...) {
return result; return result;
} }
TEST(os, jio_vsnprintf) { TEST_VM(os, jio_vsnprintf) {
test_snprintf(jio_vsnprintf_wrapper, false); test_snprintf(jio_vsnprintf_wrapper, false);
} }
TEST(os, jio_snprintf) { TEST_VM(os, jio_snprintf) {
test_snprintf(jio_snprintf, false); test_snprintf(jio_snprintf, false);
} }

View file

@ -65,7 +65,7 @@ TEST(SpinYield, two_yields) {
check_report(&spinner, "yields = 2"); check_report(&spinner, "yields = 2");
} }
TEST(SpinYield, one_sleep) { TEST_VM(SpinYield, one_sleep) {
SpinYield spinner(0, 0); SpinYield spinner(0, 0);
spinner.wait(); spinner.wait();
@ -77,7 +77,7 @@ TEST(SpinYield, one_sleep) {
ASSERT_TRUE(strncmp(expected, buffer, strlen(expected)) == 0); 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); SpinYield spinner(1, 0);
spinner.wait(); spinner.wait();
spinner.wait(); spinner.wait();