summaryrefslogtreecommitdiff
path: root/test/901-hello-ti-agent/src/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/901-hello-ti-agent/src/Main.java')
-rw-r--r--test/901-hello-ti-agent/src/Main.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/901-hello-ti-agent/src/Main.java b/test/901-hello-ti-agent/src/Main.java
index 1ef6289559..775e5c2e0c 100644
--- a/test/901-hello-ti-agent/src/Main.java
+++ b/test/901-hello-ti-agent/src/Main.java
@@ -16,6 +16,26 @@
public class Main {
public static void main(String[] args) {
+ System.loadLibrary(args[1]);
+
System.out.println("Hello, world!");
+
+ set(0); // OTHER
+ set(1); // GC
+ set(2); // CLASS
+ set(4); // JNI
+ set(8); // Error.
}
+
+ private static void set(int i) {
+ System.out.println(i);
+ try {
+ setVerboseFlag(i, true);
+ setVerboseFlag(i, false);
+ } catch (RuntimeException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+ private static native void setVerboseFlag(int flag, boolean value);
}