Back to index

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

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_GetFieldID_17)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetFieldID_17  )

Definition at line 40 of file GetFieldID_17.cpp.

{
  GET_JNI_FOR_TEST

  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");
  }else{
    return TestResult::FAIL("GetFieldID(all right for super object (java/lang/String)) failed");
  }

}

Here is the call graph for this function: