1 Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3 
   4 This code is free software; you can redistribute it and\\\/or modify it
   5 under the terms of the GNU General Public License version 2 only, as
   6 published by the Free Software Foundation.
   7 This code is distributed in the hope that it will be useful, but WITHOUT
   8 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   9 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  10 version 2 for more details (a copy is included in the LICENSE file that
  11 accompanied this code).
  12 
  13 You should have received a copy of the GNU General Public License version
  14 2 along with this work; if not, write to the Free Software Foundation,
  15 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  16 
  17 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  18 or visit www.oracle.com if you need additional information or have any
  19 questions.
  20 
  21 ---------------------------------------------------------------------------------
  22 
  23 This directory contains source files of testbase_nsk JNI framework,
  24 which provides support for JNI tests and accessing JNI environment.
  25 
  26     Source files:
  27         jni_tools.h
  28         jni_tools.c
  29 
  30     Naming conventions:
  31         macroses:  NSK_JNI_*
  32         functions: nsk_JNI_*
  33 
  34 ---------------------------------------------------------------------------------
  35 
  36 jni_tools.h
  37 
  38 Provides functions and macroses for invocation of JNI functions
  39 and checking JNI errors and pending exceptions:
  40 
  41     NSK_JNI_VERIFY(jni, action)
  42     NSK_JNI_VERIFY_NEGATIVE(jni, action)
  43 
  44 Typical example of usage of NSK_JNI_VERIFY and NSK_CPP_STUB macroses
  45 for invokation of JNI functions:
  46 
  47     // jni->FindClass(jni, class_name)
  48     if (!NSK_JNI_VERIFY(jni,
  49             jni->FindClass(class_name) != NULL)) {
  50         return JNI_ERR;
  51     }
  52 
  53 or with saving obtained data:
  54 
  55     // cls = jni->FindClass(jni, class_name)
  56     if (!NSK_JNI_VERIFY(jni, (cls =
  57             jni->FindClass(class_name)) != NULL)) {
  58         return JNI_ERR;
  59     }
  60 
  61 ---------------------------------------------------------------------------------