@@ -4,7 +4,7 @@ program test_cast
4
4
use h5fortran, only : hdf5_file, &
5
5
H5T_INTEGER_F, H5T_FLOAT_F, H5T_STRING_F, &
6
6
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
8
8
9
9
implicit none
10
10
@@ -61,10 +61,15 @@ subroutine test_cast_read(fn)
61
61
! > %class method
62
62
if (h% class(" /scalar_int32" ) /= H5T_INTEGER_F) error stop " int32 not integer"
63
63
if (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"
64
65
if (h% class(" /scalar_real32" ) /= H5T_FLOAT_F) error stop " real32 not float"
65
66
if (h% class(" /scalar_real64" ) /= H5T_FLOAT_F) error stop " real64 not float"
66
67
if (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
+
68
73
print * , " OK: class method"
69
74
70
75
! > %dtype method
0 commit comments