changeset 53287:c42cd17e8e64

8213204: ReservedStackTest and ReservedStackTestCompiler tests fail on windows Reviewed-by: fparain, dcubed, jwilhelm
author bobv
date Wed, 31 Oct 2018 16:27:01 -0400
parents 0c25fa66b5c5
children e38473506688
files test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java
diffstat 1 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java	Wed Oct 31 10:48:13 2018 -0400
+++ b/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java	Wed Oct 31 16:27:01 2018 -0400
@@ -232,6 +232,19 @@
         }
     }
 
+    private static boolean isAlwaysSupportedPlatform() {
+        return Platform.isAix() ||
+            (Platform.isLinux() &&
+             (Platform.isPPC() || Platform.isS390x() || Platform.isX64() ||
+              Platform.isX86() || Platform.isAArch64())) ||
+            Platform.isOSX() ||
+            Platform.isSolaris();
+    }
+
+    private static boolean isNeverSupportedPlatform() {
+        return !isAlwaysSupportedPlatform();
+    }
+
     private static boolean isSupportedPlatform;
 
     private static void initIsSupportedPlatform() throws Exception {
@@ -256,11 +269,19 @@
 
         // Do a sanity check. Some platforms we know are always supported. Make sure
         // we didn't determine that one of those platforms is not supported.
-        if (!isSupportedPlatform) {
+        if (!isSupportedPlatform && isAlwaysSupportedPlatform()) {
             String msg  = "This platform should be supported: " + Platform.getOsArch();
             System.err.println("FAILED: " +  msg);
             throw new RuntimeException(msg);
         }
+
+        // And some platforms we know are never supported. Make sure
+        // we didn't determine that one of those platforms is supported.
+        if (isSupportedPlatform && isNeverSupportedPlatform()) {
+            String msg  = "This platform should not be supported: " + Platform.getOsArch();
+            System.err.println("FAILED: " +  msg);
+            throw new RuntimeException(msg);
+        }
     }
 
     public static void main(String[] args) throws Exception {