diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | java/test/JUnit-unit.txt | 7 | ||||
-rw-r--r-- | java/test/Makefile.am | 1 | ||||
-rw-r--r-- | java/test/TestH5E.java | 18 | ||||
-rw-r--r-- | java/test/TestH5Edefault.java | 62 | ||||
-rw-r--r-- | java/test/TestH5Eparams.java | 15 | ||||
-rw-r--r-- | java/test/TestH5Eregister.java | 3 | ||||
-rw-r--r-- | java/test/TestUnit.java | 2 |
8 files changed, 42 insertions, 68 deletions
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 10a38b0..c48cf01 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES ( set (HDF5_JAVA_TEST_SOURCES TestH5.java TestH5Eparams.java + TestH5Eregister.java TestH5Fparams.java TestH5Fbasic.java TestH5F.java @@ -58,7 +59,6 @@ else () ${HDF5_JAVA_TEST_SOURCES} TestH5E.java TestH5Edefault.java - TestH5Eregister.java TestH5Giterate.java TestAll.java ) diff --git a/java/test/JUnit-unit.txt b/java/test/JUnit-unit.txt index 3e139cbe..7efc915 100644 --- a/java/test/JUnit-unit.txt +++ b/java/test/JUnit-unit.txt @@ -21,6 +21,11 @@ JUnit version 4.11 .testH5Ecreate_msg_name_null .testH5Eauto_is_v2 .testH5EclearInt +.testH5Eregister_class_lib_name_null +.testH5Eregister_class_version_null +.testH5Eunregister_class_invalid_classid +.testH5Eregister_class +.testH5Eregister_class_cls_name_null .testH5Fcreate_null .testH5Fflush_local .testH5Fget_info @@ -608,5 +613,5 @@ JUnit version 4.11 Time: XXXX -OK (606 tests) +OK (611 tests) diff --git a/java/test/Makefile.am b/java/test/Makefile.am index 9ed8517..f9db7ed 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -36,6 +36,7 @@ AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation noinst_JAVA = \ TestH5.java \ TestH5Eparams.java \ + TestH5Eregister.java \ TestH5Fparams.java \ TestH5Fbasic.java \ TestH5F.java \ diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index aefddfa..dfa2064 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -47,8 +47,7 @@ public class TestH5E { hdf_java_classid = -1; try { - hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", - "hdf-java", "2.5"); + hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", "hdf-java", "2.5"); current_stackid = H5.H5Eget_current_stack(); } catch (Throwable err) { @@ -82,18 +81,15 @@ public class TestH5E { int[] error_msg_type = { HDF5Constants.H5E_MAJOR }; String msg = null; try { - msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(), - error_msg_type); + 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]); + assertEquals("H5.H5Eget_msg: ", "Object atom", msg); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, error_msg_type[0]); } catch (Throwable err) { err.printStackTrace(); @@ -110,8 +106,7 @@ public class TestH5E { int[] error_msg_type = { HDF5Constants.H5E_MINOR }; String msg = null; try { - msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), - error_msg_type); + msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(), error_msg_type); } catch (Throwable err) { err.printStackTrace(); @@ -119,8 +114,7 @@ public class TestH5E { } 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]); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR, error_msg_type[0]); } catch (Throwable err) { err.printStackTrace(); diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 79f75c8..50367b9 100644 --- a/java/test/TestH5Edefault.java +++ b/java/test/TestH5Edefault.java @@ -91,8 +91,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4); //Save a copy of the current stack and clears the current stack try { @@ -102,10 +101,8 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id < 0); - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id == stack_id_default); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id < 0); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id == stack_id_default); // Verify we have the correct number of messages try { @@ -115,8 +112,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 0); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 0); //Verify the copy has the correct number of messages try { @@ -158,8 +154,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4); //Save a copy of the current stack and clears the current stack try { @@ -169,10 +164,8 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id < 0); - assertFalse("H5.H5Eget_current_stack: get_current_stack - " - + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id < 0); + assertFalse("H5.H5Eget_current_stack: get_current_stack - " + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); // Verify we have the correct number of messages try { @@ -182,8 +175,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 0); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 0); //Verify the copy has the correct number of messages try { @@ -193,8 +185,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4); //Generate errors on default stack try { @@ -212,8 +203,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, - num_msg_default == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 4); //Remove one message from the current stack try { @@ -224,8 +214,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, - num_msg_default == 3); + assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, num_msg_default == 3); //Verify the copy still has the correct number of messages try { @@ -235,8 +224,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 4); } @Test(expected = IllegalArgumentException.class) @@ -306,8 +294,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); //Save a copy of the current stack try { @@ -317,10 +304,8 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertFalse("H5.H5Eset_current_stack: get_current_stack - " - + stack_id, stack_id < 0); - assertFalse("H5.H5Eset_current_stack: get_current_stack - " - + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); + assertFalse("H5.H5Eset_current_stack: get_current_stack - " + stack_id, stack_id < 0); + assertFalse("H5.H5Eset_current_stack: get_current_stack - " + stack_id, stack_id == HDF5Constants.H5E_DEFAULT); //Verify the copy has the correct number of messages try { @@ -330,8 +315,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); //Generate errors on default stack try { @@ -349,8 +333,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); //Remove one message from the current stack try { @@ -361,8 +344,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, num_msg == 3); //Verify the copy still has the correct number of messages try { @@ -372,8 +354,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 4); try { H5.H5Eset_current_stack(stack_id); @@ -492,8 +473,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eclear2_with_msg: " + err); } - assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, - num_msg == 4); + assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, num_msg == 4); try { H5.H5Eclear2(HDF5Constants.H5E_DEFAULT); num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT); @@ -502,7 +482,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eclear2_with_msg: " + err); } - assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == 0); + assertTrue("H5.H5Eclear2_with_msg after #:" + num_msg, num_msg == 0); } @Test(expected = IllegalArgumentException.class) diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java index e3c8b0e..0c55577 100644 --- a/java/test/TestH5Eparams.java +++ b/java/test/TestH5Eparams.java @@ -47,8 +47,7 @@ public class TestH5Eparams { hdf_java_classid = -1; try { - hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", - "hdf-java", "2.5"); + hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", "hdf-java", "2.5"); current_stackid = H5.H5Eget_current_stack(); } catch (Throwable err) { @@ -110,8 +109,7 @@ public class TestH5Eparams { @Test public void testH5Ecreate_msg_major() { try { - long err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MAJOR, "Error in Test"); + long err_id = H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, "Error in Test"); assertFalse("H5.H5Ecreate_msg_major: " + err_id, err_id < 0); H5.H5Eclose_msg(err_id); } @@ -124,8 +122,7 @@ public class TestH5Eparams { @Test public void testH5Ecreate_msg_minor() { try { - long err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MINOR, "Error in Test Function"); + long err_id = H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MINOR, "Error in Test Function"); assertFalse("H5.H5Ecreate_msg_minor: " + err_id, err_id < 0); H5.H5Eclose_msg(err_id); } @@ -141,8 +138,7 @@ public class TestH5Eparams { long err_id = -1; String msg = null; try { - err_id = H5.H5Ecreate_msg(hdf_java_classid, - HDF5Constants.H5E_MAJOR, "Error in Test"); + err_id = H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, "Error in Test"); } catch (Throwable err) { err.printStackTrace(); @@ -158,8 +154,7 @@ public class TestH5Eparams { } assertNotNull("H5.H5Eget_msg: " + msg, msg); assertEquals("H5.H5Eget_msg: ", "Error in Test", msg); - assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, - error_msg_type[0]); + assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR, error_msg_type[0]); try { H5.H5Eclose_msg(err_id); } diff --git a/java/test/TestH5Eregister.java b/java/test/TestH5Eregister.java index 742b47f..1b87699 100644 --- a/java/test/TestH5Eregister.java +++ b/java/test/TestH5Eregister.java @@ -60,8 +60,7 @@ public class TestH5Eregister { public void testH5Eregister_class() { long hdf_java_classid = -1; try { - hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", - "hdf-java", "2.5"); + hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error", "hdf-java", "2.5"); } catch (Throwable err) { fail("H5.H5Eregister_class: " + err); diff --git a/java/test/TestUnit.java b/java/test/TestUnit.java index b55e415..e98fd4f 100644 --- a/java/test/TestUnit.java +++ b/java/test/TestUnit.java @@ -18,7 +18,7 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses( { TestH5.class, - TestH5Eparams.class, + TestH5Eparams.class, TestH5Eregister.class, TestH5Fparams.class, TestH5Fbasic.class, TestH5F.class, TestH5Fswmr.class, TestH5Gbasic.class, TestH5G.class, TestH5Sbasic.class, TestH5S.class, |