< prev index next >

test/java/nio/ByteOrder/NativeOrder.java

Print this page
rev 17195 : 8181145: add platforms to test java/nio/ByteOrder/NativeOrder.java

*** 30,43 **** public class NativeOrder { public static void main(String[] args) throws Exception { ByteOrder bo = ByteOrder.nativeOrder(); ! System.err.println(bo); String arch = System.getProperty("os.arch"); if (((arch.equals("i386") && (bo != ByteOrder.LITTLE_ENDIAN))) || ((arch.equals("sparc") && (bo != ByteOrder.BIG_ENDIAN)))) { throw new Exception("Wrong byte order"); } } } --- 30,50 ---- public class NativeOrder { public static void main(String[] args) throws Exception { ByteOrder bo = ByteOrder.nativeOrder(); ! System.err.println("ByteOrder.nativeOrder:" + bo); String arch = System.getProperty("os.arch"); + System.err.println("os.arch:" + arch); if (((arch.equals("i386") && (bo != ByteOrder.LITTLE_ENDIAN))) || + ((arch.equals("amd64") && (bo != ByteOrder.LITTLE_ENDIAN))) || + ((arch.equals("x86_64") && (bo != ByteOrder.LITTLE_ENDIAN))) || + ((arch.equals("ppc64") && (bo != ByteOrder.BIG_ENDIAN))) || + ((arch.equals("ppc64le") && (bo != ByteOrder.LITTLE_ENDIAN))) || + ((arch.equals("s390x") && (bo != ByteOrder.BIG_ENDIAN))) || ((arch.equals("sparc") && (bo != ByteOrder.BIG_ENDIAN)))) { throw new Exception("Wrong byte order"); } + System.err.println("test is OK"); } }
< prev index next >