diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-08-03 16:11:27 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-08-03 16:11:27 (GMT) |
commit | bc1bed2c55981f1802f87f83054d375431a0088f (patch) | |
tree | 7f89238033aebca038770f6da775e13ec6902712 /java/test | |
parent | 66ce984dee99b7b58ec4632fecad3b2b758d08d5 (diff) | |
download | hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.zip hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.gz hdf5-bc1bed2c55981f1802f87f83054d375431a0088f.tar.bz2 |
Squash merge of file locking fixes
Diffstat (limited to 'java/test')
-rw-r--r-- | java/test/TestH5Pfapl.java | 32 | ||||
-rw-r--r-- | java/test/testfiles/JUnit-TestH5Pfapl.txt | 3 |
2 files changed, 34 insertions, 1 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); + } + } } diff --git a/java/test/testfiles/JUnit-TestH5Pfapl.txt b/java/test/testfiles/JUnit-TestH5Pfapl.txt index c4f37d0..c34ac1c 100644 --- a/java/test/testfiles/JUnit-TestH5Pfapl.txt +++ b/java/test/testfiles/JUnit-TestH5Pfapl.txt @@ -28,6 +28,7 @@ JUnit version 4.11 .testH5Pset_elink_fapl .testH5P_hyper_vector_size .testH5P_gc_references +.testH5P_file_locking .testH5P_family_offset .testH5P_fapl_core .testH5P_fapl_muti @@ -37,5 +38,5 @@ JUnit version 4.11 Time: XXXX -OK (35 tests) +OK (36 tests) |