Back to index

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

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_GetMethodID_32)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetMethodID_32  )

Definition at line 40 of file GetMethodID_32.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>", "()V");

  char *path = "asdf";
  jstring jpath=env->NewStringUTF("sdsadasdasd");
  jobject obj1 = env->NewObject(clazz, MethodID, NULL);
  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 private constructor in non-abstract class return correct value");
     }else{
       if(SecENV){
         return TestResult::FAIL("GetMethodID for private constructor in non-abstract class return incorrect value");
       }else{
         return TestResult::PASS("GetMethodID for private constructor in non-abstract class return correct value");
       }
     }
  }else{
    return TestResult::FAIL("GetMethodID for private constructor in non-abstract class return incorrect value");
  }
}

Here is the call graph for this function: