diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-04-10 18:06:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-04-10 18:06:56 (GMT) |
commit | c8974b8a9e49aba96c93f9efa8977a5c57a35a07 (patch) | |
tree | d39b5466089be112fead20e08511e3a5c4d49d71 /java | |
parent | df83d7813466fcb38b344361960681354a54af2a (diff) | |
download | hdf5-c8974b8a9e49aba96c93f9efa8977a5c57a35a07.zip hdf5-c8974b8a9e49aba96c93f9efa8977a5c57a35a07.tar.gz hdf5-c8974b8a9e49aba96c93f9efa8977a5c57a35a07.tar.bz2 |
Whitespace and test reclassify merge from develop
Diffstat (limited to 'java')
-rw-r--r-- | java/test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | java/test/JUnit-interface.txt | 4 | ||||
-rw-r--r-- | java/test/JUnit-unit.txt | 9 | ||||
-rw-r--r-- | java/test/Makefile.am | 1 | ||||
-rw-r--r-- | java/test/TestH5E.java | 54 | ||||
-rw-r--r-- | java/test/TestH5Edefault.java | 68 | ||||
-rw-r--r-- | java/test/TestH5Eparams.java | 71 | ||||
-rw-r--r-- | java/test/TestH5Eregister.java | 3 | ||||
-rw-r--r-- | java/test/TestUnit.java | 2 |
9 files changed, 92 insertions, 122 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-interface.txt b/java/test/JUnit-interface.txt index 9518817..5758863 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -9,8 +9,6 @@ JUnit version 4.11 .testH5get_libversion .testH5set_free_list_limits .testH5EprintInt -.testH5Eget_msg_major -.testH5Eget_msg_minor .testH5Eget_msg .testH5Eget_num .testH5Eget_class_name @@ -56,6 +54,8 @@ JUnit version 4.11 .testH5Ecreate_msg_invalid_errid .testH5Eclear2_invalid_stkid .testH5Eprint2_invalid_classid +.testH5Eget_msg_major +.testH5Eget_msg_minor .testH5Epush .testH5Ewalk .testH5Epop diff --git a/java/test/JUnit-unit.txt b/java/test/JUnit-unit.txt index fa33165..3ace4fa 100644 --- a/java/test/JUnit-unit.txt +++ b/java/test/JUnit-unit.txt @@ -9,8 +9,6 @@ JUnit version 4.11 .testH5get_libversion .testH5set_free_list_limits .testH5EprintInt -.testH5Eget_msg_major -.testH5Eget_msg_minor .testH5Eget_msg .testH5Eget_num .testH5Eget_class_name @@ -23,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 @@ -610,5 +613,5 @@ JUnit version 4.11 Time: XXXX -OK (608 tests) +OK (606 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 fe12694..1c0803a 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) { @@ -73,6 +72,57 @@ 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: ", "Invalid arguments to routine", 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: ", "Inappropriate type", 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); diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 835ccba..31f871e 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 == 3); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 3); //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 { @@ -126,8 +122,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 3); try { H5.H5Eclose_stack(stack_id); @@ -158,8 +153,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 == 3); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 3); //Save a copy of the current stack and clears the current stack try { @@ -169,10 +163,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 +174,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 +184,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 3); //Generate errors on default stack try { @@ -212,8 +202,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 == 3); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg_default, num_msg_default == 3); //Remove one message from the current stack try { @@ -224,8 +213,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, - num_msg_default == 2); + assertTrue("H5.H5Eget_current_stack: pop #:" + num_msg_default, num_msg_default == 2); //Verify the copy still has the correct number of messages try { @@ -235,8 +223,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eget_current_stack: get_num #:" + num_msg, num_msg == 3); } @Test(expected = IllegalArgumentException.class) @@ -306,8 +293,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 3); //Save a copy of the current stack try { @@ -317,10 +303,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 +314,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 3); //Generate errors on default stack try { @@ -349,8 +332,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eget_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 3); //Remove one message from the current stack try { @@ -361,8 +343,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, - num_msg == 2); + assertTrue("H5.H5Eset_current_stack: pop #:" + num_msg, num_msg == 2); //Verify the copy still has the correct number of messages try { @@ -372,8 +353,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eset_current_stack: get_num #:" + num_msg, num_msg == 3); try { H5.H5Eset_current_stack(stack_id); @@ -383,8 +363,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eset_current_stack: " + err); } - assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, - num_msg == 3); + assertTrue("H5.H5Eset_current_stack: get_num - " + num_msg, num_msg == 3); } @Test(expected = IllegalArgumentException.class) @@ -492,8 +471,7 @@ public class TestH5Edefault { err.printStackTrace(); fail("H5.H5Eclear2_with_msg: " + err); } - assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, - num_msg == 3); + assertTrue("H5.H5Eclear2_with_msg before #:" + num_msg, num_msg == 3); try { H5.H5Eclear2(HDF5Constants.H5E_DEFAULT); num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT); @@ -502,7 +480,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 63e2c62..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); } @@ -170,62 +165,6 @@ public class TestH5Eparams { } @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: ", "Invalid arguments to routine", - 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: ", "Inappropriate type", 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 testH5Ecreate_stack() { long stk_id = -1; try { 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, |