Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_NewObject_1)

Function Documentation

JNI_OJIAPITest ( JNIEnv_NewObject_1  )

Definition at line 40 of file NewObject_1.cpp.


  IMPLEMENT_GetMethodID_METHOD("Test1", "<init>", "(I)V");
  jobject obj_new = env->NewObject(clazz, MethodID, 555);
  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("NewObject(all correct, int field) return correct value");
      return TestResult::FAIL("NewObject(all correct, int field) return incorrect value");


Here is the call graph for this function: