Back to index

lightning-sunbird  0.9+nobinonly
NewObjectA_1.cpp File Reference
#include "JNIEnvTests.h"
#include "ObjectOperations.h"

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_NewObjectA_1)

Function Documentation

JNI_OJIAPITest ( JNIEnv_NewObjectA_1  )

Definition at line 40 of file NewObjectA_1.cpp.


  IMPLEMENT_GetMethodID_METHOD("Test1", "<init>", "(I)V");
  jvalue args[1];
  args[0].i = 555;
  jobject obj_new = env->NewObjectA(clazz, MethodID, args);
  jfieldID fieldID = env->GetFieldID(clazz, "name_int", "I");
  printf("the name_int value is: %d\n\n", env->GetIntField(obj_new, fieldID));
  if(env->GetIntField(obj_new, fieldID) == 555){
      return TestResult::PASS("NewObjectA(all correct, int field) return correct value");
      return TestResult::FAIL("NewObjectA(all correct, int field) return incorrect value");

Here is the call graph for this function: