summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2006-05-14 00:43:58 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2006-05-14 00:43:58 (GMT)
commit0742585e9aaacf513a5ab44da5e4755c9c0c5d60 (patch)
tree43caca4f46fcf3e434db97b376f265ee0f039a18 /fortran
parent916399d31ed063c0d7e8b7aba864841168a37b93 (diff)
downloadhdf5-0742585e9aaacf513a5ab44da5e4755c9c0c5d60.zip
hdf5-0742585e9aaacf513a5ab44da5e4755c9c0c5d60.tar.gz
hdf5-0742585e9aaacf513a5ab44da5e4755c9c0c5d60.tar.bz2
[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:
Diffstat (limited to 'fortran')
-rw-r--r--fortran/test/t.c19
-rw-r--r--fortran/test/t.h2
-rw-r--r--fortran/test/tH5F.f9011
-rw-r--r--fortran/test/tf.f9036
4 files changed, 67 insertions, 1 deletions
diff --git a/fortran/test/t.c b/fortran/test/t.c
index cb71fd2..9eede1a 100644
--- a/fortran/test/t.c
+++ b/fortran/test/t.c
@@ -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 */
diff --git a/fortran/test/t.h b/fortran/test/t.h
index 79c6d4b..47062ac 100644
--- a/fortran/test/t.h
+++ b/fortran/test/t.h
@@ -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();
diff --git a/fortran/test/tH5F.f90 b/fortran/test/tH5F.f90
index f85d3e9..2cc4766 100644
--- a/fortran/test/tH5F.f90
+++ b/fortran/test/tH5F.f90
@@ -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
diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90
index f62c3d5..6dc3c02 100644
--- a/fortran/test/tf.f90
+++ b/fortran/test/tf.f90
@@ -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