[svn-r12347] Purpose: Maintenance/bug fix

Description: When --enable-group-revision flag was used, h5fget_filesize_f
             function returned different value from expected one. Test failed
             with false negative result.


Solution: Added Fortran function h5_group_revision_f and its
          C stub to check if macro H5_GROUP_REVISION is defined.
          Expected value from h5fget_filesize_f is set up accordingly.

Platforms tested: copper, shanti and heping with and without
                  --enable-group-revision configuration flag

Misc. update:
This commit is contained in:
Elena Pourmal 2006-05-13 19:43:58 -05:00
parent 916399d31e
commit 0742585e9a
4 changed files with 67 additions and 1 deletions

View File

@ -128,3 +128,22 @@ nh5_exit_c(int_f *status)
HDexit((int)*status);
} /* h5_exit_c */
/*----------------------------------------------------------------------------
* Name: h5_group_revision_c
* Purpose: Checks if H5_GROUP_REVISION variable defined
* Inputs:
* Returns: 1 if defines, 0 otherwise
* Programmer: Elena Pourmal
* Saturday, May 13, 2006
* Modifications:
*---------------------------------------------------------------------------*/
int_f
nh5_group_revision_c()
{
int_f ret =0;
#ifdef H5_GROUP_REVISION
ret = 1;
#endif
return ret;
} /* h5_group_revision_c */

View File

@ -25,6 +25,7 @@ char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
# define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)
# define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)
# define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)
# define nh5_group_revision_c H5_FC_FUNC_(h5_group_revision_c, H5_GROUP_REVISION_C)
H5_FCTESTDLL int_f nh5_fixname_c
(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl, _fcd full_name, size_t_f *full_namelen);
@ -35,3 +36,4 @@ H5_FCTESTDLL int_f nh5_cleanup_c
H5_FCTESTDLL void nh5_exit_c
(int_f *status);
H5_FCTESTDLL int_f nh5_group_revision_c();

View File

@ -696,6 +696,8 @@
LOGICAL, INTENT(IN) :: cleanup
INTEGER, INTENT(OUT) :: total_error
INTEGER :: error
INTEGER flag
INTEGER :: free_space_out
!
CHARACTER(LEN=10), PARAMETER :: filename = "file_space"
@ -745,9 +747,16 @@
! Check the free space now
CALL h5fget_freespace_f(fid, free_space, error)
CALL h5_group_revision_f(flag)
CALL check("h5fget_freespace_f",error,total_error)
if(flag .eq. 1) then
free_space_out = 232
else
free_space_out = 1024
endif
if(error .eq.0 .and. free_space .ne. free_space_out) then
! if(error .eq.0 .and. free_space .ne. 232) then
if(error .eq.0 .and. free_space .ne. 1024) then
! if(error .eq.0 .and. free_space .ne. 1024) then
total_error = total_error + 1
write(*,*) "3: Wrong amount of free space reported, ", free_space
endif

View File

@ -200,3 +200,39 @@
CALL h5_exit_c(status)
END SUBROUTINE h5_exit_f
!----------------------------------------------------------------------
! Name: h5_group_revision_f
!
! Purpose: Checks if group revisions are defined
!
! Inputs:
!
! Outputs:
! flag
!
! Programmer: Elena Pourmal
! May 13, 2006
!
!
!----------------------------------------------------------------------
SUBROUTINE h5_group_revision_f(flag)
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$attributes dllexport :: h5_group_revision_f
!DEC$endif
IMPLICIT NONE
INTEGER, INTENT(OUT) :: flag ! Return code
INTEGER :: flag1
INTERFACE
INTEGER FUNCTION h5_group_revision_c()
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5_GROUP_REVISION_C':: h5_group_revision_c
!DEC$ ENDIF
END FUNCTION h5_group_revision_c
END INTERFACE
flag = h5_group_revision_c()
END SUBROUTINE h5_group_revision_f