Back to index

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

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_GetMethodID_26)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetMethodID_26  )

Definition at line 40 of file GetMethodID_26.cpp.

{
  GET_JNI_FOR_TEST

  jclass clazz_exp = env->FindClass("Ljava/security/PrivilegedActionException;");
  if(clazz_exp == NULL){ printf("clazz_exp is NULL\n");}
  IMPLEMENT_GetMethodID_METHOD("Test1", "<init>", "(Z)V");

  char *path = "asdf";
  jstring jpath=env->NewStringUTF("sdsadasdasd");
  jobject obj1 = env->NewObject(clazz, MethodID, JNI_TRUE);
  jthrowable excep = env->ExceptionOccurred();
  if(MethodID!=NULL){
     if((excep != NULL) && (env->IsInstanceOf(excep, clazz_exp))){
       printf("Exception Occurred, it is correct!!!!\n");
       return TestResult::PASS("GetMethodID for protected constructor in non-abstract class return correct value");
     }else{
       if(SecENV){
         return TestResult::FAIL("GetMethodID for protected constructor in non-abstract class return incorrect value");
       }else{
         return TestResult::PASS("GetMethodID for protected constructor in non-abstract class return correct value");
       }
     }
  }else{
    return TestResult::FAIL("GetMethodID for protected constructor in non-abstract class return incorrect value");
  }

}

Here is the call graph for this function: