summaryrefslogtreecommitdiffstats
path: root/fortran/test/tH5I.f90
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2002-09-23 22:06:01 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2002-09-23 22:06:01 (GMT)
commitf5096c200093eaf5b7dae72a3f672b2d7f457ca6 (patch)
tree457ebff96156da5e20133905167b7ac714428c30 /fortran/test/tH5I.f90
parent47fc4908325071261476bbdabb1be696323f9298 (diff)
downloadhdf5-f5096c200093eaf5b7dae72a3f672b2d7f457ca6.zip
hdf5-f5096c200093eaf5b7dae72a3f672b2d7f457ca6.tar.gz
hdf5-f5096c200093eaf5b7dae72a3f672b2d7f457ca6.tar.bz2
[svn-r5940]
Purpose: Bug fix, code improvement Description: Fortran tests didn't cleanup created files. Also HDF5_PREFIX and HDF5_PARAPREFIX were not used to specify location of the files. There was a redundant file in the testpar directory that contained an error reporting function used by both serial and parallel tests. Solution: Created library h5test_fortran.a that contains functions used by the serial and parallel tests. It includes Fortran and C functions that may be called from Fortran programs to report errors, to modify file names and to cleanup files after run. Modified test code to use new functions. Platforms tested: Linux 2.2 (eirene) serial IRIX64 (modi4) parallel with HDF5_PREFIX and HDF5_PARAPREFIX set to $SCR Solris 2.7 with mpich 1.2.4 with HDF5_PARAPREFIX set to /tmp/epourmal
Diffstat (limited to 'fortran/test/tH5I.f90')
-rw-r--r--fortran/test/tH5I.f9019
1 files changed, 15 insertions, 4 deletions
diff --git a/fortran/test/tH5I.f90 b/fortran/test/tH5I.f90
index 958453b..7fd2edc 100644
--- a/fortran/test/tH5I.f90
+++ b/fortran/test/tH5I.f90
@@ -1,13 +1,16 @@
- SUBROUTINE identifier_test(total_error)
-!THis subroutine tests following functionalities: h5iget_type_f
+ SUBROUTINE identifier_test(cleanup, total_error)
+
+! This subroutine tests following functionalities: h5iget_type_f
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
+ LOGICAL, INTENT(IN) :: cleanup
INTEGER, INTENT(OUT) :: total_error
- CHARACTER(LEN=9), PARAMETER :: filename = "itestf.h5" ! File name
+ CHARACTER(LEN=6), PARAMETER :: filename = "itestf" ! File name
+ CHARACTER(LEN=80) :: fix_filename
CHARACTER(LEN=9), PARAMETER :: dsetname = "itestdset" ! Dataset name
CHARACTER(LEN=10), PARAMETER :: groupname = "itestgroup"! group name
CHARACTER(LEN=10), PARAMETER :: aname = "itestattr"! group name
@@ -40,7 +43,12 @@
!
! Create a new file using default properties.
!
- CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
+ CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error)
+ if (error .ne. 0) then
+ write(*,*) "Cannot modify filename"
+ stop
+ endif
+ CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error)
CALL check("h5fcreate_f",error,total_error)
!
@@ -178,5 +186,8 @@
CALL h5fclose_f(file_id, 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 identifier_test