Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_GetFloatArrayElements_3)

Function Documentation

JNI_OJIAPITest ( JNIEnv_GetFloatArrayElements_3  )

Definition at line 40 of file GetFloatArrayElements_3.cpp.


  jfloatArray arr = env->NewFloatArray(5);
  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, &isCopy);
  jfloat val0 = val[0];
  jfloat val1 = val[1];
  jfloat val2 = val[2];

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


Here is the call graph for this function: