Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_CallIntMethod_1)

Function Documentation

JNI_OJIAPITest ( JNIEnv_CallIntMethod_1  )

Definition at line 40 of file CallIntMethod_1.cpp.


  IMPLEMENT_GetMethodID_METHOD("Test1", "Get_int_field", "()I");
  jfieldID fieldID = env->GetFieldID(clazz, "name_int", "I");
  env->SetIntField(obj, fieldID, 11);
  jint value = env->CallIntMethod(obj, MethodID, NULL);
  printf("The int field in clazz is : %d\n", (int)value);
  if((MethodID!=NULL) && (value == 11)){
      return TestResult::PASS("CallIntMethod with sig = \"()I\" return correct value");
      return TestResult::FAIL("CallIntMethod with sig = \"()I\" return incorrect value");


Here is the call graph for this function: