test/compiler/arguments/BMIUnsupportedCPUTest.java

Print this page

        

@@ -73,36 +73,49 @@
         /*
           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 },
-                ExitCode.OK, CommandLineOptionTest.prepareBooleanFlag(
+                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 }, ExitCode.OK,
+                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
+         * Verify that on unsupported CPUs option is off by default. VM will be
+         * launched with following options: -version
         */
-        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");
+        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,14 +129,20 @@
         /*
           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,
+                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, ExitCode.FAIL,
+                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));
     }
 }