Back to index

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

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_ThrowNew_5)

Function Documentation

JNI_OJIAPITest ( JNIEnv_ThrowNew_5  )

Definition at line 40 of file ThrowNew_5.cpp.

{
  GET_JNI_FOR_TEST

  jclass clazz = env->FindClass("Ljava/lang/String;");
  jthrowable obj = (jthrowable)env->AllocObject(clazz);
  jint res = env->ThrowNew(NULL, NULL);
  env->ExceptionDescribe();
  jthrowable excep  = env->ExceptionOccurred();
  if((excep == NULL) && (res < 0)){
    return TestResult::PASS("ThrowNew(NULL, NULL) returns correct value and not thrown any exception");
  }else{
    return TestResult::FAIL("ThrowNew(NULL, NULL) thrown exception");
  }
}

Here is the call graph for this function: