Skip to content

Commit

Permalink
Add simple print function to ObjectTestHelper for debugging.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 585688021
  • Loading branch information
jwhpryor authored and copybara-github committed Nov 27, 2023
1 parent 77b8838 commit e243bc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions javatests/com/jnibind/test/ObjectTestHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ public ObjectTestHelper() {
objectVal = null;
}

public void print() {
System.out.println(this.intVal1);
System.out.println(this.intVal2);
System.out.println(this.intVal3);

if (objectVal != null) {
System.out.println(objectVal);
}
}

public ObjectTestHelper(Object objectVal) {
this.objectVal = objectVal;
}
Expand Down
1 change: 1 addition & 0 deletions javatests/com/jnibind/test/object_test_helper_jni.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ constexpr jni::Class kObjectTestHelperClass {

::jni::Method{"foo", ::jni::Return{}, ::jni::Params{}},
::jni::Method{"increment", ::jni::Return{}, ::jni::Params<int>{}},
::jni::Method{"print", ::jni::Return{}, ::jni::Params{}},

::jni::Field{"intVal1", int{}},
::jni::Field{"intVal2", int{}},
Expand Down

0 comments on commit e243bc7

Please sign in to comment.