Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_CallNonvirtualIntMethod_5)

Function Documentation

JNI_OJIAPITest ( JNIEnv_CallNonvirtualIntMethod_5  )

Definition at line 40 of file CallNonvirtualIntMethod_5.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->CallNonvirtualIntMethodA(obj, env->GetSuperclass(clazz), MethodID, args);
  printf("The int field in clazz is : %d\n", (int)value);
  if((MethodID!=NULL) && (value == 11)){
      return TestResult::PASS("CallNonvirtualIntMethodA with sig = \"()I\" return correct value");
      return TestResult::FAIL("CallNonvirtualIntMethodA with sig = \"()I\" return incorrect value");


Here is the call graph for this function: