summaryrefslogtreecommitdiff
path: root/test/710-varhandle-creation
diff options
context:
space:
mode:
Diffstat (limited to 'test/710-varhandle-creation')
-rw-r--r--test/710-varhandle-creation/build.py (renamed from test/710-varhandle-creation/build)10
-rw-r--r--test/710-varhandle-creation/run.py (renamed from test/710-varhandle-creation/run)6
-rw-r--r--test/710-varhandle-creation/src/Main.java5
-rw-r--r--test/710-varhandle-creation/test-metadata.json5
4 files changed, 17 insertions, 9 deletions
diff --git a/test/710-varhandle-creation/build b/test/710-varhandle-creation/build.py
index ca1e557129..7ccbe96067 100644
--- a/test/710-varhandle-creation/build
+++ b/test/710-varhandle-creation/build.py
@@ -1,12 +1,11 @@
-#!/bin/bash
#
-# Copyright (C) 2017 The Android Open Source Project
+# Copyright (C) 2022 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Stop if something fails.
-set -e
-./default-build "$@" --experimental var-handles
+def build(ctx):
+ ctx.default_build(api_level="var-handles")
diff --git a/test/710-varhandle-creation/run b/test/710-varhandle-creation/run.py
index 46b1a8308b..930869a91d 100644
--- a/test/710-varhandle-creation/run
+++ b/test/710-varhandle-creation/run.py
@@ -14,5 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Currently app images aren't unloaded when dex files are unloaded.
-exec ${RUN} $@ --no-secondary-app-image
+
+def run(ctx, args):
+ # Currently app images aren't unloaded when dex files are unloaded.
+ ctx.default_run(args, secondary_app_image=False)
diff --git a/test/710-varhandle-creation/src/Main.java b/test/710-varhandle-creation/src/Main.java
index c4fe2ffed1..6ddc58a91d 100644
--- a/test/710-varhandle-creation/src/Main.java
+++ b/test/710-varhandle-creation/src/Main.java
@@ -271,6 +271,7 @@ public final class Main {
private static void checkInstantiatedVarHandles() {
System.out.print("checkInstantiatedVarHandles...");
+ // clang-format off
System.out.print("vz...");
checkNotNull(vz);
checkVarType(vz, boolean.class);
@@ -2052,6 +2053,7 @@ public final class Main {
System.out.print("vbbo...");
checkNull(vbbo);
+ // clang-format on
System.out.println("PASS");
}
@@ -2090,6 +2092,7 @@ public final class Main {
if (VarHandle.AccessMode.values().length != expectedLength) {
fail("VarHandle.AccessMode.value().length != " + expectedLength);
}
+ // clang-format off
checkAccessMode(VarHandle.AccessMode.GET, "GET", "get", 0);
checkAccessMode(VarHandle.AccessMode.SET, "SET", "set", 1);
checkAccessMode(VarHandle.AccessMode.GET_VOLATILE, "GET_VOLATILE", "getVolatile", 2);
@@ -2121,6 +2124,7 @@ public final class Main {
checkAccessMode(VarHandle.AccessMode.GET_AND_BITWISE_XOR, "GET_AND_BITWISE_XOR", "getAndBitwiseXor", 28);
checkAccessMode(VarHandle.AccessMode.GET_AND_BITWISE_XOR_RELEASE, "GET_AND_BITWISE_XOR_RELEASE", "getAndBitwiseXorRelease", 29);
checkAccessMode(VarHandle.AccessMode.GET_AND_BITWISE_XOR_ACQUIRE, "GET_AND_BITWISE_XOR_ACQUIRE", "getAndBitwiseXorAcquire", 30);
+ // clang-format on
System.out.println("PASS");
}
@@ -2456,4 +2460,3 @@ public final class Main {
checkStaticFieldVarHandleGc();
}
}
-
diff --git a/test/710-varhandle-creation/test-metadata.json b/test/710-varhandle-creation/test-metadata.json
new file mode 100644
index 0000000000..ed296916c8
--- /dev/null
+++ b/test/710-varhandle-creation/test-metadata.json
@@ -0,0 +1,5 @@
+{
+ "build-param": {
+ "experimental": "var-handles"
+ }
+}