diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-05-16 20:46:10 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2008-05-16 20:46:10 (GMT) |
commit | 5c122eeb8b529db62aa75091601f3f91c684b14b (patch) | |
tree | 6e3443500b9083c30855898a722758feb84f2996 /fortran/test/tH5G_1_8.f90 | |
parent | 6c787d56aa8c7aa0afe0c6be7b340ececc759ff5 (diff) | |
download | hdf5-5c122eeb8b529db62aa75091601f3f91c684b14b.zip hdf5-5c122eeb8b529db62aa75091601f3f91c684b14b.tar.gz hdf5-5c122eeb8b529db62aa75091601f3f91c684b14b.tar.bz2 |
[svn-r15025] Purpose:
Cleaned up unused code (i.e. commented out) and removed extraneous output to standard out.
Tested:
N/A - No critical executable source lines were modified, only comments and write statements.
Diffstat (limited to 'fortran/test/tH5G_1_8.f90')
-rw-r--r-- | fortran/test/tH5G_1_8.f90 | 928 |
1 files changed, 71 insertions, 857 deletions
diff --git a/fortran/test/tH5G_1_8.f90 b/fortran/test/tH5G_1_8.f90 index cc1ab67..4639731 100644 --- a/fortran/test/tH5G_1_8.f90 +++ b/fortran/test/tH5G_1_8.f90 @@ -24,7 +24,7 @@ SUBROUTINE group_test(cleanup, total_error) INTEGER :: error - WRITE(*,*) "TESTING GROUPS" +! WRITE(*,*) "TESTING GROUPS" CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("H5Pcreate_f",error, total_error) @@ -137,48 +137,48 @@ SUBROUTINE group_info(cleanup, fapl, total_error) IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN IF(iorder == H5_ITER_INC_F)THEN order = H5_ITER_INC_F - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" - ENDIF +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" +!!$ ENDIF ELSE IF (iorder == H5_ITER_DEC_F) THEN order = H5_ITER_DEC_F - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" - ENDIF +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" +!!$ ENDIF ELSE order = H5_ITER_NATIVE_F - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" - ENDIF +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" +!!$ ENDIF ENDIF ELSE IF(iorder == H5_ITER_INC_F)THEN order = H5_ITER_INC_F - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" - ENDIF +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in increasing order w/o creation order index" +!!$ ENDIF ELSE IF (iorder == H5_ITER_DEC_F) THEN order = H5_ITER_DEC_F - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" - ENDIF +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in decreasing order w/o creation order index" +!!$ ENDIF ELSE order = H5_ITER_NATIVE_F - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" - ENDIF +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"query group info by creation order index in native order w/o creation order index" +!!$ ENDIF ENDIF END IF @@ -351,156 +351,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL VERIFY("H5Gget_info_f", nlinks, u+1, total_error) ENDDO - ! /* Verify state of group (compact) */ - ! if(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR - - !/* Check for out of bound query by index */ - ! H5E_BEGIN_TRY { - ! ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &grp_info, H5P_DEFAULT); - ! } H5E_END_TRY; - ! if(ret >= 0) TEST_ERROR - - ! /* Create more links, to push group into dense form */ -!!$ for(; u < (max_compact * 2); u++) { -!!$ hid_t group_id2, group_id3; /* Group IDs */ -!!$ -!!$ /* Make name for link */ -!!$ sprintf(objname, "filler %02u", u); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ -!!$ /* Retrieve group's information */ -!!$ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check (new/empty) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR -!!$ if(grp_info.max_corder != 0) TEST_ERROR -!!$ if(grp_info.nlinks != 0) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new/empty) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR -!!$ if(grp_info.max_corder != 0) TEST_ERROR -!!$ if(grp_info.nlinks != 0) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new/empty) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR -!!$ if(grp_info.max_corder != 0) TEST_ERROR -!!$ if(grp_info.nlinks != 0) TEST_ERROR -!!$ -!!$ -!!$ /* Create objects in new group created */ -!!$ for(v = 0; v <= u; v++) { -!!$ /* Make name for link */ -!!$ sprintf(objname2, "filler %02u", v); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Close group created */ -!!$ if(H5Gclose(group_id3) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ -!!$ /* Retrieve group's information */ -!!$ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ -!!$ /* Retrieve group's information */ -!!$ if(order != H5_ITER_NATIVE) { -!!$ if(order == H5_ITER_INC) { -!!$ if(H5Gget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(H5Gget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Close group created */ -!!$ if(H5Gclose(group_id2) < 0) TEST_ERROR -!!$ -!!$ -!!$ /* Retrieve main group's information */ -!!$ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check main group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve main group's information, by name */ -!!$ if(H5Gget_info_by_name(file_id, CORDER_GROUP_NAME, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check main group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve main group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check main group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ -!!$ /* Create soft link in another group, to objects in main group */ -!!$ sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname); -!!$ if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Retrieve soft link group's information, by name */ -!!$ if(H5Gget_info(soft_group_id, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check soft link group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Verify state of group (dense) */ -!!$ if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR -!!$ -!!$ /* Check for out of bound query by index */ -!!$ H5E_BEGIN_TRY { -!!$ ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &grp_info, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(ret >= 0) TEST_ERROR - - ! /* Close the groups */ CALL H5Gclose_f(group_id, error) @@ -563,7 +413,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER :: error ! /* Print test message */ - WRITE(*,*) "timestamps on objects" +! WRITE(*,*) "timestamps on objects" ! /* Create group creation property list */ CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) @@ -749,7 +599,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER :: arank = 1 ! Attribure rank INTEGER :: error - WRITE(*,*) "link creation (w/new group format)" +! WRITE(*,*) "link creation (w/new group format)" ! /* Create a file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) @@ -846,7 +696,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) INTEGER :: error - WRITE(*,*) "moving and copying links preserves their properties (w/new group format)" +! WRITE(*,*) "moving and copying links preserves their properties (w/new group format)" !/* Create a file creation property list with creation order stored for links ! * in the root group @@ -997,165 +847,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) END SUBROUTINE test_move_preserves -!!$!/*------------------------------------------------------------------------- -!!$! * Function: ud_hard_links -!!$! * -!!$! * Purpose: Check that the functionality of hard links can be duplicated -!!$! * with user-defined links. -!!$! * -!!$! * -!!$! * Programmer: M.S. Breitenfeld -!!$! * February, 2008 -!!$! * -!!$! *------------------------------------------------------------------------- -!!$! */ -!!$! -!!$!/* Callback functions for UD hard links. */ -!!$!/* UD_hard_create increments the object's reference count */ -!!$ -!!$ SUBROUTINE ud_hard_links(fapl, total_error) -!!$ -!!$ USE HDF5 ! This module contains all necessary modules -!!$ -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(OUT) :: total_error -!!$ INTEGER(HID_T), INTENT(IN) :: fapl -!!$ -!!$ INTEGER(HID_T) :: fid ! /* File ID */ -!!$ INTEGER(HID_T) :: gid ! /* Group IDs */ -!!$ -!!$ CHARACTER(LEN=10) :: objname = 'objname.h5' ! /* Object name */ -!!$ CHARACTER(LEN=10), PARAMETER :: filename = 'filname.h5' -!!$ -!!$ INTEGER(HSIZE_T) :: name_len ! /* Size of an empty file */ -!!$ -!!$ INTEGER, PARAMETER :: UD_HARD_TYPE=201 -!!$ LOGICAL :: registered -!!$ -!!$!/* Link information */ -!!$ -!!$! ssize_t name_len; /* Length of object name */ -!!$! h5_stat_size_t empty_size; /* Size of an empty file */ -!!$ -!!$ -!!$ WRITE(*,*) "user-defined hard link (w/new group format)" -!!$ -!!$ ! /* Set up filename and create file*/ -!!$ -!!$ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl) -!!$ CALL check("h5fcreate_f",error,total_error) -!!$ -!!$ ! /* Close file */ -!!$ CALL h5fclose_f(fid, error) -!!$ CALL check("h5fclose_f",error,total_error) -!!$ -!!$ ! if((empty_size = h5_get_file_size(filename))<0) TEST_ERROR -!!$ -!!$ ! /* Create file */ -!!$ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl) -!!$ CALL check("h5fcreate_f",error,total_error) -!!$ -!!$ ! /* Check that external links are registered and UD hard links are not */ -!!$ -!!$ CALL H5Lis_registered(H5L_TYPE_EXTERNAL, registered, error) -!!$ CALL VerifyLogical("H5Lis_registered", registered, .TRUE., total_error) -!!$ -!!$ CALL H5Lis_registered(UD_HARD_TYPE, registered, error) -!!$ CALL VerifyLogical("H5Lis_registered", registered, .FALSE., total_error) -!!$ -!!$ !/* Register "user-defined hard links" with the library */ -!!$! if(H5Lregister(UD_hard_class) < 0) TEST_ERROR -!!$ -!!$ /* Check that UD hard links are now registered */ -!!$ if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR -!!$ if(H5Lis_registered(UD_HARD_TYPE) != TRUE) TEST_ERROR -!!$ -!!$ /* Create a group for the UD hard link to point to */ -!!$ if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Get address for the group to give to the hard link */ -!!$ if(H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ if(H5Gclose(gid) < 0) TEST_ERROR -!!$ -!!$ -!!$ /* Create a user-defined "hard link" to the group using the address we got -!!$ * from H5Lget_info */ -!!$ if(H5Lcreate_ud(fid, "ud_link", UD_HARD_TYPE, &(li.u.address), sizeof(haddr_t), H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Close and re-open file to ensure that data is written to disk */ -!!$ if(H5Fclose(fid) < 0) TEST_ERROR -!!$ if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Open group through UD link */ -!!$ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check name */ -!!$ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR -!!$ if(HDstrcmp(objname, "/group")) TEST_ERROR -!!$ -!!$ /* Create object in group */ -!!$ if((gid2 = H5Gcreate2(gid, "new_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Close groups*/ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ if(H5Gclose(gid) < 0) TEST_ERROR -!!$ -!!$ /* Re-open group without using ud link to check that it was created properly */ -!!$ if((gid = H5Gopen2(fid, "group/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check name */ -!!$ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR -!!$ if(HDstrcmp(objname, "/group/new_group")) TEST_ERROR -!!$ -!!$ /* Close opened object */ -!!$ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check that H5Lget_objinfo works on the hard link */ -!!$ if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ /* UD hard links have no query function, thus return a "link length" of 0 */ -!!$ if(li.u.val_size != 0) TEST_ERROR -!!$ if(UD_HARD_TYPE != li.type) { -!!$ H5_FAILED(); -!!$ puts(" Unexpected link class - should have been a UD hard link"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Unlink the group pointed to by the UD link. It shouldn't be -!!$ * deleted because of the UD link. */ -!!$ if(H5Ldelete(fid, "/group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Ensure we can open the group through the UD link */ -!!$ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Unlink the group contained within it. */ -!!$ if(H5Ldelete(gid, "new_group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Now delete the UD link. This should cause the group to be -!!$ * deleted, too. */ -!!$ if(H5Ldelete(fid, "ud_link", H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Close file */ -!!$ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* The file should be empty again. */ -!!$ if(empty_size != h5_get_file_size(filename)) TEST_ERROR -!!$ -!!$ if(H5Lunregister(UD_HARD_TYPE) < 0) FAIL_STACK_ERROR -!!$ -!!$ PASSED(); -!!$ return 0; -!!$ -!!$ error: -!!$ H5E_BEGIN_TRY { -!!$ H5Gclose(gid2); -!!$ H5Gclose(gid); -!!$ H5Fclose(fid); -!!$ } H5E_END_TRY; -!!$ return -1; -!!$} /* end ud_hard_links() */ - !/*------------------------------------------------------------------------- ! * Function: lifecycle ! * @@ -1211,7 +902,7 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) INTEGER :: H5G_CRT_GINFO_EST_NAME_LEN = 8 logical :: cleanup - WRITE(*,*) 'group lifecycle' +! WRITE(*,*) 'group lifecycle' ! /* Create file */ CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl2) @@ -1283,105 +974,6 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL verify("H5Pget_est_link_info_f", est_name_len, LIFECYCLE_EST_NAME_LEN,total_error) - ! /* Use internal testing routine to check that the group has no links or symbol table */ - ! if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR - -!!$ /* Create first "bottom" group */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0); -!!$ IF((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Check on bottom group's status */ -!!$ if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR -!!$ -!!$ /* Close bottom group */ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR -!!$ if(nmsgs != 1) TEST_ERROR -!!$ -!!$ /* Create several more bottom groups, to push the top group almost to a symbol table */ -!!$ /* (Start counting at '1', since we've already created one bottom group */ -!!$ for(u = 1; u < LIFECYCLE_MAX_COMPACT; u++) { -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Check on bottom group's status */ -!!$ if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR -!!$ -!!$ /* Close bottom group */ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR -!!$ if(nmsgs != LIFECYCLE_MAX_COMPACT) TEST_ERROR -!!$ if(H5G_is_new_dense_test(gid) != FALSE) TEST_ERROR -!!$ -!!$ /* Check that the object header is only one chunk and the space has been allocated correctly */ -!!$ if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total != 151) TEST_ERROR -!!$ if(oinfo.hdr.space.free != 0) TEST_ERROR -!!$ if(oinfo.hdr.nmesgs != 6) TEST_ERROR -!!$ if(oinfo.hdr.nchunks != 1) TEST_ERROR -!!$ -!!$ /* Create one more "bottom" group, which should push top group into using a symbol table */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Check on bottom group's status */ -!!$ if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR -!!$ -!!$ /* Close bottom group */ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR -!!$ -!!$ /* Check that the object header is still one chunk and the space has been allocated correctly */ -!!$ if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total != 151) TEST_ERROR -!!$ if(oinfo.hdr.space.free != 92) TEST_ERROR -!!$ if(oinfo.hdr.nmesgs != 3) TEST_ERROR -!!$ if(oinfo.hdr.nchunks != 1) TEST_ERROR -!!$ -!!$ /* Unlink objects from top group */ -!!$ while(u >= LIFECYCLE_MIN_DENSE) { -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ u--; -!!$ } /* end while */ -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR -!!$ -!!$ /* Unlink one more object from the group, which should transform back to using links */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ u--; -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR -!!$ if(nmsgs != (LIFECYCLE_MIN_DENSE - 1)) TEST_ERROR -!!$ -!!$ /* Unlink last two objects from top group */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ u--; -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR !/* Close top group */ CALL H5Gclose_f(gid, error) @@ -1400,12 +992,6 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL H5Fclose_f(fid,error) CALL check("H5Fclose_f",error,total_error) -!!$ /* Get size of file as empty */ -!!$ if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR -!!$ -!!$ /* Verify that file is correct size */ -!!$ if(file_size != empty_size) TEST_ERROR - IF(cleanup) CALL h5_cleanup_f("fixx", H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) @@ -1450,12 +1036,6 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) LOGICAL :: Lexists - -!!$ if(new_format) -!!$ TESTING("link queries (w/new group format)") -!!$ else -!!$ TESTING("link queries") - ! /* Open the file */ CALL H5Fopen_f(filename, H5F_ACC_RDONLY_F, file, error,access_prp=fapl) CALL check("H5Fopen_f",error,total_error) @@ -1483,93 +1063,11 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL H5Lexists_f(file,"grp1/hard",Lexists, error) CALL verifylogical("test_lcpl.H5Lexists", Lexists,.TRUE.,total_error) - -!!$ /* Symbolic link */ -!!$ if(H5Oget_info_by_name(file, "grp1/soft", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5O_TYPE_DATASET != oinfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { -!!$ H5_FAILED(); -!!$ puts(" Soft link test failed. Link seems not to point to the "); -!!$ puts(" expected file location."); -!!$ TEST_ERROR -!!$ } /* end if */ - -! CALL H5Lget_val(file, "grp1/soft", INT(LEN(linkval), SIZE_T), linkval, error) - - -!!$ if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(HDstrcmp(linkval, "/d1")) { -!!$ H5_FAILED(); -!!$ puts(" Soft link test failed. Wrong link value"); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR -!!$ -!!$ /* Dangling link */ -!!$ H5E_BEGIN_TRY { -!!$ status = H5Oget_info_by_name(file, "grp1/dangle", &oinfo2, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(status >= 0) { -!!$ H5_FAILED(); -!!$ puts(" H5Oget_info_by_name() should have failed for a dangling link."); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5L_TYPE_SOFT != linfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_val(file, "grp1/dangle", linkval, sizeof linkval, H5P_DEFAULT) < 0) { -!!$ H5_FAILED(); -!!$ printf(" %d: Can't retrieve link value\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(HDstrcmp(linkval, "foobar")) { -!!$ H5_FAILED(); -!!$ puts(" Dangling link test failed. Wrong link value"); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR -!!$ -!!$ /* Recursive link */ -!!$ H5E_BEGIN_TRY { -!!$ status = H5Oget_info_by_name(file, "grp1/recursive", &oinfo2, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(status >= 0) { -!!$ H5_FAILED(); -!!$ puts(" H5Oget_info_by_name() should have failed for a recursive link."); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5L_TYPE_SOFT != linfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_val(file, "grp1/recursive", linkval, sizeof linkval, H5P_DEFAULT) < 0) { -!!$ H5_FAILED(); -!!$ printf(" %d: Can't retrieve link value\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(HDstrcmp(linkval, "/grp1/recursive")) { -!!$ H5_FAILED(); -!!$ puts(" Recursive link test failed. Wrong link value"); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Non-existant link */ -!!$ if(H5Lexists(file, "foobar", H5P_DEFAULT) == TRUE) FAIL_STACK_ERROR - ! /* Cleanup */ - CALL H5Fclose_f(file,error) - CALL check("H5Fclose_f",error,total_error) + CALL H5Fclose_f(file,error) + CALL check("H5Fclose_f",error,total_error) - END SUBROUTINE cklinks +END SUBROUTINE cklinks !/*------------------------------------------------------------------------- @@ -1647,37 +1145,35 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) ! /* Loop over using index for creation order value */ DO i = 1, 2 ! /* Print appropriate test message */ - IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN - IF(iorder == H5_ITER_INC_F)THEN - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/o creation order index" - ENDIF - ELSE - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/o creation order index" - ENDIF - ENDIF - ELSE - IF(iorder == H5_ITER_INC_F)THEN - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/o creation order index" - ENDIF - ELSE - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/o creation order index" - ENDIF - ENDIF - ENDIF -! CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) -! IF(error .NE. 0) STOP +!!$ IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN +!!$ IF(iorder == H5_ITER_INC_F)THEN +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/o creation order index" +!!$ ENDIF +!!$ ELSE +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/o creation order index" +!!$ ENDIF +!!$ ENDIF +!!$ ELSE +!!$ IF(iorder == H5_ITER_INC_F)THEN +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/o creation order index" +!!$ ENDIF +!!$ ELSE +!!$ IF(use_index(i))THEN +!!$ WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/creation order index" +!!$ ELSE +!!$ WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/o creation order index" +!!$ ENDIF +!!$ ENDIF +!!$ ENDIF ! /* Create file */ CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, access_prp=fapl) @@ -1771,158 +1267,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) !!$ PRINT*,objname, tmpname !!$ CALL verifyString("delete_by_idx.H5Lget_name_by_idx_f", objname, tmpname, total_error) ENDDO -!!$ -!!$ /* Delete last link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (empty) */ -!!$ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR -!!$ -!!$ /* Create more links, to push group into dense form */ -!!$ for(u = 0; u < (max_compact * 2); u++) { -!!$ hid_t group_id2; /* Group ID */ -!!$ -!!$ /* Make name for link */ -!!$ sprintf(objname, "filler %02u", u); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ if(H5Gclose(group_id2) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (dense) */ -!!$ if(u >= max_compact) -!!$ if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR -!!$ -!!$ /* Verify link information for new link */ -!!$ if(link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Check for out of bound deletion again */ -!!$ H5E_BEGIN_TRY { -!!$ ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(ret >= 0) TEST_ERROR -!!$ -!!$ /* Delete links from dense group, in appropriate order */ -!!$ for(u = 0; u < ((max_compact * 2) - 1); u++) { -!!$ /* Delete first link in appropriate order */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for first link in appropriate order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) { -!!$ if(linfo.corder != (u + 1)) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(linfo.corder != ((max_compact * 2) - (u + 2))) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Verify the name for first link in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) -!!$ sprintf(objname, "filler %02u", (u + 1)); -!!$ else -!!$ sprintf(objname, "filler %02u", ((max_compact * 2) - (u + 2))); -!!$ if(HDstrcmp(objname, tmpname)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete last link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (empty) */ -!!$ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(group_id) == TRUE) TEST_ERROR -!!$ -!!$ /* Check for deletion on empty group again */ -!!$ H5E_BEGIN_TRY { -!!$ ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(ret >= 0) TEST_ERROR -!!$ -!!$ -!!$ /* Delete links in middle */ -!!$ -!!$ -!!$ /* Create more links, to push group into dense form */ -!!$ for(u = 0; u < (max_compact * 2); u++) { -!!$ hid_t group_id2; /* Group ID */ -!!$ -!!$ /* Make name for link */ -!!$ sprintf(objname, "filler %02u", u); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ if(H5Gclose(group_id2) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (dense) */ -!!$ if(u >= max_compact) -!!$ if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR -!!$ -!!$ /* Verify link information for new link */ -!!$ if(link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete every other link from dense group, in appropriate order */ -!!$ for(u = 0; u < max_compact; u++) { -!!$ /* Delete link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for current link in appropriate order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) { -!!$ if(linfo.corder != ((u * 2) + 1)) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(linfo.corder != ((max_compact * 2) - ((u * 2) + 2))) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Verify the name for current link in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) -!!$ sprintf(objname, "filler %02u", ((u * 2) + 1)); -!!$ else -!!$ sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 2))); -!!$ if(HDstrcmp(objname, tmpname)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete remaining links from dense group, in appropriate order */ -!!$ for(u = 0; u < (max_compact - 1); u++) { -!!$ /* Delete link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for first link in appropriate order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) { -!!$ if(linfo.corder != ((u * 2) + 3)) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(linfo.corder != ((max_compact * 2) - ((u * 2) + 4))) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Verify the name for first link in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) -!!$ sprintf(objname, "filler %02u", ((u * 2) + 3)); -!!$ else -!!$ sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 4))); -!!$ if(HDstrcmp(objname, tmpname)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete last link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (empty) */ -!!$ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(group_id) == TRUE) TEST_ERROR -!!$ -!!$ -!!$ + ! /* Close the group */ CALL H5Gclose_f(group_id, error) CALL check("delete_by_idx.H5Gclose_f", error, total_error) @@ -1941,17 +1286,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error) ENDDO ENDDO ENDDO -!!$ -!!$ return 0; -!!$ -!!$error: -!!$ H5E_BEGIN_TRY { -!!$ H5Pclose(gcpl_id); -!!$ H5Gclose(group_id); -!!$ H5Fclose(file_id); -!!$ } H5E_END_TRY; -!!$ return -1; -!!$} /* end delete_by_idx() */ + END SUBROUTINE delete_by_idx @@ -2056,122 +1391,6 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! Try with a buffer set to small -!!$ size_tmp = INT(4,SIZE_T) -!!$ CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), size_tmp, tmpname, error) -!!$ CALL check("H5Lget_name_by_idx_f", error, total_error) -!!$ CALL verifyString("H5Lget_name_by_idx_f", linkname, tmpname, total_error) - - -!!$ -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR - -!!$ /* Don't test "native" order if there is no creation order index, since -!!$ * there's not a good way to easily predict the link's order in the name -!!$ * index. -!!$ */ -!!$ if(use_index) { -!!$ /* Verify the link information for first link, in native creation order (which is increasing) */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in native creation order (which is increasing) */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in native creation order (which is increasing) */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in native creation order (which is increasing) */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the link information for first link, in decreasing creation order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in decreasing creation order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in decreasing creation order */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in decreasing creation order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ -!!$ -!!$ /* Verify the link information for first link, in increasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in increasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in increasing link name order */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in increasing link name order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ -!!$ /* Don't test "native" order queries on link name order, since there's not -!!$ * a good way to easily predict the order of the links in the name index. -!!$ */ -!!$ -!!$ /* Verify the link information for first link, in decreasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in decreasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in decreasing link name order */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in decreasing link name order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ -!!$ /* Success */ -!!$ return(0); -!!$ -!!$error: -!!$ /* Failure */ -!!$ return(-1); -!!$} /* end link_info_by_idx_check() */ END SUBROUTINE link_info_by_idx_check @@ -2235,7 +1454,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & INTEGER :: i INTEGER :: tmp1, tmp2 - WRITE(*,*) "link creation property lists (w/new group format)" +! WRITE(*,*) "link creation property lists (w/new group format)" !/* Actually, intermediate group creation is tested elsewhere (tmisc). @@ -2586,13 +1805,8 @@ SUBROUTINE lapl_nlinks( fapl, total_error) INTEGER(hsize_t), DIMENSION(2) :: dims INTEGER(size_t) :: buf_size = 7 - WRITE(*,*) "adjusting nlinks with LAPL (w/new group format)" +! WRITE(*,*) "adjusting nlinks with LAPL (w/new group format)" -!!$ /* Make certain test is valid */ -!!$ /* XXX: should probably make a "generic" test that creates the proper -!!$ * # of links based on this value - QAK -!!$ */ -!!$ HDassert(H5L_NUM_LINKS == 16); ! /* Create file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) |