summaryrefslogtreecommitdiffstats
path: root/java/test/TestH5Edefault.java
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-04-25 06:20:52 (GMT)
committerGitHub <noreply@github.com>2022-04-25 06:20:52 (GMT)
commit63197e99f80b4c6d2aaf76f2d23c460ade1a5f5f (patch)
tree6c31237bf23d6720ea72718bd42bb03e56fd07b0 /java/test/TestH5Edefault.java
parente8bda8f3a4cc4d64c99216decae9073beb7eaf3b (diff)
downloadhdf5-63197e99f80b4c6d2aaf76f2d23c460ade1a5f5f.zip
hdf5-63197e99f80b4c6d2aaf76f2d23c460ade1a5f5f.tar.gz
hdf5-63197e99f80b4c6d2aaf76f2d23c460ade1a5f5f.tar.bz2
Onion VFD: Sync with develop (#1685)
* Removes unused definitions from module headers (#1624) * Fix these Doxygen warnings #1581 (#1589) * Fixes a typo in H5.c (#1639) * free MPI_Group/MPI_Comm/MPI_Datatype objects (#1638) * free MPI_Group/MPI_Comm/MPI_Datatype objects * fix clang-format style * Adds build and license shields to README.md (#1641) * First stab at a Github status bar * Adds a .tokeignore file for counting lines of code accurately * Yanks lines of code calculation since it wildly overcounts * not depend on doIO to free an MPI_Comm object (#1642) * free MPI datatypes previously created (#1637) * Retrieve MPI-IO hints used by MPI library after file open (#1636) H5Pget_fapl_mpio() should return an MPI info object containing all the MPI-IO hints used by the MPI library underneath, after the file is opened. Some hints, such as cb_nodes (number of I/O aggregators), are useful for HDF5 applications and I/O libraries built on top of HDF5. * OESS-168: Remove clang warnings. (#1309) * OESS-168: Remove clang warnings. * OESS-168: Address @lrknox review. * OESS-168: Remove clang warnings. (#1376) * Remove H5_NO_ALIGNMENT_RESTRICTIONS (#1426) * Do not conditionally compile code that uses a pointer dereference and assignment to copy a potentially unaligned variable to aligned automatic storage, or vice versa. Instead, always use naked `memcpy(3)`s. Disassembling the generated code reveals that the `memcpy(3)`s optimize (`-O3`) to a single `mov` instruction for x86_64, which is not strict about alignment. This change reduces the size of code and scripts by 143 lines, eases our way to cross-compilation, and avoids invoking undefined behavior. * Committing clang-format changes * Per discussion, use HD and add comments. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Cleans up some HL library code that inappropriately returns htri_t values cast to herr_t (#1651) * Cleans up some HL library code that inappropriately returns htri_t values cast to herr_t * Committing clang-format changes * Formatted source Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Mirror vfd test fixes (#1629) * Use the FAPL that was created earlier in the test (and delete an unused variable). This allows 'make check-vfd' to pass with --enable-mirror-vfd. * Check for testing directory before creating, to avoid warning from bash. Clean out .libs directory before re-using it (after a failed test), to remove any files generated by libtool. * Committing clang-format changes * Increment error count on failed file open and skip tests for VFDs that need modified filenames. * Skip the mirror VFD for 'make check-vfd' - the mirror VFD requires networking configuration parameters and can't be provided for an automated test that is configured with an environment variable. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes HDF Group paths, adds shellcheck fixes (#1656) For more information: https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2230 -- which is non-standard. Use builti... https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le... * HDFFV-11306 Fixed (#1657) * HDFFV-11306, * Fixed it so both h5open_f and h5close_f can be called multiple times. * Fixed an issue with open objects remaining after h5close_f was called. * Added additional tests. * comments clean-up * Develop clang format java (#1653) * added HDFFV-11306 entry (#1662) * Adds the -q flag to all swmr test programs, quieting noisy output (#1665) * Adds paths-ignore to the Github pull request workflow (#1663) * Changes Github action `hdf5 dev CI` to `PR hdf5 dev CI` (#1666) So the PR action name is not the same as the one in main.yml * Replace H5detect's build-time detection of C99 integer properties with a (#1400) * Replace H5detect's build-time detection of C99 integer properties with a table-driven routine, `H5T__init_native_int()`, that is run at library initialization time. * Improve handling of copying of dynamic libraries and clean them up after (#1681) test finishes. Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: Wei-keng Liao <wkliao@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: David Young <dyoung@hdfgroup.org> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Quincey Koziol <koziol@lbl.gov> Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
Diffstat (limited to 'java/test/TestH5Edefault.java')
-rw-r--r--java/test/TestH5Edefault.java161
1 files changed, 97 insertions, 64 deletions
diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java
index 9e93cea..c412cf2 100644
--- a/java/test/TestH5Edefault.java
+++ b/java/test/TestH5Edefault.java
@@ -15,25 +15,28 @@ package test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.Ignore;
import org.junit.rules.TestName;
public class TestH5Edefault {
- @Rule public TestName testname = new TestName();
+ @Rule
+ public TestName testname = new TestName();
public static final int ERRSTACK_CNT = 6;
@Before
- public void H5Eset_default_stack() {
- assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0);
+ public void H5Eset_default_stack()
+ {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount() == 0);
System.out.print(testname.getMethodName());
try {
@@ -46,23 +49,26 @@ public class TestH5Edefault {
}
}
@After
- public void nextTestName() {
+ public void nextTestName()
+ {
System.out.println();
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eprint2_invalid_classid() throws Throwable {
+ public void testH5Eprint2_invalid_classid() throws Throwable
+ {
H5.H5Eprint2(-1, null);
}
@Ignore
- public void testH5Eprint() {
+ public void testH5Eprint()
+ {
/*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector and the error stack might be different.
- * Only check for the specific error stack if the native
- * connector is being used.
- */
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector and the error stack might be different.
+ * Only check for the specific error stack if the native
+ * connector is being used.
+ */
String connector = System.getenv("HDF5_VOL_CONNECTOR");
if (connector == null) {
try {
@@ -81,19 +87,20 @@ public class TestH5Edefault {
}
@Test
- public void testH5Eget_current_stack() {
- long num_msg = -1;
- long num_msg_default = -1;
- long saved_num_msg = -1;
- long stack_id = -1;
+ public void testH5Eget_current_stack()
+ {
+ long num_msg = -1;
+ long num_msg_default = -1;
+ long saved_num_msg = -1;
+ long stack_id = -1;
long stack_id_default = HDF5Constants.H5E_DEFAULT;
try {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- //default stack id will be different after exception
+ // default stack id will be different after exception
stack_id_default = HDF5Constants.H5E_DEFAULT;
- //err.printStackTrace(); //This will clear the error stack
+ // err.printStackTrace(); //This will clear the error stack
}
// Verify we have messages on the error stack
try {
@@ -147,16 +154,17 @@ public class TestH5Edefault {
}
@Test
- public void testH5Eget_current_stack_pop() {
- long num_msg = -1;
+ public void testH5Eget_current_stack_pop()
+ {
+ long num_msg = -1;
long num_msg_default = -1;
- long saved_num_msg = -1;
- long stack_id = -1;
+ long saved_num_msg = -1;
+ long stack_id = -1;
try {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- //err.printStackTrace(); //This will clear the error stack
+ // err.printStackTrace(); //This will clear the error stack
}
// Verify there are error messages on the stack and save it
@@ -179,7 +187,8 @@ public class TestH5Edefault {
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 == HDF5Constants.H5E_DEFAULT);
// Verify the stack is empty
try {
@@ -206,7 +215,7 @@ public class TestH5Edefault {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- //err.printStackTrace(); //This will clear the error stack
+ // err.printStackTrace(); //This will clear the error stack
}
// Verify we have a nonzero number of messages and save it
@@ -243,37 +252,44 @@ public class TestH5Edefault {
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eclose_stack_invalid_stackid() throws Throwable {
+ public void testH5Eclose_stack_invalid_stackid() throws Throwable
+ {
H5.H5Eclose_stack(-1);
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eget_class_name_invalid_classid() throws Throwable {
+ public void testH5Eget_class_name_invalid_classid() throws Throwable
+ {
H5.H5Eget_class_name(-1);
}
@Test(expected = HDF5LibraryException.class)
- public void testH5Eget_class_name_invalid_classname() throws Throwable {
+ public void testH5Eget_class_name_invalid_classname() throws Throwable
+ {
H5.H5Eget_class_name(HDF5Constants.H5E_DEFAULT);
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eclose_msg_invalid_errid() throws Throwable {
+ public void testH5Eclose_msg_invalid_errid() throws Throwable
+ {
H5.H5Eclose_msg(-1);
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Ecreate_msg_invalid_errid() throws Throwable {
+ public void testH5Ecreate_msg_invalid_errid() throws Throwable
+ {
H5.H5Ecreate_msg(-1, HDF5Constants.H5E_MAJOR, "null");
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eget_msg_invalid_msgid() throws Throwable {
+ public void testH5Eget_msg_invalid_msgid() throws Throwable
+ {
H5.H5Eget_msg(-1, null);
}
@Test
- public void testH5Ecreate_stack() {
+ public void testH5Ecreate_stack()
+ {
try {
long stack_id = H5.H5Ecreate_stack();
assertTrue("H5.H5Ecreate_stack", stack_id > 0);
@@ -286,14 +302,16 @@ public class TestH5Edefault {
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eset_current_stack_invalid_stkid() throws Throwable {
+ public void testH5Eset_current_stack_invalid_stkid() throws Throwable
+ {
H5.H5Eset_current_stack(-1);
}
@Test
- public void testH5Eset_current_stack() {
- long num_msg = -1;
- long stack_id = -1;
+ public void testH5Eset_current_stack()
+ {
+ long num_msg = -1;
+ long stack_id = -1;
long saved_num_msg = -1;
// Generate errors on the default stack
@@ -301,7 +319,7 @@ public class TestH5Edefault {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- //err.printStackTrace(); //This will clear the error stack
+ // err.printStackTrace(); //This will clear the error stack
}
// Verify we have a nonzero number of messages and save it
@@ -324,7 +342,8 @@ public class TestH5Edefault {
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 == HDF5Constants.H5E_DEFAULT);
// Verify the copy has the same number of messages as the original stack
try {
@@ -341,7 +360,7 @@ public class TestH5Edefault {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- //err.printStackTrace(); //This will clear the error stack
+ // err.printStackTrace(); //This will clear the error stack
}
// Verify we have the same number of messages as before
@@ -388,13 +407,15 @@ public class TestH5Edefault {
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Epop_invalid_stkid() throws Throwable {
+ public void testH5Epop_invalid_stkid() throws Throwable
+ {
H5.H5Epop(-1, 0);
}
@Test
- public void testH5Epop() throws Throwable {
- long num_msg = -1;
+ public void testH5Epop() throws Throwable
+ {
+ long num_msg = -1;
long saved_num_msg = -1;
try {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
@@ -422,28 +443,33 @@ public class TestH5Edefault {
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Epush_invalid_stkid() throws Throwable {
+ public void testH5Epush_invalid_stkid() throws Throwable
+ {
H5.H5Epush(-1, "Invalid", "Invalid", 0, -1, -1, -1, "Invalid message");
}
@Test(expected = NullPointerException.class)
- public void testH5Epush_null_name() throws Throwable {
- H5.H5Epush(HDF5Constants.H5E_DEFAULT, null, "Invalid", 0, HDF5Constants.H5E_DEFAULT, HDF5Constants.H5E_DEFAULT, HDF5Constants.H5E_DEFAULT, "Invalid message");
+ public void testH5Epush_null_name() throws Throwable
+ {
+ H5.H5Epush(HDF5Constants.H5E_DEFAULT, null, "Invalid", 0, HDF5Constants.H5E_DEFAULT,
+ HDF5Constants.H5E_DEFAULT, HDF5Constants.H5E_DEFAULT, "Invalid message");
}
@Test(expected = IllegalArgumentException.class)
- public void testH5EprintInt_invalid_classid() throws Throwable {
+ public void testH5EprintInt_invalid_classid() throws Throwable
+ {
H5.H5Eprint2(-1, null);
}
@Ignore
- public void testH5EprintInt() {
+ public void testH5EprintInt()
+ {
/*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector and the error stack might be different.
- * Only check for the specific error stack if the native
- * connector is being used.
- */
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector and the error stack might be different.
+ * Only check for the specific error stack if the native
+ * connector is being used.
+ */
String connector = System.getenv("HDF5_VOL_CONNECTOR");
if (connector == null) {
try {
@@ -462,7 +488,8 @@ public class TestH5Edefault {
}
@Test
- public void testH5EclearInt() {
+ public void testH5EclearInt()
+ {
try {
H5.H5Eclear(HDF5Constants.H5E_DEFAULT);
}
@@ -473,12 +500,14 @@ public class TestH5Edefault {
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eclear2_invalid_stkid() throws Throwable {
+ public void testH5Eclear2_invalid_stkid() throws Throwable
+ {
H5.H5Eclear2(-1);
}
@Test
- public void testH5Eclear() {
+ public void testH5Eclear()
+ {
try {
H5.H5Eclear2(HDF5Constants.H5E_DEFAULT);
}
@@ -489,7 +518,8 @@ public class TestH5Edefault {
}
@Test
- public void testH5Eclear2_with_msg() {
+ public void testH5Eclear2_with_msg()
+ {
long num_msg = -1;
try {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
@@ -516,12 +546,14 @@ public class TestH5Edefault {
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eauto_is_v2_invalid_stkid() throws Throwable {
+ public void testH5Eauto_is_v2_invalid_stkid() throws Throwable
+ {
H5.H5Eauto_is_v2(-1);
}
@Test
- public void testH5Eauto_is_v2() {
+ public void testH5Eauto_is_v2()
+ {
boolean is_v2 = false;
try {
is_v2 = H5.H5Eauto_is_v2(HDF5Constants.H5E_DEFAULT);
@@ -534,12 +566,14 @@ public class TestH5Edefault {
}
@Test(expected = IllegalArgumentException.class)
- public void testH5Eget_num_invalid_stkid() throws Throwable {
+ public void testH5Eget_num_invalid_stkid() throws Throwable
+ {
H5.H5Eget_num(-1);
}
@Test
- public void testH5Eget_num() {
+ public void testH5Eget_num()
+ {
long num_msg = -1;
try {
num_msg = H5.H5Eget_num(HDF5Constants.H5E_DEFAULT);
@@ -552,7 +586,8 @@ public class TestH5Edefault {
}
@Test
- public void testH5Eget_num_with_msg() {
+ public void testH5Eget_num_with_msg()
+ {
long num_msg = -1;
try {
H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
@@ -568,6 +603,4 @@ public class TestH5Edefault {
}
assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > 0);
}
-
}
-