README
1Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
2DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
4This code is free software; you can redistribute it and\\\/or modify it
5under the terms of the GNU General Public License version 2 only, as
6published by the Free Software Foundation.
7This code is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10version 2 for more details (a copy is included in the LICENSE file that
11accompanied this code).
12
13You should have received a copy of the GNU General Public License version
142 along with this work; if not, write to the Free Software Foundation,
15Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
16
17Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
18or visit www.oracle.com if you need additional information or have any
19questions.
20
21---------------------------------------------------------------------------------
22
23This directory contains source files of testbase_nsk JNI framework,
24which 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
36jni_tools.h
37
38Provides functions and macroses for invocation of JNI functions
39and checking JNI errors and pending exceptions:
40
41 NSK_JNI_VERIFY(jni, action)
42 NSK_JNI_VERIFY_NEGATIVE(jni, action)
43
44Typical example of usage of the NSK_JNI_VERIFY macro
45for 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
53or 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---------------------------------------------------------------------------------
62