Skip to content

Commit c2f51ac

Browse files
committed
test:attributes: improve verbosity
1 parent c7b6d51 commit c2f51ac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/test_attributes.f90

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
program test_attributes
22

3+
!! GCC 7 segfaults if -O3 is on. Fine with -O0
4+
35
use, intrinsic:: iso_fortran_env, only: int32, real32, real64, stderr=>error_unit
46
use, intrinsic:: iso_c_binding, only: C_NULL_CHAR
57

@@ -77,6 +79,8 @@ subroutine test_write_attributes(path)
7779
call h%delete_attr('/x', 'hello')
7880
call h%close()
7981

82+
print '(a)', 'PASSED: HDF5 write attributes: file handle'
83+
8084
end subroutine test_write_attributes
8185

8286

@@ -106,8 +110,8 @@ subroutine test_read_attributes(path)
106110
if (attr_str /= 'overwrite attrs') error stop 'overwrite attrs failed: ' // attr_str
107111

108112
call h%readattr("/x", "empty_char", attr_str)
109-
print *, trim(attr_str) == c_null_char
110113
if (len_trim(attr_str) /= 0) then
114+
write(stderr, '(a,L1)') 'hanging null char: ', trim(attr_str) == c_null_char
111115
write(stderr, '(a,i0)') "empty char attribute: expected 0 length, got length: ", len_trim(attr_str)
112116
error stop "empty char attribute failed"
113117
endif
@@ -152,6 +156,8 @@ subroutine test_read_attributes(path)
152156

153157
call h%close()
154158

159+
print '(a)', 'PASSED: HDF5 read attributes: file handle'
160+
155161
end subroutine test_read_attributes
156162

157163
end program

0 commit comments

Comments
 (0)