diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-04-06 02:57:06 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-04-06 02:57:06 (GMT) |
commit | d5a62239587f7cc5de301fa5c6b0919807689818 (patch) | |
tree | 40a36d60dd8ac2d10a45886869cc53d3fdc9181e /hl/fortran/test | |
parent | ebf3d99b955c705217227fb7f8ae4405e941399a (diff) | |
download | hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.zip hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.tar.gz hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.tar.bz2 |
[svn-r22254] Description:
Bring r22085:22251 from trunk to revise_chunks branch.
Also tackle some testing issues in test/objcopy.c test and clean up
some warnings.
Tested on:
FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode
FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (ostrich) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (ember) w/Intel compilers, w/paralle, C++ & FORTRAN,
in production mode
Mac OS X/32 10.7.3 (amazon) in debug mode
Mac OS X/32 10.7.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.7.3 (amazon) w/parallel, in debug mode
Diffstat (limited to 'hl/fortran/test')
-rw-r--r-- | hl/fortran/test/tstds.f90 | 10 | ||||
-rw-r--r--[-rwxr-xr-x] | hl/fortran/test/tstimage.f90 | 0 | ||||
-rw-r--r-- | hl/fortran/test/tstlite.f90 | 53 | ||||
-rw-r--r--[-rwxr-xr-x] | hl/fortran/test/tsttable.f90 | 0 |
4 files changed, 44 insertions, 19 deletions
diff --git a/hl/fortran/test/tstds.f90 b/hl/fortran/test/tstds.f90 index 8817989..c73e1c4 100644 --- a/hl/fortran/test/tstds.f90 +++ b/hl/fortran/test/tstds.f90 @@ -186,7 +186,10 @@ SUBROUTINE test_testds(err) name_len = 25 name = '' CALL H5DSget_scale_name_f(dsid, name, name_len, err) - IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimension Scale Set 1")THEN + IF(err.LT.0 .OR. & + name_len.NE.21 .OR. & + TRIM(name).NE."Dimension Scale Set 1" .OR. & + name(22:25).NE.' ')THEN err = FAILED CALL write_test_status(err) RETURN @@ -293,7 +296,10 @@ SUBROUTINE test_testds(err) label_len = 25 label = '' CALL H5DSget_label_f(did, DIM2, label, label_len, err) - IF(err.LT.0.OR.label(1:label_len).NE."Label12".OR.label_len.NE.7)THEN + IF(err.LT.0.OR. & + label(1:label_len).NE."Label12" .OR. & + label_len.NE.7 .OR. & + label(8:25).NE.' ')THEN err = FAILED CALL write_test_status(err) RETURN diff --git a/hl/fortran/test/tstimage.f90 b/hl/fortran/test/tstimage.f90 index 3794bbf..3794bbf 100755..100644 --- a/hl/fortran/test/tstimage.f90 +++ b/hl/fortran/test/tstimage.f90 diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90 index 9329dba..0b5a138 100644 --- a/hl/fortran/test/tstlite.f90 +++ b/hl/fortran/test/tstlite.f90 @@ -1342,7 +1342,9 @@ SUBROUTINE test_attributes() IMPLICIT NONE CHARACTER(len=9), PARAMETER :: filename = "dsetf5.h5"! File name + CHARACTER(len=9), PARAMETER :: filename1 ="tattr.h5" ! C written attribute file INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: file_id1 INTEGER, PARAMETER :: DIM1 = 10; ! Dimension of array CHARACTER(LEN=5), PARAMETER :: attrname1 = "attr1" ! Attribute name CHARACTER(LEN=5), PARAMETER :: attrname2 = "attr2" ! Attribute name @@ -1350,9 +1352,11 @@ SUBROUTINE test_attributes() CHARACTER(LEN=5), PARAMETER :: attrname4 = "attr4" ! Attribute name CHARACTER(LEN=5), PARAMETER :: attrname5 = "attr5" ! Attribute name CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer + CHARACTER(LEN=16), PARAMETER :: buf_c = "string attribute" CHARACTER(LEN=8) :: bufr1 ! Data buffer CHARACTER(LEN=10) :: bufr1_lg ! Data buffer - CHARACTER(LEN=6) :: bufr1_sm ! Data buffer + CHARACTER(LEN=16) :: bufr_c ! Data buffer + CHARACTER(LEN=18) :: bufr_c_lg ! Data buffer INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer REAL, DIMENSION(DIM1) :: buf3 ! Data buffer @@ -1370,6 +1374,7 @@ SUBROUTINE test_attributes() INTEGER :: rank = 1 ! Dataset rank CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name INTEGER, DIMENSION(DIM1) :: buf ! Data buffer + ! ! Initialize FORTRAN predefined datatypes. @@ -1488,15 +1493,12 @@ SUBROUTINE test_attributes() CALL passed() - - !------------------------------------------------------------------------- ! string !------------------------------------------------------------------------- CALL test_begin(' Set/Get attributes string ') - ! ! write attribute. ! @@ -1530,19 +1532,36 @@ SUBROUTINE test_attributes() STOP ENDIF - ! - ! read attribute into a fortran character buf that is smaller then buf1. - ! - CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_sm,errcode) - - ! - ! compare read and write buffers. - ! - IF ( buf1(1:6) .NE. bufr1_sm(1:6) ) THEN - PRINT *, 'smaller read buffer differs from write buffer' - PRINT *, buf1, ' and ', bufr1_sm - STOP - ENDIF + ! + ! ** Test reading a string that was created with a C program ** + ! + +!!$ CALL h5fopen_f(filename1, H5F_ACC_RDONLY_F, file_id1, errcode) +!!$ +!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c, errcode) +!!$ ! +!!$ ! compare read and write buffers. +!!$ ! +!!$ IF ( bufr_c .NE. buf_c ) THEN +!!$ PRINT *, 'read buffer differs from write buffer' +!!$ PRINT *, bufr1, ' and ', buf_c +!!$ STOP +!!$ ENDIF +!!$ ! +!!$ ! read attribute into a fortran character buf that is larger then buf_c. +!!$ ! +!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c_lg, errcode) +!!$ +!!$ ! +!!$ ! compare read and write buffers, make sure C NULL character was removed. +!!$ ! +!!$ IF ( buf_c(1:16) .NE. bufr_c_lg(1:16) .AND. bufr_c_lg(17:18) .NE. ' ' ) THEN +!!$ PRINT *, 'larger read buffer differs from write buffer' +!!$ PRINT *, buf_c, ' and ', bufr_c_lg +!!$ STOP +!!$ ENDIF + +!!$ CALL h5fclose_f(file_id1, errcode) CALL passed() diff --git a/hl/fortran/test/tsttable.f90 b/hl/fortran/test/tsttable.f90 index 66ec5c6..66ec5c6 100755..100644 --- a/hl/fortran/test/tsttable.f90 +++ b/hl/fortran/test/tsttable.f90 |