Back to index

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

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_GetIntArrayRegion_3)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetIntArrayRegion_3  )

Definition at line 40 of file GetIntArrayRegion_3.cpp.

{
  GET_JNI_FOR_TEST

  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, buf);

  jint val[3];
  env->GetIntArrayRegion(NULL, start, leng, val);

  if((val[0]==0)&&(val[1]==0)&&(val[2]==0)){
     return TestResult::PASS("GetIntArrayRegion(arr = NULL) returns correct value");
  }else{
     return TestResult::FAIL("GetIntArrayRegion(arr = NULL) returns incorrect value");
  }
}

Here is the call graph for this function: