Back to index

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

Go to the source code of this file.

Functions

 JNI_OJIAPITest (JNIEnv_ThrowNew_4)

Function Documentation

JNI_OJIAPITest ( JNIEnv_ThrowNew_4  )

Definition at line 40 of file ThrowNew_4.cpp.

{
  GET_JNI_FOR_TEST

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

Here is the call graph for this function: