summaryrefslogtreecommitdiffstats
path: root/fortran/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-08-04 01:43:19 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-08-04 01:43:19 (GMT)
commitb2c90cc84ec84f51233d69f5eb951d48ba20d37e (patch)
tree2299f730d8dca896a182b03267d9f760a8ca5467 /fortran/test
parentbd685b0e803e13a10243bd0e50fa01c5fceffc67 (diff)
downloadhdf5-b2c90cc84ec84f51233d69f5eb951d48ba20d37e.zip
hdf5-b2c90cc84ec84f51233d69f5eb951d48ba20d37e.tar.gz
hdf5-b2c90cc84ec84f51233d69f5eb951d48ba20d37e.tar.bz2
Updated the file locking Fortran property list wrappers and added
a test.
Diffstat (limited to 'fortran/test')
-rw-r--r--fortran/test/fortranlib_test.F906
-rw-r--r--fortran/test/tH5P.F9073
2 files changed, 78 insertions, 1 deletions
diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90
index 92f9279..1fb3e68 100644
--- a/fortran/test/fortranlib_test.F90
+++ b/fortran/test/fortranlib_test.F90
@@ -183,9 +183,13 @@ PROGRAM fortranlibtest
CALL write_test_status(ret_total_error, ' Multi file driver test', total_error)
ret_total_error = 0
- CALL test_chunk_cache (cleanup, ret_total_error)
+ CALL test_chunk_cache(cleanup, ret_total_error)
CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error)
+ ret_total_error = 0
+ CALL test_misc_properties(cleanup, ret_total_error)
+ CALL write_test_status(ret_total_error, ' Miscellaneous properties', total_error)
+
!
! '========================================='
! 'Testing ATTRIBUTE interface '
diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90
index 7fe3971..19bee75 100644
--- a/fortran/test/tH5P.F90
+++ b/fortran/test/tH5P.F90
@@ -724,4 +724,77 @@ SUBROUTINE test_chunk_cache(cleanup, total_error)
END SUBROUTINE test_chunk_cache
+!-------------------------------------------------------------------------
+! Function: test_misc_properties
+!
+! Purpose: Tests setting and getting of miscellaneous properties. Does
+! not test the underlying functionality as that is done in
+! the C library tests.
+!
+! Tests APIs:
+! H5P_GET/SET_FILE_LOCKING_F
+!
+! Return: Success: 0
+! Failure: -1
+!
+!-------------------------------------------------------------------------
+!
+SUBROUTINE test_misc_properties(cleanup, total_error)
+
+ IMPLICIT NONE
+ LOGICAL, INTENT(IN) :: cleanup
+ INTEGER, INTENT(INOUT) :: total_error
+
+ INTEGER(hid_t) :: fapl_id = -1 ! Local fapl
+ LOGICAL :: use_file_locking ! (H5Pset/get_file_locking_f)
+ LOGICAL :: ignore_disabled_locks ! (H5Pset/get_file_locking_f)
+ INTEGER :: error
+
+ ! Create a default fapl
+ CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_id, error)
+ CALL check("H5Pcreate_f", error, total_error)
+
+ ! Test H5Pset/get_file_locking_f
+ ! true values
+ use_file_locking = .TRUE.
+ ignore_disabled_locks = .TRUE.
+ CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error)
+ CALL check("h5pset_set_file_locking_f", error, total_error)
+ use_file_locking = .FALSE.
+ ignore_disabled_locks = .FALSE.
+ CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error)
+ CALL check("h5pget_set_file_locking_f", error, total_error)
+ if(use_file_locking .neqv. .TRUE.) then
+ total_error = total_error + 1
+ write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f"
+ endif
+ if(ignore_disabled_locks .neqv. .TRUE.) then
+ total_error = total_error + 1
+ write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f"
+ endif
+
+ ! false values
+ use_file_locking = .FALSE.
+ ignore_disabled_locks = .FALSE.
+ CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error)
+ CALL check("h5pset_set_file_locking_f", error, total_error)
+ use_file_locking = .TRUE.
+ ignore_disabled_locks = .TRUE.
+ CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error)
+ CALL check("h5pget_set_file_locking_f", error, total_error)
+ if(use_file_locking .neqv. .FALSE.) then
+ total_error = total_error + 1
+ write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f"
+ endif
+ if(ignore_disabled_locks .neqv. .FALSE.) then
+ total_error = total_error + 1
+ write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f"
+ endif
+
+ ! Close the fapl
+ CALL H5Pclose_f(fapl_id, error)
+ CALL check("H5Pclose_f", error, total_error)
+
+END SUBROUTINE test_misc_properties
+
END MODULE TH5P