Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_SetShortArrayRegion_1)

Function Documentation

JNI_OJIAPITest ( JNIEnv_SetShortArrayRegion_1  )

Definition at line 40 of file SetShortArrayRegion_1.cpp.


  jshortArray arr = env->NewShortArray(3);
  jsize start = 0;
  jsize leng = 3;
  jshort buf[3];
  buf[0] = MAX_JSHORT;
  buf[1] = MIN_JSHORT;
  buf[2] = 0;
  env->SetShortArrayRegion(arr, start, leng, buf);

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

     return TestResult::PASS("SetShortArrayRegion(all right) returns correct value");
     return TestResult::FAIL("SetShortArrayRegion(all right) returns incorrect value");


Here is the call graph for this function: