-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mobile: Add initial unit tests for jni_utility.(h|cc) #30849
Conversation
This PR sets up an initial infrastructure for writing unit tests for `jni_utility.(h|cc)`. Signed-off-by: Fredy Wijaya <[email protected]>
71a1cf8
to
098ca39
Compare
/assign @abeyad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great!
// `test/java/io/envoyproxy/envoymobile/jni/JniUtilityTest.java` unit tests. | ||
|
||
extern "C" JNIEXPORT jbyteArray JNICALL | ||
Java_io_envoyproxy_envoymobile_jni_JniUtilityTest_protoJavaByteArrayConversion(JNIEnv* env, jclass, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so for every JNI method we want to test, we'll need a native test method in this file that does the similar to the function bodyhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. This is how we can call those functions from Java/Kotlin.
This PR sets up an initial infrastructure for writing unit tests for `jni_utility.(h|cc)`. Signed-off-by: Fredy Wijaya <[email protected]> Signed-off-by: Alyssa Wilk <[email protected]>
Prior to this PR,
jni_utility.(h|cc)
did not have any unit tests, which would make refactoring that file a bit risky. This PR sets up an initial infrastructure for writing unit tests forjni_utility.(h|cc)
as well as adds an example unit test, so that we can slowly add unit tests for the functions defined in that file as well as requiring unit tests for future changes to that file.Risk Level: low (adding unit tests only)
Testing: unit tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: mobile