|
1 | 1 | program test_attributes
|
2 | 2 |
|
| 3 | +!! GCC 7 segfaults if -O3 is on. Fine with -O0 |
| 4 | + |
3 | 5 | use, intrinsic:: iso_fortran_env, only: int32, real32, real64, stderr=>error_unit
|
4 | 6 | use, intrinsic:: iso_c_binding, only: C_NULL_CHAR
|
5 | 7 |
|
@@ -77,6 +79,8 @@ subroutine test_write_attributes(path)
|
77 | 79 | call h%delete_attr('/x', 'hello')
|
78 | 80 | call h%close()
|
79 | 81 |
|
| 82 | +print '(a)', 'PASSED: HDF5 write attributes: file handle' |
| 83 | + |
80 | 84 | end subroutine test_write_attributes
|
81 | 85 |
|
82 | 86 |
|
@@ -106,8 +110,8 @@ subroutine test_read_attributes(path)
|
106 | 110 | if (attr_str /= 'overwrite attrs') error stop 'overwrite attrs failed: ' // attr_str
|
107 | 111 |
|
108 | 112 | call h%readattr("/x", "empty_char", attr_str)
|
109 |
| -print *, trim(attr_str) == c_null_char |
110 | 113 | if (len_trim(attr_str) /= 0) then
|
| 114 | + write(stderr, '(a,L1)') 'hanging null char: ', trim(attr_str) == c_null_char |
111 | 115 | write(stderr, '(a,i0)') "empty char attribute: expected 0 length, got length: ", len_trim(attr_str)
|
112 | 116 | error stop "empty char attribute failed"
|
113 | 117 | endif
|
@@ -152,6 +156,8 @@ subroutine test_read_attributes(path)
|
152 | 156 |
|
153 | 157 | call h%close()
|
154 | 158 |
|
| 159 | +print '(a)', 'PASSED: HDF5 read attributes: file handle' |
| 160 | + |
155 | 161 | end subroutine test_read_attributes
|
156 | 162 |
|
157 | 163 | end program
|
0 commit comments