diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2022-04-07 13:52:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 13:52:31 (GMT) |
commit | b9d77ec8be0aa633869b1d10510f96f756adf6f9 (patch) | |
tree | ecd47a1a95fe1467d63136644233fed96672cb74 /fortran/test | |
parent | 74863549c0a640909c87e72717e262f91140a2a4 (diff) | |
parent | 541bc15452f71f3eae7471fdecbe7994a7f138e2 (diff) | |
download | hdf5-b9d77ec8be0aa633869b1d10510f96f756adf6f9.zip hdf5-b9d77ec8be0aa633869b1d10510f96f756adf6f9.tar.gz hdf5-b9d77ec8be0aa633869b1d10510f96f756adf6f9.tar.bz2 |
Merge branch 'hdf5_1_12' into spelling-corrections
Diffstat (limited to 'fortran/test')
-rw-r--r-- | fortran/test/tH5A_1_8.F90 | 15 | ||||
-rw-r--r-- | fortran/test/tH5F.F90 | 38 | ||||
-rw-r--r-- | fortran/test/tH5P.F90 | 4 |
3 files changed, 42 insertions, 15 deletions
diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90 index eb781a5..cd8a981 100644 --- a/fortran/test/tH5A_1_8.F90 +++ b/fortran/test/tH5A_1_8.F90 @@ -776,8 +776,7 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) INTEGER :: Input1 INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T - INTEGER :: minusone = -1 - INTEGER(HSIZE_T) :: htmp + INTEGER, PARAMETER :: minusone = -1 data_dims = 0 @@ -840,10 +839,6 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) my_dataset = dset3 END SELECT - ! Check for query on non-existent attribute - - n = 0 - ! -- CHECK PASSING AN INTEGER CONSTANT IN DIFFERENT FORMS -- ! 1) call by passing an integer with the _hsize_t declaration @@ -896,8 +891,8 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) ! Verify information for new attribute !EP CALL attr_info_by_idx_check(my_dataset, attrname, INT(j,HSIZE_T), use_index(i), total_error ) - htmp = j - CALL attr_info_by_idx_check(my_dataset, attrname, htmp, use_index(i), total_error ) + n = INT(j, HSIZE_T) + CALL attr_info_by_idx_check(my_dataset, attrname, n, use_index(i), total_error ) !CHECK(ret, FAIL, "attr_info_by_idx_check"); ENDDO @@ -1427,7 +1422,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) INTEGER :: u ! Local index variable INTEGER :: Input1 INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T - INTEGER :: minusone = -1 + INTEGER, PARAMETER :: minusone = -1 data_dims = 0 @@ -2268,7 +2263,7 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) INTEGER :: error INTEGER :: crt_order_flags - INTEGER :: minusone = -1 + INTEGER, PARAMETER :: minusone = -1 ! Output message about test being performed ! WRITE(*,*) " - Testing Basic Code for Attributes with Creation Order Info" diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90 index 3affed0..8d4845d 100644 --- a/fortran/test/tH5F.F90 +++ b/fortran/test/tH5F.F90 @@ -584,17 +584,23 @@ CONTAINS ! The following subroutine checks that h5fget_name_f produces ! correct output for a given obj_id and filename. ! - SUBROUTINE check_get_name(obj_id, fix_filename, total_error) + SUBROUTINE check_get_name(obj_id, fix_filename, len_filename, total_error) USE HDF5 ! This module contains all necessary modules USE TH5_MISC IMPLICIT NONE INTEGER(HID_T) :: obj_id ! Object identifier CHARACTER(LEN=80), INTENT(IN) :: fix_filename ! Expected filename + INTEGER, INTENT(IN) :: len_filename ! The length of the filename INTEGER, INTENT(INOUT) :: total_error ! Error count CHARACTER(LEN=80):: file_name ! Filename buffer INTEGER:: error ! HDF5 error code INTEGER(SIZE_T):: name_size ! Filename length + + INTEGER, PARAMETER :: sm_len = 2 + CHARACTER(LEN=len_filename) :: filename_exact + CHARACTER(LEN=len_filename-sm_len) :: filename_sm + ! !Get file name from the dataset identifier ! @@ -637,6 +643,30 @@ CONTAINS total_error = total_error + 1 END IF + ! Use a buffer which is the exact size needed to hold the filename + CALL h5fget_name_f(obj_id, filename_exact, name_size, error) + CALL check("h5fget_name_f",error,total_error) + IF(name_size .NE. len_filename)THEN + WRITE(*,*) " file name size obtained from the object id is incorrect" + total_error = total_error + 1 + ENDIF + IF(filename_exact .NE. TRIM(fix_filename)) THEN + WRITE(*,*) " file name obtained from the object id is incorrect" + total_error = total_error + 1 + END IF + + ! Use a buffer which is smaller than needed to hold the filename + CALL h5fget_name_f(obj_id, filename_sm, name_size, error) + CALL check("h5fget_name_f",error,total_error) + IF(name_size .NE. len_filename)THEN + WRITE(*,*) " file name size obtained from the object id is incorrect" + total_error = total_error + 1 + ENDIF + IF(filename_sm(1:len_filename-sm_len) .NE. fix_filename(1:len_filename-sm_len)) THEN + WRITE(*,*) " file name obtained from the object id is incorrect" + total_error = total_error + 1 + END IF + END SUBROUTINE check_get_name ! The following subroutine tests h5fget_name_f. @@ -653,6 +683,7 @@ CONTAINS CHARACTER(LEN=*), PARAMETER :: filename = "filename" CHARACTER(LEN=80) :: fix_filename + INTEGER :: len_filename INTEGER(HID_T) :: file_id ! File identifier INTEGER(HID_T) :: g_id ! Group identifier @@ -679,8 +710,9 @@ CONTAINS CALL h5gopen_f(file_id,"/",g_id, error) CALL check("h5gopen_f",error,total_error) - CALL check_get_name(file_id, fix_filename, total_error) - CALL check_get_name(g_id, fix_filename, total_error) + len_filename = LEN_TRIM(fix_filename) + CALL check_get_name(file_id, fix_filename, len_filename, total_error) + CALL check_get_name(g_id, fix_filename, len_filename, total_error) ! Close the group. ! diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90 index 75e4e72..d664dd7 100644 --- a/fortran/test/tH5P.F90 +++ b/fortran/test/tH5P.F90 @@ -541,7 +541,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Dclose_f(dsid, error) CALL H5Oopen_f(fid, "dset", dsid, error, dapl1) - ! Retrieve dapl from dataset, verfiy cache values are the same as on dapl1 + ! Retrieve dapl from dataset, verify cache values are the same as on dapl1 ! ! Note we rely on the knowledge that H5Pget_chunk_cache retrieves these ! values directly from the dataset structure, and not from a copy of the @@ -563,7 +563,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Oopen_f(fid, "dset", dsid, error) CALL check("H5Oopen_f", error, total_error) - ! Retrieve dapl from dataset, verfiy cache values are the same as on fapl_local + ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) |