diff options
author | mainzer <mainzer#hdfgroup.org> | 2020-08-13 16:31:16 (GMT) |
---|---|---|
committer | mainzer <mainzer#hdfgroup.org> | 2020-08-13 16:31:16 (GMT) |
commit | 32024169364ddf031df8da879c45c3647a4d6135 (patch) | |
tree | 1dc1fa889c8ddba83b9794734e7d7e67b8fe7ab6 /java/test/TestH5Pfapl.java | |
parent | 33f35183cbfdde70ee8f803acb5b735ad4dfe086 (diff) | |
parent | e291fd31fd480dc4900d056e0e08df002e85a3f2 (diff) | |
download | hdf5-32024169364ddf031df8da879c45c3647a4d6135.zip hdf5-32024169364ddf031df8da879c45c3647a4d6135.tar.gz hdf5-32024169364ddf031df8da879c45c3647a4d6135.tar.bz2 |
Merge branch 'develop' into mdc_sl_opt
Diffstat (limited to 'java/test/TestH5Pfapl.java')
-rw-r--r-- | java/test/TestH5Pfapl.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 10a79dd..4233580 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1398,4 +1398,36 @@ public class TestH5Pfapl { fail("H5P_evict_on_close: " + err); } } + + @Test + public void testH5P_file_locking() { + boolean use_file_locking = false; + boolean ignore_disabled_file_locking = false; + try { + // false values (usually not the default) + H5.H5Pset_file_locking(fapl_id, false, false); + use_file_locking = H5.H5Pget_use_file_locking(fapl_id); + ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id); + assertFalse("H5P_file_locking", use_file_locking); + assertFalse("H5P_file_locking", ignore_disabled_file_locking); + + // true values (typically the default) + H5.H5Pset_file_locking(fapl_id, true, true); + use_file_locking = H5.H5Pget_use_file_locking(fapl_id); + ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id); + assertTrue("H5P_file_locking", use_file_locking); + assertTrue("H5P_file_locking", ignore_disabled_file_locking); + } + catch (HDF5PropertyListInterfaceException err) { + // parallel is not supported + if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) { + err.printStackTrace(); + fail("H5P_test_file_locking: " + err); + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_test_file_locking: " + err); + } + } } |