diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-24 01:19:48 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-24 01:20:34 +0300 |
commit | 9a334d41e3c20dfde053cd95b9f80c384c51c2a9 (patch) | |
tree | 2363374bc1ecb2e7f302624260dd1c1b64fe240b | |
parent | 805c6534f8503f14a4d9e4169502e309b2a51bba (diff) | |
download | micropython-9a334d41e3c20dfde053cd95b9f80c384c51c2a9.tar.gz micropython-9a334d41e3c20dfde053cd95b9f80c384c51c2a9.zip |
tests/jni: Test for basic object operations.
-rw-r--r-- | tests/jni/object.py | 16 | ||||
-rw-r--r-- | tests/jni/object.py.exp | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/jni/object.py b/tests/jni/object.py new file mode 100644 index 0000000000..6cf936c4d0 --- /dev/null +++ b/tests/jni/object.py @@ -0,0 +1,16 @@ +import sys +import jni +try: + Integer = jni.cls("java/lang/Integer") +except: + print("SKIP") + sys.exit() + +# Create object +i = Integer(42) +print(i) +# Call object method +print(i.hashCode()) +# Pass object to another method +System = jni.cls("java/lang/System") +System.out.println(i) diff --git a/tests/jni/object.py.exp b/tests/jni/object.py.exp new file mode 100644 index 0000000000..bda709ecfb --- /dev/null +++ b/tests/jni/object.py.exp @@ -0,0 +1,3 @@ +42 +42 +42 |