test/compiler/arguments/BMIUnsupportedCPUTest.java
Print this page
*** 73,108 ****
/*
Verify that VM will successfully start up, but output will contain a
warning. VM will be launched with following options:
-XX:+<tested option> -version
*/
CommandLineOptionTest.verifySameJVMStartup(
new String[] { warningMessage }, new String[] { errorMessage },
! ExitCode.OK, CommandLineOptionTest.prepareBooleanFlag(
optionName, true));
/*
Verify that VM will successfully startup without any warnings.
VM will be launched with following options:
-XX:-<tested option> -version
*/
CommandLineOptionTest.verifySameJVMStartup(null,
! new String[] { warningMessage, errorMessage }, ExitCode.OK,
CommandLineOptionTest.prepareBooleanFlag(optionName, false));
/*
! Verify that on unsupported CPUs option is off by default.
! VM will be launched with following options: -version
*/
! CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");
/*
Verify that on unsupported CPUs option will be off even if
it was explicitly turned on by user. VM will be launched with
following options: -XX:+<tested option> -version
*/
CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
/**
--- 73,121 ----
/*
Verify that VM will successfully start up, but output will contain a
warning. VM will be launched with following options:
-XX:+<tested option> -version
*/
+ String errorString = String.format("JVM should start with '-XX:+%s' "
+ + "flag, but output should contain warning.", optionName);
CommandLineOptionTest.verifySameJVMStartup(
new String[] { warningMessage }, new String[] { errorMessage },
! errorString, String.format("Option '%s' is unsupported.%n"
! + "Warning expected to be shown.", optionName), ExitCode.OK,
! CommandLineOptionTest.prepareBooleanFlag(
optionName, true));
/*
Verify that VM will successfully startup without any warnings.
VM will be launched with following options:
-XX:-<tested option> -version
*/
+ errorString = String.format("JVM should start with '-XX:-%s' flag "
+ + "without any warnings", optionName);
CommandLineOptionTest.verifySameJVMStartup(null,
! new String[] { warningMessage, errorMessage },
! errorString, errorString, ExitCode.OK,
CommandLineOptionTest.prepareBooleanFlag(optionName, false));
/*
! * Verify that on unsupported CPUs option is off by default. VM will be
! * launched with following options: -version
*/
! CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
! String.format("Option '%s' is expected to have default value "
! + "'false' since feature required is not supported "
! + "on CPU", optionName));
/*
Verify that on unsupported CPUs option will be off even if
it was explicitly turned on by user. VM will be launched with
following options: -XX:+<tested option> -version
*/
CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+ String.format("Option '%s' is expected to have default value"
+ + " 'false' since feature required is not supported on"
+ + " CPU even if user set another value.", optionName),
CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
/**
*** 116,129 ****
/*
Verify that VM known nothing about tested option. VM will be launched
with following options: -XX:[+-]<tested option> -version
*/
CommandLineOptionTest.verifySameJVMStartup(
! new String[] { errorMessage }, null, ExitCode.FAIL,
CommandLineOptionTest.prepareBooleanFlag(optionName, true));
CommandLineOptionTest.verifySameJVMStartup(
! new String[] { errorMessage }, null, ExitCode.FAIL,
CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
}
--- 129,148 ----
/*
Verify that VM known nothing about tested option. VM will be launched
with following options: -XX:[+-]<tested option> -version
*/
CommandLineOptionTest.verifySameJVMStartup(
! new String[] { errorMessage }, null,
! String.format("JVM startup should fail with '-XX:+%s' flag."
! + "%nOption should be unknown (non-X86CPU).",
! optionName), "", ExitCode.FAIL,
CommandLineOptionTest.prepareBooleanFlag(optionName, true));
CommandLineOptionTest.verifySameJVMStartup(
! new String[] { errorMessage }, null,
! String.format("JVM startup should fail with '-XX:-%s' flag."
! + "%nOption should be unknown (non-X86CPU)",
! optionName), "", ExitCode.FAIL,
CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
}