Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetFieldID_17)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetFieldID_17  )

Definition at line 40 of file GetFieldID_17.cpp.


  IMPLEMENT_GetFieldID_METHOD("Test1", "name_string_super", "Ljava/lang/String;");
  jchar str_chars[]={'a', 's', 'd', 'f'};
  jstring str = env->NewString(str_chars, 4); 
  env->SetObjectField(obj, fieldID, str);
  jstring value = (jstring)env->GetObjectField(obj, fieldID);
  jboolean isCopy = TRUE;
  char* str_chars1 = (char *) env->GetStringUTFChars(value, &isCopy);
  jsize len = env->GetStringLength(value);
  if((fieldID != NULL) &&(len == 4)){
    return TestResult::PASS("GetFieldID(all right for super object (java/lang/String)) passed");
    return TestResult::FAIL("GetFieldID(all right for super object (java/lang/String)) failed");


Here is the call graph for this function: