Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetMethodID_5)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetMethodID_5  )

Definition at line 40 of file GetMethodID_5.cpp.


        jclass clazz = env->FindClass("Test1");
        if(clazz == NULL){ 
            return TestResult::FAIL("Cannot find class"); 
        jmethodID MethodID = env->GetMethodID(clazz, "name_not_exist", "(Ljava/lang/String;)V");
        printf("ID of method = %d\n", (int)MethodID); 

  //IMPLEMENT_GetMethodID_METHOD("Test1", "name_not_exist", "(Ljava/lang/String;)V");
  //env->CallVoidMethod(obj, MethodID, 10);

  if(MethodID == NULL && env->ExceptionOccurred()) {
    env->ExceptionDescribe(); //exception should be thrown){
    return TestResult::PASS("GetMethodID for not existing name return 0, its correct");
    return TestResult::FAIL("GetMethodID for not existing name doesnt return 0, its incorrect");

Here is the call graph for this function: