Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_CallStaticIntMethod_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_CallStaticIntMethod_2  )

Definition at line 40 of file CallStaticIntMethod_2.cpp.


  IMPLEMENT_GetStaticMethodID_METHOD("Test1", "Get_static_int_field", "()I");
  jfieldID fieldID = env->GetStaticFieldID(clazz, "static_name_int", "I");
  env->SetStaticIntField(clazz, fieldID, 11);
  jvalue *args = new jvalue[1];
  args[0].i = 10;

  jint value = env->CallStaticIntMethodA(clazz, MethodID, args);
  printf("The static int field in clazz is : %d\n", (int)value);
  if((MethodID!=NULL) && (value == 11)){
      return TestResult::PASS("CallStaticIntMethodA with sig = \"()I\" return correct value");
      return TestResult::FAIL("CallStaticIntMethodA with sig = \"()I\" return incorrect value");


Here is the call graph for this function: