Back to index

lightning-sunbird  0.9+nobinonly
GetObjectField_5.cpp File Reference
#include "JNIEnvTests.h"
#include "AccessingFields.h"

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetObjectField_5)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetObjectField_5  )

Definition at line 40 of file GetObjectField_5.cpp.


  IMPLEMENT_GetFieldID_METHOD("Test1", "name_string", "Ljava/lang/String;");
  jstring jpath=env->NewStringUTF("asdf");
  env->SetObjectField(obj, fieldID, jpath);
  jstring value = (jstring)env->GetObjectField(obj, fieldID);
  char* str_chars_ret = (char *) env->GetStringUTFChars(value, NULL);
  printf("value = %s\n", value);
  if(strcmp(str_chars_ret, "asdf") == 0){
    return TestResult::PASS("GetObjectField(all correct) return correct value");
    return TestResult::FAIL("GetObjectField(all correct) return incorrect value");

Here is the call graph for this function: