diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2014-04-08 19:34:42 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2014-04-08 19:34:42 (GMT) |
commit | 9cd1a1bb60c66650208033d61ff377df5ac1a72e (patch) | |
tree | 1983e8fbd82c084d515a6dd1554b094a44123811 /fortran/test/tH5A.f90 | |
parent | d1f2b1a682213d98db080e91c09d3f95b4f2b3b0 (diff) | |
download | hdf5-9cd1a1bb60c66650208033d61ff377df5ac1a72e.zip hdf5-9cd1a1bb60c66650208033d61ff377df5ac1a72e.tar.gz hdf5-9cd1a1bb60c66650208033d61ff377df5ac1a72e.tar.bz2 |
[svn-r24986] Comparing REALs now converts all REALs to double precision and then compares if the two numbers are equivalent.
Tested: jam (gnu, intel)
Diffstat (limited to 'fortran/test/tH5A.f90')
-rw-r--r-- | fortran/test/tH5A.f90 | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/fortran/test/tH5A.f90 b/fortran/test/tH5A.f90 index b43707c..07ca6da 100644 --- a/fortran/test/tH5A.f90 +++ b/fortran/test/tH5A.f90 @@ -519,27 +519,21 @@ CONTAINS data_dims(1) = 1 CALL h5aread_f(attr3_id, H5T_NATIVE_DOUBLE, aread_double_data, data_dims, error) CALL check("h5aread_f",error,total_error) - differ = .FALSE. - if(abs(aread_double_data(1)- 3.459D0) .ge. 1.D-08) then - differ = .TRUE. - endif - ! This is a temporary fix - !CALL compare_floats(aread_double_data(1), 3.459D0, differ) - IF (differ) THEN - WRITE(*,*) "Read back double attrbute is wrong", aread_double_data(1) - total_error = total_error + 1 - END IF + + IF( .NOT.dreal_eq( REAL(aread_double_data(1),dp), 3.459_dp) )THEN + WRITE(*,*) "Read back double attrbute is wrong", aread_double_data(1) + total_error = total_error + 1 + ENDIF ! !read the real attribute data back to memory ! data_dims(1) = 1 CALL h5aread_f(attr4_id, H5T_NATIVE_REAL, aread_real_data, data_dims, error) CALL check("h5aread_f",error,total_error) - CALL compare_floats(aread_real_data(1), 4.0, differ) - IF (differ) THEN - WRITE(*,*) "Read back real attrbute is wrong ", aread_real_data - total_error = total_error + 1 - END IF + IF( .NOT.dreal_eq( REAL(aread_real_data(1),dp), 4.0_dp) )THEN + WRITE(*,*) "Read back real attrbute is wrong", aread_real_data(1) + total_error = total_error + 1 + ENDIF ! !read the Integer attribute data back to memory ! |