diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2012-09-27 19:20:09 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2012-09-27 19:20:09 (GMT) |
commit | 32a131ea70f988d35bed87631c9cec68b2388ba5 (patch) | |
tree | afbd278b07db75df7e40393095b41128569e40b8 /fortran/test | |
parent | a81cc2ac7ef875999f01a91a9a492e19da94ce56 (diff) | |
download | hdf5-32a131ea70f988d35bed87631c9cec68b2388ba5.zip hdf5-32a131ea70f988d35bed87631c9cec68b2388ba5.tar.gz hdf5-32a131ea70f988d35bed87631c9cec68b2388ba5.tar.bz2 |
[svn-r22825] Fix for: HDFFV-7903 Fortran problem writing control character to a dataset
Tested: (jam, gfortran)
Diffstat (limited to 'fortran/test')
-rw-r--r-- | fortran/test/Makefile.in | 2 | ||||
-rw-r--r-- | fortran/test/fortranlib_test_F03.f90 | 4 | ||||
-rw-r--r-- | fortran/test/tH5T_F03.f90 | 41 |
3 files changed, 45 insertions, 2 deletions
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 33f1022..e42b080 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -290,7 +290,6 @@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GPFS = @GPFS@ GREP = @GREP@ -H5BLD_STATIC = @H5BLD_STATIC@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -305,7 +304,6 @@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ -HDF5_USE_SHLIB = @HDF5_USE_SHLIB@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ HDF_FORTRAN2003 = @HDF_FORTRAN2003@ diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90 index b674452..c8830d6 100644 --- a/fortran/test/fortranlib_test_F03.f90 +++ b/fortran/test/fortranlib_test_F03.f90 @@ -117,6 +117,10 @@ PROGRAM fortranlibtest_F03 CALL write_test_status(ret_total_error, ' Testing writing/reading string datatypes, using C_LOC', total_error) ret_total_error = 0 + CALL vl_test_special_char(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing string datatypes containing control characters', total_error) + + ret_total_error = 0 CALL test_create(ret_total_error) CALL write_test_status(ret_total_error, & ' Testing filling functions', & diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index 2cf0a84..7c99856 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -2800,6 +2800,47 @@ SUBROUTINE t_string(total_error) END SUBROUTINE t_string +SUBROUTINE vl_test_special_char(cleanup, total_error) + + USE hdf5 + IMPLICIT NONE + + INTERFACE + SUBROUTINE setup_buffer(data_in, line_lengths, char_type) + USE hdf5 + USE ISO_C_BINDING + IMPLICIT NONE + CHARACTER(len=*), DIMENSION(:) :: data_in + INTEGER(size_t), DIMENSION(:) :: line_lengths + CHARACTER(KIND=C_CHAR,LEN=*) :: char_type + END SUBROUTINE setup_buffer + END INTERFACE + + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=16), PARAMETER :: filename = "t_controlchar.h5" + INTEGER, PARAMETER :: line_length = 10 + INTEGER(hid_t) :: file + INTEGER(hid_t) :: dataset0 + CHARACTER(len=line_length), DIMENSION(1:100) :: data_in + CHARACTER(len=line_length), DIMENSION(1:100) :: data_out + INTEGER(size_t), DIMENSION(1:100) :: line_lengths + INTEGER(hid_t) :: string_id, space, dcpl + INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/0/) + INTEGER(hsize_t), DIMENSION(1:1) :: max_dims = (/0/) + INTEGER(hsize_t), DIMENSION(1:2) :: data_dims = (/0,0/) + INTEGER(hsize_t), DIMENSION(1:1) :: chunk =(/10/) + INTEGER, PARAMETER :: ncontrolchar = 7 + CHARACTER(KIND=C_CHAR,LEN=1), DIMENSION(1:ncontrolchar) :: controlchar = & + (/C_ALERT, C_BACKSPACE,C_CARRIAGE_RETURN, C_FORM_FEED,C_HORIZONTAL_TAB,C_VERTICAL_TAB, C_NEW_LINE/) + INTEGER :: i, j, n, error + n = 8 + ! + ! Create a new file using the default properties. + ! + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f",error, total_error) !------------------------------------------------------------------------- ! Function: test_nbit |