I have an Android JNI wrapper for some C++ code. The C++ code has it's own set of unit tests.
I want to write Java unit-tests for the JNI wrapper class.
Is there a way to unit-test the Android JNI .so
wrapper API from the desktop console e.g. on Windows? Maybe using a desktop Java framework but with all the Android SDK calls?
Since the class that calls into native is just a wrapper class, then you can just unit test the JNI layer. If that is what you want, then it would be a bit hard to unit test your JNI functions directly. However, you can still take the "core" of your JNI function that does all the work and put that in a separate .c file. So basically, you would include your new class in the JNI class and make that class do all the wor. Now, you would have a .c class with a set of methods that can be easily unit tested.
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With