Back to index

lightning-sunbird  0.9+nobinonly
Functions
GetMethodID_14.cpp File Reference
#include "JNIEnvTests.h"
#include "CallingInstanceMethods.h"
#include "Test1.h"

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_GetMethodID_14)
JNIEXPORT void JNICALL Java_Test11_mprint (JNIEnv *env, jobject obj, jint jInt)

Function Documentation

JNIEXPORT void JNICALL Java_Test11_mprint ( JNIEnv env,
jobject  obj,
jint  jInt 
)

Definition at line 61 of file GetMethodID_14.cpp.

                                        {

  jclass clazz = env->FindClass("Test11");
  if(clazz==NULL) {
      printf("There is no such class\n ");
  }
  jmethodID JPrintMethodID = env->GetMethodID(clazz, "jprint", "(I)V");
  printf("ID of get method = %d\n",(int)JPrintMethodID);
  env->CallVoidMethod(obj, JPrintMethodID, (int)jInt);

    printf("OK!!!\n");
}
JNI_OJIAPITest ( JNIEnv_GetMethodID_14  )

Definition at line 41 of file GetMethodID_14.cpp.

{
  GET_JNI_FOR_TEST
  IMPLEMENT_GetMethodID_METHOD("Test11", "mprint", "(I)V");
  if(clazz == NULL){
      printf("Class is NULL!!!");
  }
  env->CallVoidMethod(obj, MethodID, 100);
  if(MethodID != NULL){
     return TestResult::PASS("GetMethodID for public native method from non-abstract class, not inherited return correct value");
  }else{
     return TestResult::FAIL("GetMethodID for public native method from non-abstract class, not inherited return incorrect value");
  }
}

Here is the call graph for this function: