From e94e2d42a5892f930b47415841b0e00e374b54e2 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 1 Oct 2014 18:57:29 +0100 Subject: [PATCH] More native bridge tests Test for os.arch. Bug: 17713104 (cherry picked from commit ba16b0796aafb6ad4c96c5e10b713d73edc0b857) Change-Id: I45bde49c778f176cdfc779b211053a2747adb3fc --- test/115-native-bridge/src/NativeBridgeMain.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/115-native-bridge/src/NativeBridgeMain.java b/test/115-native-bridge/src/NativeBridgeMain.java index a531f9230..2405627f8 100644 --- a/test/115-native-bridge/src/NativeBridgeMain.java +++ b/test/115-native-bridge/src/NativeBridgeMain.java @@ -15,6 +15,7 @@ */ import java.lang.reflect.Method; +import java.lang.System; // This is named Main as it is a copy of JniTest, so that we can re-use the native implementations // from libarttest. @@ -29,6 +30,7 @@ class Main { testShortMethod(); testBooleanMethod(); testCharMethod(); + testEnvironment(); } public static native void testFindClassOnAttachedNativeThread(); @@ -147,6 +149,24 @@ class Main { } } } + + private static void testEnvironment() { + String osArch = System.getProperty("os.arch"); + if (!"os.arch".equals(osArch)) { + throw new AssertionError("unexpected value for os.arch: " + osArch); + } + // TODO: improve the build script to get these running as well. + // if (!"cpu_abi".equals(Build.CPU_ABI)) { + // throw new AssertionError("unexpected value for cpu_abi"); + // } + // if (!"cpu_abi2".equals(Build.CPU_ABI2)) { + // throw new AssertionError("unexpected value for cpu_abi2"); + // } + // String[] expectedSupportedAbis = {"supported1", "supported2", "supported3"}; + // if (Arrays.equals(expectedSupportedAbis, Build.SUPPORTED_ABIS)) { + // throw new AssertionError("unexpected value for supported_abis"); + // } + } } public class NativeBridgeMain { -- 2.11.0