Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers committed Dec 12, 2024
1 parent 7c405a0 commit 332b0cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/native/CreateVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ void print_error(jint ret)
int main()
{
const int arguments = 4;

std::cout << "Starting JNI_CreateJavaVM test" << std::endl;


JavaVM *jvm; /* denotes a Java VM */
JNIEnv *env; /* pointer to native method interface */

int numVms = 0;

std::cout << "Starting JNI_GetCreatedJavaVMs test" << std::endl;

jint ret = JNI_GetCreatedJavaVMs(&jvm, 1, &numVms);
if (ret != JNI_OK)
{
Expand All @@ -40,7 +40,7 @@ int main()
}

JavaVMInitArgs vm_args; /* JDK/JRE 6 VM initialization arguments */
std::cout << "Starting JNI_GetDefaultJavaVMInitArgs test" << std::endl;
ret = JNI_GetDefaultJavaVMInitArgs(&vm_args);
if (ret != JNI_OK)
{
Expand All @@ -59,14 +59,14 @@ int main()
vm_args.ignoreUnrecognized = true;
/* load and initialize a Java VM, return a JNI interface
* pointer in env */
std::cout << "Starting JNI_CreateJavaVM test" << std::endl;
ret = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
delete[] options;
if (ret != JNI_OK)
{
print_error(ret);
return 1;
}

delete[] options;
/* invoke the Main.test method using the JNI */
// jclass cls = env->FindClass("Main");
// jmethodID mid = env->GetStaticMethodID(cls, "test", "(I)V");
Expand Down

0 comments on commit 332b0cd

Please sign in to comment.