diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-04-21 05:24:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 05:24:35 (GMT) |
commit | ec14985c8555bda02021568ea20295384a2cef7e (patch) | |
tree | 491c1f08a68d92e400d939d96fefdc7bfef57ddc /java/test/TestH5VL.java | |
parent | bc62da7eb911727497475d1cc90991230f33fa3d (diff) | |
download | hdf5-ec14985c8555bda02021568ea20295384a2cef7e.zip hdf5-ec14985c8555bda02021568ea20295384a2cef7e.tar.gz hdf5-ec14985c8555bda02021568ea20295384a2cef7e.tar.bz2 |
VFD SWMR: Merges from develop (#1670)
* Cleans up SWMR test scripts (both legacy and VFD)
* Brings over format source changes for Java
* Normalization of HL, Fortran, C++, Java w/ develop
* Removes the STATIC flavor of FUNC_ENTER macros (#1622)
* Removes the STATIC flavor of FUNC_ENTER macros
* 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>
* Removes unused definitions from module headers (#1624)
* Misc stuff from develop (includes some parallel things)
* Brings over SWMR test quiet mode changes from develop
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'java/test/TestH5VL.java')
-rw-r--r-- | java/test/TestH5VL.java | 70 |
1 files changed, 47 insertions, 23 deletions
diff --git a/java/test/TestH5VL.java b/java/test/TestH5VL.java index 4253d20..99505ae 100644 --- a/java/test/TestH5VL.java +++ b/java/test/TestH5VL.java @@ -16,12 +16,13 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; + +import java.io.File; + import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; -import java.io.File; - import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -29,28 +30,37 @@ import org.junit.Test; import org.junit.rules.TestName; public class TestH5VL { - @Rule public TestName testname = new TestName(); + @Rule + public TestName testname = new TestName(); - private final void _deleteFile(String filename) { + private final void _deleteFile(String filename) + { File file = new File(filename); if (file.exists()) { - try {file.delete();} catch (SecurityException e) {} + try { + file.delete(); + } + catch (SecurityException e) { + } } } @Before - public void checkOpenIDs() { - assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0); + public void checkOpenIDs() + { + assertTrue("H5 open ids is 0", H5.getOpenIDCount() == 0); System.out.print(testname.getMethodName()); } @After - public void nextTestName() { + public void nextTestName() + { System.out.println(); } @Test - public void testH5VLnative_init() { + public void testH5VLnative_init() + { try { boolean is_registered; @@ -70,11 +80,12 @@ public class TestH5VL { } @Test - public void testH5VLget_connector_id() { + public void testH5VLget_connector_id() + { String H5_FILE = "testFvl.h5"; - long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); + long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, + HDF5Constants.H5P_DEFAULT); try { long native_id = H5.H5VLget_connector_id(H5fid); @@ -95,14 +106,19 @@ public class TestH5VL { } finally { if (H5fid > 0) { - try {H5.H5Fclose(H5fid);} catch (Exception ex) {} + try { + H5.H5Fclose(H5fid); + } + catch (Exception ex) { + } } _deleteFile(H5_FILE); } } @Test - public void testH5VLget_connector_id_by_name() { + public void testH5VLget_connector_id_by_name() + { try { long native_id = H5.H5VLget_connector_id_by_name(HDF5Constants.H5VL_NATIVE_NAME); assertTrue("H5.H5VLget_connector_id_by_name H5VL_NATIVE_NAME", native_id >= 0); @@ -115,7 +131,8 @@ public class TestH5VL { } @Test - public void testH5VLget_connector_id_by_value() { + public void testH5VLget_connector_id_by_value() + { try { long native_id = H5.H5VLget_connector_id_by_value(HDF5Constants.H5VL_NATIVE_VALUE); assertTrue("H5.H5VLget_connector_id_by_value H5VL_NATIVE_VALUE", native_id >= 0); @@ -128,11 +145,12 @@ public class TestH5VL { } @Test - public void testH5VLget_connector_name() { + public void testH5VLget_connector_name() + { String H5_FILE = "testFvl.h5"; - long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); + long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, + HDF5Constants.H5P_DEFAULT); H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL); try { @@ -145,7 +163,8 @@ public class TestH5VL { */ String connector = System.getenv("HDF5_VOL_CONNECTOR"); if (connector == null) - assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0); + assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", + native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME) == 0); } catch (Throwable err) { err.printStackTrace(); @@ -153,20 +172,25 @@ public class TestH5VL { } finally { if (H5fid > 0) { - try {H5.H5Fclose(H5fid);} catch (Exception ex) {} + try { + H5.H5Fclose(H5fid); + } + catch (Exception ex) { + } } _deleteFile(H5_FILE); } } @Test(expected = HDF5LibraryException.class) - public void testH5VLclose_NegativeID() throws Throwable { + public void testH5VLclose_NegativeID() throws Throwable + { H5.H5VLclose(-1); } @Test(expected = HDF5LibraryException.class) - public void testH5VLunregister_connector_NegativeID() throws Throwable { + public void testH5VLunregister_connector_NegativeID() throws Throwable + { H5.H5VLunregister_connector(-1); } } - |