Move two more functions from unit tests

This commit is contained in:
Allen Byrne 2018-04-10 12:43:43 -05:00
parent f015c89c5e
commit a9662ba9fb
4 changed files with 59 additions and 61 deletions

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
@ -610,5 +608,5 @@ JUnit version 4.11
Time: XXXX
OK (608 tests)
OK (606 tests)

View File

@ -72,6 +72,62 @@ 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: ", "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 {

View File

@ -169,62 +169,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: ", "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 testH5Ecreate_stack() {
long stk_id = -1;