Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_SetIntArrayRegion_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_SetIntArrayRegion_2  )

Definition at line 40 of file SetIntArrayRegion_2.cpp.


  jintArray arr = env->NewIntArray(3);
  jsize start = 0;
  jsize leng = 3;
  jint buf[3];
  buf[0] = MAX_JINT;
  buf[1] = MIN_JINT;
  buf[2] = 0;
  env->SetIntArrayRegion(arr, start, leng, NULL);

  jboolean isCopy = JNI_TRUE;
  jint *val = env->GetIntArrayElements(arr, &isCopy);
  jint val0 = val[0];
  jint val1 = val[1];
  jint val2 = val[2];

     return TestResult::PASS("SetIntArrayRegion(with buf as NULL) returns correct value");
     return TestResult::FAIL("SetIntArrayRegion(with buf as NULL) returns incorrect value");

Here is the call graph for this function: