Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetStaticObjectField_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetStaticObjectField_2  )

Definition at line 40 of file GetStaticObjectField_2.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, NULL);
  if(value == NULL){
     printf("Value is NULL!!\n\nIt's correct!\n");
     return TestResult::PASS("GetStaticObjectField(fieldID == NULL) return NULL");
     return TestResult::FAIL("GetStaticObjectField(fieldID == NULL) return non-NULL!!!!");


Here is the call graph for this function: