Back to index

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

Go to the source code of this file.


 JNI_OJIAPITest (JNIEnv_Throw_2)

Function Documentation

JNI_OJIAPITest ( JNIEnv_Throw_2  )

Definition at line 40 of file Throw_2.cpp.


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

Here is the call graph for this function: