Whitespace and test reclassify merge from develop

This commit is contained in:
Allen Byrne 2018-04-10 13:06:56 -05:00
parent df83d78134
commit c8974b8a9e
9 changed files with 92 additions and 122 deletions

View File

@ -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
)

View File

@ -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

View File

@ -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)

View File

@ -36,6 +36,7 @@ AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
noinst_JAVA = \
TestH5.java \
TestH5Eparams.java \
TestH5Eregister.java \
TestH5Fparams.java \
TestH5Fbasic.java \
TestH5F.java \

View File

@ -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) {
@ -72,6 +71,57 @@ public class TestH5E {
System.out.println();
}
@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 {

View File

@ -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)

View File

@ -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);
}
@ -169,62 +164,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;

View File

@ -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);

View File

@ -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,