Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetStaticObjectField_3)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetStaticObjectField_3  )

Definition at line 40 of file GetStaticObjectField_3.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 negative) return NULL");
     return TestResult::FAIL("GetStaticObjectField(fieldID is incorrect negative) return non-NULL!!!!");


Here is the call graph for this function: