Back to index

lightning-sunbird  0.9+nobinonly
Throw_1.cpp File Reference
#include "JNIEnvTests.h"
#include "Exceptions.h"

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_Throw_1)

Function Documentation

JNI_OJIAPITest ( JNIEnv_Throw_1  )

Definition at line 40 of file Throw_1.cpp.


  jclass clazz = env->FindClass("Ljava/lang/ArrayIndexOutOfBoundsException;");
  jthrowable obj = (jthrowable)env->AllocObject(clazz);
  jint res = env->Throw(obj);
  jthrowable excep  = env->ExceptionOccurred();
  if((env->IsInstanceOf(excep, clazz)) && (res == 0)){
    printf("ArrayIndexOutOfBoundsException is thrown. It is correct!\n");
    return TestResult::PASS("Throw(java.lang.ArrayIndexOutOfBoundsException) returns correct value and thrown ArrayIndexOutOfBoundsException");
    return TestResult::FAIL("Throw(java.lang.ArrayIndexOutOfBoundsException) does not thrown ArrayIndexOutOfBoundsException");

Here is the call graph for this function: