Back to index

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

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_GetStaticMethodID_15)
JNIEXPORT void JNICALL Java_Test11_mprint_1static (JNIEnv *env, jclass clazz, jint jInt)

Function Documentation

Definition at line 60 of file GetStaticMethodID_15.cpp.

                                         {

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

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

Definition at line 41 of file GetStaticMethodID_15.cpp.

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

Here is the call graph for this function: