Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_SetFloatArrayRegion_1)

Function Documentation

JNI_OJIAPITest ( JNIEnv_SetFloatArrayRegion_1  )

Definition at line 40 of file SetFloatArrayRegion_1.cpp.


  jfloatArray arr = env->NewFloatArray(3);
  jsize start = 0;
  jsize leng = 3;
  jfloat buf[3];
  buf[0] = MAX_JFLOAT;
  buf[1] = MIN_JFLOAT;
  buf[2] = 0;
  env->SetFloatArrayRegion(arr, start, leng, buf);

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

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


Here is the call graph for this function: