Use standard loading code in many tests
In order to prepare for use in CTS tests make tests 902, 914, 915,
917, 919, 926, 930, 932, 940, 942, 945, 981 & 982 use standard OnLoad
functions. Final configuration is done during test initialization.
Bug: 32072923
Test: ./test/testrunner/testrunner.py --host -j40
Change-Id: I84b2e17d0e024255d2dc49452f3d74dfd64abd22
diff --git a/test/934-load-transform/src/art/Redefinition.java b/test/934-load-transform/src/art/Redefinition.java
index 8cd2568..0350ab4 100644
--- a/test/934-load-transform/src/art/Redefinition.java
+++ b/test/934-load-transform/src/art/Redefinition.java
@@ -36,6 +36,25 @@
}
}
+ // A set of possible test configurations. Test should set this if they need to.
+ // This must be kept in sync with the defines in ti-agent/common_helper.cc
+ public static enum Config {
+ COMMON_REDEFINE(0),
+ COMMON_RETRANSFORM(1),
+ COMMON_TRANSFORM(2);
+
+ private final int val;
+ private Config(int val) {
+ this.val = val;
+ }
+ }
+
+ public static void setTestConfiguration(Config type) {
+ nativeSetTestConfiguration(type.val);
+ }
+
+ private static native void nativeSetTestConfiguration(int type);
+
// Transforms the class
public static native void doCommonClassRedefinition(Class<?> target,
byte[] classfile,