summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2008-10-01 00:41:00 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2008-10-01 00:41:00 (GMT)
commit2041f537e60c56ac9111229d50aacba25062603e (patch)
treed40fc1852099bf1a886d89fed9a4fd6029ea9040 /fortran
parentcdb4e39a1390c666cb634a17b004abe9a492b0c2 (diff)
downloadhdf5-2041f537e60c56ac9111229d50aacba25062603e.zip
hdf5-2041f537e60c56ac9111229d50aacba25062603e.tar.gz
hdf5-2041f537e60c56ac9111229d50aacba25062603e.tar.bz2
[svn-r15742] Maintenance: Merged new Fortran Features and tests from trunk into hdf5_1_8 branch
(used svn merge -r 14941:15740 http://svn.hdfgroup.uiuc.edu/hdf5/trunk/fortran command).
Diffstat (limited to 'fortran')
-rw-r--r--fortran/test/fortranlib_test.f9011
-rw-r--r--fortran/test/fortranlib_test_1_8.f908
-rw-r--r--fortran/test/t.c19
-rw-r--r--fortran/test/t.h4
-rw-r--r--fortran/test/tH5A_1_8.f902
-rw-r--r--fortran/test/tH5P.f9023
-rw-r--r--fortran/test/tH5Sselect.f9016
-rw-r--r--fortran/test/tH5T.f9019
-rw-r--r--fortran/test/tf.f9043
9 files changed, 124 insertions, 21 deletions
diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90
index be8d257..697a9f6 100644
--- a/fortran/test/fortranlib_test.f90
+++ b/fortran/test/fortranlib_test.f90
@@ -25,19 +25,21 @@ PROGRAM fortranlibtest
INTEGER :: total_error = 0
INTEGER :: error
INTEGER :: majnum, minnum, relnum
- LOGICAL :: cleanup = .TRUE.
-! LOGICAL :: cleanup = .FALSE.
LOGICAL :: szip_flag
INTEGER :: ret_total_error
+ LOGICAL :: cleanup, status
+
+ CALL h5open_f(error)
+ cleanup = .TRUE.
+ CALL h5_env_nocleanup_f(status)
+ IF(status) cleanup=.FALSE.
- CALL h5open_f(error)
WRITE(*,*) ' ========================== '
WRITE(*,*) ' FORTRAN tests '
WRITE(*,*) ' ========================== '
CALL h5get_libversion_f(majnum, minnum, relnum, total_error)
IF(total_error .EQ. 0) THEN
-
WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO")
WRITE(*, '(I1)', advance="NO") majnum
WRITE(*, '(".")', advance="NO")
@@ -170,7 +172,6 @@ PROGRAM fortranlibtest
CALL write_test_status(ret_total_error, ' External dataset test', total_error)
ret_total_error = 0
- cleanup = .FALSE.
CALL multi_file_test(cleanup, ret_total_error)
CALL write_test_status(ret_total_error, ' Multi file driver test', total_error)
diff --git a/fortran/test/fortranlib_test_1_8.f90 b/fortran/test/fortranlib_test_1_8.f90
index 4ff3e0f..49835b0 100644
--- a/fortran/test/fortranlib_test_1_8.f90
+++ b/fortran/test/fortranlib_test_1_8.f90
@@ -26,10 +26,14 @@ PROGRAM fortranlibtest
INTEGER :: error
INTEGER :: ret_total_error
INTEGER :: majnum, minnum, relnum
- LOGICAL :: cleanup = .TRUE.
-! LOGICAL :: cleanup = .FALSE.
+ LOGICAL :: cleanup, status
CALL h5open_f(error)
+
+ cleanup = .TRUE.
+ CALL h5_env_nocleanup_f(status)
+ IF(status) cleanup=.FALSE.
+
WRITE(*,*) ' ========================== '
WRITE(*,*) ' FORTRAN 1.8 tests '
WRITE(*,*) ' ========================== '
diff --git a/fortran/test/t.c b/fortran/test/t.c
index de450f9..861a3e7 100644
--- a/fortran/test/t.c
+++ b/fortran/test/t.c
@@ -129,3 +129,22 @@ nh5_exit_c(int_f *status)
HDexit((int)*status);
} /* h5_exit_c */
+/*----------------------------------------------------------------------------
+ * Name: h5_env_nocleanup_c
+ * Purpose: Determines the state of the environment variable HDF5_NOCLEANUP
+ * Input: none
+ * Output: status: 1 - HDF5_NOCLEANUP is set
+ * 0 - HDF5_NOCLEANUP is not set
+ * Returns: none
+ * Programmer: M.S. Breitenfeld
+ * September 30, 3008
+ * Modifications:
+ *---------------------------------------------------------------------------*/
+void
+nh5_env_nocleanup_c(int_f *status)
+{
+ *status = (int_f)0;
+ if (HDgetenv("HDF5_NOCLEANUP"))
+ *status = (int_f)1;
+} /* h5_env_nocleanup_c */
+
diff --git a/fortran/test/t.h b/fortran/test/t.h
index 005eb17..d315bda 100644
--- a/fortran/test/t.h
+++ b/fortran/test/t.h
@@ -26,6 +26,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_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_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);
@@ -36,3 +37,6 @@ H5_FCTESTDLL int_f nh5_cleanup_c
H5_FCTESTDLL void nh5_exit_c
(int_f *status);
+H5_FCTESTDLL void nh5_env_nocleanup_c
+(int_f *status);
+
diff --git a/fortran/test/tH5A_1_8.f90 b/fortran/test/tH5A_1_8.f90
index d45d9e3..c654d03 100644
--- a/fortran/test/tH5A_1_8.f90
+++ b/fortran/test/tH5A_1_8.f90
@@ -167,7 +167,7 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error)
CALL write_test_status(ret_total_error, &
' - Testing deleting attribute by index', &
total_error)
-
+
!!$ CALL test_attr_iterate2(new_format, my_fcpl, my_fapl)
!!$ CALL test_attr_open_by_idx(new_format, my_fcpl, my_fapl)
!!$ CALL test_attr_open_by_name(new_format, my_fcpl, my_fapl)
diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90
index e8e3a1d..7e6c8de 100644
--- a/fortran/test/tH5P.f90
+++ b/fortran/test/tH5P.f90
@@ -372,13 +372,26 @@
! Close the file.
!
CALL h5fclose_f(file_id, error)
- CALL check("h5fclose_f", error, total_error)
+ CALL check("h5fclose_f", error, total_error)
CALL h5pclose_f(fapl, error)
- CALL check("h5pclose_f", error, total_error)
+ CALL check("h5pclose_f", error, total_error)
CALL h5pclose_f(fapl_1, error)
- CALL check("h5pclose_f", error, total_error)
- if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
- CALL check("h5_cleanup_f", error, total_error)
+ CALL check("h5pclose_f", error, total_error)
+ IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+
+ IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+ IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+ IF(cleanup) CALL h5_cleanup_f(filename//'.h5-l', H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+ IF(cleanup) CALL h5_cleanup_f(filename//'.h5-o', H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+ IF(cleanup) CALL h5_cleanup_f(filename//'.h5-r', H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+ IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
RETURN
END SUBROUTINE multi_file_test
diff --git a/fortran/test/tH5Sselect.f90 b/fortran/test/tH5Sselect.f90
index 19364df..400906a 100644
--- a/fortran/test/tH5Sselect.f90
+++ b/fortran/test/tH5Sselect.f90
@@ -1062,9 +1062,15 @@ SUBROUTINE test_select_point(cleanup, total_error)
INTEGER :: i,j; !/* Counters */
! struct pnt_iter pi; /* Custom Pointer iterator struct */
INTEGER :: error !/* Generic return value */
- CHARACTER(LEN=12) :: filename = 'h5s_hyper.h5'
+ CHARACTER(LEN=9) :: filename = 'h5s_hyper'
+ CHARACTER(LEN=80) :: fix_filename
CHARACTER(LEN=1), DIMENSION(1:SPACE2_DIM1,1:SPACE2_DIM2) :: wbuf, rbuf
-
+
+ CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error)
+ IF (error .NE. 0) THEN
+ WRITE(*,*) "Cannot modify filename"
+ STOP
+ ENDIF
xfer_plist = H5P_DEFAULT_F
! MESSAGE(5, ("Testing Element Selection Functions\n"));
@@ -1085,7 +1091,7 @@ SUBROUTINE test_select_point(cleanup, total_error)
!!$ *tbuf++=(uint8_t)((i*SPACE2_DIM2)+j);
!/* Create file */
- CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, fid1, error)
+ CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid1, error)
CALL check("h5fcreate_f", error, total_error)
!/* Create dataspace for dataset */
@@ -1326,6 +1332,10 @@ SUBROUTINE test_select_point(cleanup, total_error)
CALL h5fclose_f(fid1, error)
CALL check("h5fclose_f", error, total_error)
+
+ IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+
END SUBROUTINE test_select_point
diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90
index 0c86b6c..9b8d097 100644
--- a/fortran/test/tH5T.f90
+++ b/fortran/test/tH5T.f90
@@ -800,7 +800,7 @@
SUBROUTINE enumtest(cleanup, total_error)
USE HDF5
- IMPLICIT none
+ IMPLICIT NONE
LOGICAL, INTENT(IN) :: cleanup
INTEGER, INTENT(OUT) :: total_error
@@ -871,7 +871,7 @@
CALL check("H5Tget_order_f",error, total_error)
CALL VERIFY("H5Tget_native_type_f",order1, order2, total_error)
- ! this test depends on whether -i8 was specified needs to account for that FIX -scot-
+ ! this test depends on whether -i8 was specified
!!$ CALL H5Tget_size_f(native_type, type_size1, error)
!!$ CALL check("H5Tget_size_f",error, total_error)
@@ -909,11 +909,16 @@
ENDIF
CALL h5tclose_f(dtype_id,error)
- CALL check("h5tclose_f", error, total_error)
+ CALL check("h5tclose_f", error, total_error)
CALL h5fclose_f(file_id,error)
- CALL check("h5fclose_f", error, total_error)
+ CALL check("h5fclose_f", error, total_error)
+
+ IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+
RETURN
- END SUBROUTINE enumtest
+ END SUBROUTINE enumtest
+
!/*-------------------------------------------------------------------------
! * Function: test_derived_flt
@@ -1114,4 +1119,8 @@ SUBROUTINE test_derived_flt(cleanup, total_error)
CALL h5fclose_f(file,error)
CALL check("h5fclose_f", error, total_error)
+
+ IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+
END SUBROUTINE test_derived_flt
diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90
index d48ede1..b4956ea 100644
--- a/fortran/test/tf.f90
+++ b/fortran/test/tf.f90
@@ -272,3 +272,46 @@ SUBROUTINE h5_exit_f(status)
END SUBROUTINE h5_exit_f
+!----------------------------------------------------------------------
+! Name: h5_env_nocleanup_f
+!
+! Purpose: Uses the HDF5_NOCLEANUP environment variable in Fortran
+! tests to determine if the output files should be removed
+!
+! Inputs:
+!
+! Outputs: HDF5_NOCLEANUP: .true. - don't remove test files
+! .false. - remove test files
+!
+! Programmer: M.S. Breitenfeld
+! September 30, 2008
+!
+!----------------------------------------------------------------------
+SUBROUTINE h5_env_nocleanup_f(HDF5_NOCLEANUP)
+!
+!This definition is needed for Windows DLLs
+!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$attributes dllexport :: h5_env_nocleanup_f
+!DEC$endif
+ IMPLICIT NONE
+ LOGICAL, INTENT(OUT) :: HDF5_NOCLEANUP ! Return code
+ INTEGER :: status
+
+ INTERFACE
+ SUBROUTINE h5_env_nocleanup_c(status)
+ !DEC$ IF DEFINED(HDF5F90_WINDOWS)
+ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_ENV_NOCLEANUP_C':: h5_env_nocleanup_c
+ !DEC$ ENDIF
+ INTEGER :: status
+ END SUBROUTINE h5_env_nocleanup_c
+ END INTERFACE
+
+ CALL h5_env_nocleanup_c(status)
+
+ HDF5_NOCLEANUP = .FALSE.
+ IF(status.EQ.1)THEN
+ HDF5_NOCLEANUP = .TRUE.
+ ENDIF
+
+END SUBROUTINE h5_env_nocleanup_f
+