diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-04-10 17:43:43 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-04-10 17:43:43 (GMT) |
commit | a9662ba9fbe29c53d86f7bd2d1ec0547b2a154ac (patch) | |
tree | 6b7db8b493af9697ab8bfc87dda5ed958edb0a20 /java/test/TestH5E.java | |
parent | f015c89c5e6b2482178fb0288f670be510cd0d23 (diff) | |
download | hdf5-a9662ba9fbe29c53d86f7bd2d1ec0547b2a154ac.zip hdf5-a9662ba9fbe29c53d86f7bd2d1ec0547b2a154ac.tar.gz hdf5-a9662ba9fbe29c53d86f7bd2d1ec0547b2a154ac.tar.bz2 |
Move two more functions from unit tests
Diffstat (limited to 'java/test/TestH5E.java')
-rw-r--r-- | java/test/TestH5E.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index 1eb1914..aefddfa 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -73,6 +73,62 @@ public class TestH5E { } @Test + public void testH5Eget_msg_major() { + + try { + H5.H5Fopen("test", 0, 1); + } + catch (HDF5LibraryException hdferr) { + int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; + String msg = null; + try { + msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), + error_msg_type); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertNotNull("H5.H5Eget_msg: " + msg, msg); + assertEquals("H5.H5Eget_msg: ", "Object atom", + msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, + error_msg_type[0]); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + } + + @Test + public void testH5Eget_msg_minor() { + try { + H5.H5Fopen("test", 0, 1); + } + catch (HDF5LibraryException hdferr) { + int[] error_msg_type = { HDF5Constants.H5E_MINOR }; + String msg = null; + try { + msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), + error_msg_type); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + assertNotNull("H5.H5Eget_msg: " + msg, msg); + assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, + error_msg_type[0]); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eget_msg: " + err); + } + } + + @Test public void testH5Epop() { try { H5.H5Eset_current_stack(current_stackid); |