summaryrefslogtreecommitdiffstats
path: root/fortran/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-04-05 23:18:08 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-04-05 23:18:08 (GMT)
commit72aad5ebdf4665a5e278520d714fc10613660872 (patch)
tree4b271e8796257e1b9f897929eb6df8eb8b975c21 /fortran/test
parent0c6ff43fbccaf78196165db6660a30d37944ea78 (diff)
downloadhdf5-72aad5ebdf4665a5e278520d714fc10613660872.zip
hdf5-72aad5ebdf4665a5e278520d714fc10613660872.tar.gz
hdf5-72aad5ebdf4665a5e278520d714fc10613660872.tar.bz2
Normalized Fortran with develop
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 90f0e01..eff4657 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 f45d18a..1d1208c 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