hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java
changeset 35074 4ac430acedd7
parent 34675 a6bb3ba532e1
child 35462 a1bed49c67a8
--- a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java	Fri Dec 11 13:36:15 2015 -0800
+++ b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java	Sat Dec 12 21:23:20 2015 +0300
@@ -63,12 +63,26 @@
         allOptionsAsMap.remove(optionName);
     }
 
+    private static void setAllowedExitCodes(String optionName, Integer... allowedExitCodes) {
+        JVMOption option = allOptionsAsMap.get(optionName);
+
+        if (option != null) {
+            option.setAllowedExitCodes(allowedExitCodes);
+        }
+    }
+
     public static void main(String[] args) throws Exception {
         int failedTests;
         List<JVMOption> allOptions;
 
         allOptionsAsMap = JVMOptionsUtils.getOptionsWithRangeAsMap();
 
+        /* Shared flags can cause JVM to exit with error code 2 */
+        setAllowedExitCodes("SharedReadWriteSize", 2);
+        setAllowedExitCodes("SharedReadOnlySize", 2);
+        setAllowedExitCodes("SharedMiscDataSize", 2);
+        setAllowedExitCodes("SharedMiscCodeSize", 2);
+
         /*
          * Remove CICompilerCount from testing because currently it can hang system
          */
@@ -82,23 +96,13 @@
         excludeTestRange("ThreadStackSize");
 
         /*
-         * JDK-8141650
-         * Temporarily exclude SharedMiscDataSize as it will exit the VM with exit code 2 and
-         * "The shared miscellaneous data space is not large enough to preload requested classes."
-         * message at min value.
+         * JDK-8143958
+         * Temporarily exclude testing of max range for Shared* flags
          */
-        excludeTestRange("SharedMiscDataSize");
-
-        /*
-         * JDK-8142874
-         * Temporarily exclude Shared* flagse as they will exit the VM with exit code 2 and
-         * "The shared miscellaneous data space is not large enough to preload requested classes."
-         * message at max values.
-         */
-        excludeTestRange("SharedReadWriteSize");
-        excludeTestRange("SharedReadOnlySize");
-        excludeTestRange("SharedMiscDataSize");
-        excludeTestRange("SharedMiscCodeSize");
+        excludeTestMaxRange("SharedReadWriteSize");
+        excludeTestMaxRange("SharedReadOnlySize");
+        excludeTestMaxRange("SharedMiscDataSize");
+        excludeTestMaxRange("SharedMiscCodeSize");
 
         /*
          * Remove the flag controlling the size of the stack because the