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/TestH5Pfapls3.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/TestH5Pfapls3.java')
-rw-r--r-- | java/test/TestH5Pfapls3.java | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/java/test/TestH5Pfapls3.java b/java/test/TestH5Pfapls3.java index dda2716..06baef2 100644 --- a/java/test/TestH5Pfapls3.java +++ b/java/test/TestH5Pfapls3.java @@ -31,12 +31,13 @@ import org.junit.Test; import org.junit.rules.TestName; public class TestH5Pfapls3 { - @Rule public TestName testname = new TestName(); + @Rule + public TestName testname = new TestName(); - long fapl_id = HDF5Constants.H5I_INVALID_HID; - long plapl_id = HDF5Constants.H5I_INVALID_HID; - long dapl_id = HDF5Constants.H5I_INVALID_HID; - long plist_id = HDF5Constants.H5I_INVALID_HID; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long plapl_id = HDF5Constants.H5I_INVALID_HID; + long dapl_id = HDF5Constants.H5I_INVALID_HID; + long plist_id = HDF5Constants.H5I_INVALID_HID; long btplist_id = HDF5Constants.H5I_INVALID_HID; @Before @@ -62,9 +63,9 @@ public class TestH5Pfapls3 { } assertTrue(plapl_id > 0); try { - plist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER); + plist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER); btplist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER); - dapl_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_ACCESS); + dapl_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_ACCESS); } catch (Throwable err) { err.printStackTrace(); @@ -79,15 +80,35 @@ public class TestH5Pfapls3 { public void deleteFileAccess() throws HDF5LibraryException { if (fapl_id > 0) - try {H5.H5Pclose(fapl_id);} catch (Exception ex) {} + try { + H5.H5Pclose(fapl_id); + } + catch (Exception ex) { + } if (plapl_id > 0) - try {H5.H5Pclose(plapl_id);} catch (Exception ex) {} + try { + H5.H5Pclose(plapl_id); + } + catch (Exception ex) { + } if (dapl_id > 0) - try {H5.H5Pclose(dapl_id);} catch (Exception ex) {} + try { + H5.H5Pclose(dapl_id); + } + catch (Exception ex) { + } if (plist_id > 0) - try {H5.H5Pclose(plist_id);} catch (Exception ex) {} + try { + H5.H5Pclose(plist_id); + } + catch (Exception ex) { + } if (btplist_id > 0) - try {H5.H5Pclose(btplist_id);} catch (Exception ex) {} + try { + H5.H5Pclose(btplist_id); + } + catch (Exception ex) { + } System.out.println(); } @@ -98,18 +119,15 @@ public class TestH5Pfapls3 { return; final H5FD_ros3_fapl_t config = new H5FD_ros3_fapl_t(); - assertEquals("Default fapl has unexpected contents", - new H5FD_ros3_fapl_t("", "", ""), config); + assertEquals("Default fapl has unexpected contents", new H5FD_ros3_fapl_t("", "", ""), config); H5.H5Pset_fapl_ros3(fapl_id, config); - assertEquals("driver types don't match", - HDF5Constants.H5FD_ROS3, H5.H5Pget_driver(fapl_id)); + assertEquals("driver types don't match", HDF5Constants.H5FD_ROS3, H5.H5Pget_driver(fapl_id)); /* get_fapl_ros3 can throw exception in error cases */ H5FD_ros3_fapl_t copy = H5.H5Pget_fapl_ros3(fapl_id); - assertEquals("contents of fapl set and get don't match", - new H5FD_ros3_fapl_t("", "", ""), copy); + assertEquals("contents of fapl set and get don't match", new H5FD_ros3_fapl_t("", "", ""), copy); } @Test(expected = HDF5LibraryException.class) @@ -125,13 +143,12 @@ public class TestH5Pfapls3 { { if (HDF5Constants.H5FD_ROS3 < 0) throw new HDF5LibraryException("skip"); - if (HDF5Constants.H5FD_SEC2 < 0 ) + if (HDF5Constants.H5FD_SEC2 < 0) throw new HDF5LibraryException("skip"); - /* TODO: for now, test against a sec2 fapl only */ + /* TODO: for now, test against a sec2 fapl only */ H5.H5Pset_fapl_sec2(fapl_id); - assertEquals("fapl_id was not set properly", - HDF5Constants.H5FD_SEC2, H5.H5Pget_driver(fapl_id)); + assertEquals("fapl_id was not set properly", HDF5Constants.H5FD_SEC2, H5.H5Pget_driver(fapl_id)); H5FD_ros3_fapl_t fails = H5.H5Pget_fapl_ros3(fapl_id); } @@ -147,12 +164,10 @@ public class TestH5Pfapls3 { final H5FD_ros3_fapl_t config = new H5FD_ros3_fapl_t(region, acc_id, acc_key); H5.H5Pset_fapl_ros3(fapl_id, config); - assertEquals("driver types don't match", - HDF5Constants.H5FD_ROS3, H5.H5Pget_driver(fapl_id)); + assertEquals("driver types don't match", HDF5Constants.H5FD_ROS3, H5.H5Pget_driver(fapl_id)); H5FD_ros3_fapl_t copy = H5.H5Pget_fapl_ros3(fapl_id); assertEquals("contents of fapl set and get don't match", - new H5FD_ros3_fapl_t(region, acc_id, acc_key), copy); + new H5FD_ros3_fapl_t(region, acc_id, acc_key), copy); } - } |