diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-02-11 16:58:58 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-02-11 16:58:58 (GMT) |
commit | cc6a61215e508d047ed6aa2daf67475cfe34ee4d (patch) | |
tree | 01ff3ca929838ede9e5eba30dfcc3881f2e9523f /java/test | |
parent | 4300ca623482508d19caf427fdadce86f811e347 (diff) | |
download | hdf5-cc6a61215e508d047ed6aa2daf67475cfe34ee4d.zip hdf5-cc6a61215e508d047ed6aa2daf67475cfe34ee4d.tar.gz hdf5-cc6a61215e508d047ed6aa2daf67475cfe34ee4d.tar.bz2 |
Re-write of Java JNI error handling
Diffstat (limited to 'java/test')
-rw-r--r-- | java/test/TestH5.java | 17 | ||||
-rw-r--r-- | java/test/testfiles/JUnit-TestH5.txt | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 54603ca..c59101b 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -177,6 +177,23 @@ public class TestH5 { for (int i = 0; i < 2; i++) assertFalse(libversion[i] == 0); } + + /** + * Test method for {@link hdf.hdf5lib.H5#H5get_libversion(int[])} + * to ensure a null libversion parameter causes the function to + * fail. + */ + @Test + public void testH5get_libversion_null_param() { + try { + H5.H5get_libversion(null); + } + catch (Throwable err) { + return; + } + + fail("H5.H5get_libversion: succeeded with a null libversion parameter!"); + } /** * Test method for diff --git a/java/test/testfiles/JUnit-TestH5.txt b/java/test/testfiles/JUnit-TestH5.txt index 37c5b65..b282a91 100644 --- a/java/test/testfiles/JUnit-TestH5.txt +++ b/java/test/testfiles/JUnit-TestH5.txt @@ -1,4 +1,5 @@ JUnit version 4.11 +.testH5get_libversion_null_param .testJ2C .testIsSerializable .testH5garbage_collect @@ -11,5 +12,5 @@ JUnit version 4.11 Time: XXXX -OK (9 tests) +OK (10 tests) |