Back to index

lightning-sunbird  0.9+nobinonly
GetStaticObjectField_4.cpp File Reference
#include "JNIEnvTests.h"
#include "AccessingStaticFields.h"

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetStaticObjectField_4)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetStaticObjectField_4  )

Definition at line 40 of file GetStaticObjectField_4.cpp.


  IMPLEMENT_GetStaticFieldID_METHOD("Test1", "static_name_string", "Ljava/lang/String;");
  jchar str_chars1[]={'a', 's', 'd', 'f'};

  jstring str = env->NewString(str_chars1, 4); 
  env->SetStaticObjectField(clazz, fieldID, str);
  jstring value = (jstring)env->GetStaticObjectField(clazz, (jfieldID)100);
  if(value == NULL){
     printf("Value is NULL!!\n\nIt's correct!\n");
     return TestResult::PASS("GetStaticObjectField(fieldID is incorrect positive) return NULL");
     return TestResult::FAIL("GetStaticObjectField(fieldID is incorrect positive) return non-NULL!!!!");


Here is the call graph for this function: