Back to index

lightning-sunbird  0.9+nobinonly
GetCharArrayElements_2.cpp File Reference
#include "JNIEnvTests.h"
#include "ArrayOperations.h"

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetCharArrayElements_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetCharArrayElements_2  )

Definition at line 40 of file GetCharArrayElements_2.cpp.


  jcharArray arr = env->NewCharArray(5);
  jsize start = 0;
  jsize leng = 3;
  jchar buf[3];
  buf[0] = 'a';
  buf[1] = 'z';
  buf[2] = 0;
  env->SetCharArrayRegion(arr, start, leng, buf);

  jboolean isCopy = JNI_TRUE;
  jchar *val = env->GetCharArrayElements(arr, NULL);
  jchar val0 = val[0];
  jchar val1 = val[1];
  jchar val2 = val[2];

     return TestResult::PASS("GetCharArrayElements(arr, NULL) returns correct value");
     return TestResult::FAIL("GetCharArrayElements(arr, NULL) returns incorrect value");


Here is the call graph for this function: