@@ -4,7 +4,7 @@ program test_cast
44use h5fortran, only : hdf5_file, &
55 H5T_INTEGER_F, H5T_FLOAT_F, H5T_STRING_F, &
66 H5T_NATIVE_REAL, H5T_NATIVE_DOUBLE, H5T_NATIVE_INTEGER, H5T_NATIVE_CHARACTER, H5T_STD_I64LE
7- use , intrinsic :: iso_fortran_env, only : real32, real64, int32, int64
7+ use , intrinsic :: iso_fortran_env, only : real32, real64, int32, int64, stderr = >error_unit
88
99implicit none
1010
@@ -61,10 +61,15 @@ subroutine test_cast_read(fn)
6161! > %class method
6262if (h% class(" /scalar_int32" ) /= H5T_INTEGER_F) error stop " int32 not integer"
6363if (h% class(" /scalar_int64" ) /= H5T_INTEGER_F) error stop " int64 not integer"
64+ if (h% class(" /1d_real32" ) /= H5T_FLOAT_F) error stop " 1d_real32 not float"
6465if (h% class(" /scalar_real32" ) /= H5T_FLOAT_F) error stop " real32 not float"
6566if (h% class(" /scalar_real64" ) /= H5T_FLOAT_F) error stop " real64 not float"
6667if (h% class(" /char" ) /= H5T_STRING_F) error stop " char not string"
67- if (h% class(' /cast/r64tor32' ) /= H5T_FLOAT_F) error stop " cast not float"
68+ if (h% class(' /cast/r64tor32' ) /= H5T_FLOAT_F) then
69+ write (stderr,* ) " expected cast r64tor32 " , H5T_FLOAT_F, " but got " , h% class(' /cast/r64tor32' )
70+ error stop " cast not float"
71+ endif
72+
6873print * , " OK: class method"
6974
7075! > %dtype method
0 commit comments