Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_SetCharArrayRegion_1)

Function Documentation

JNI_OJIAPITest ( JNIEnv_SetCharArrayRegion_1  )

Definition at line 40 of file SetCharArrayRegion_1.cpp.


  jcharArray arr = env->NewCharArray(3);
  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("SetCharArrayRegion(arr, NULL) returns correct value");
     return TestResult::FAIL("SetCharArrayRegion(arr, NULL) returns incorrect value");


Here is the call graph for this function: