Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetLongArrayElements_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetLongArrayElements_2  )

Definition at line 40 of file GetLongArrayElements_2.cpp.


  jlongArray arr = env->NewLongArray(5);
  jsize start = 0;
  jsize leng = 3;
  jlong buf[3];
  buf[0] = MAX_JLONG;
  buf[1] = MIN_JLONG;
  buf[2] = 0;
  env->SetLongArrayRegion(arr, start, leng, buf);

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

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


Here is the call graph for this function: