Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_CallIntMethod_15)

Function Documentation

JNI_OJIAPITest ( JNIEnv_CallIntMethod_15  )

Definition at line 40 of file CallIntMethod_15.cpp.


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


Here is the call graph for this function: