From c2f51acf23df6a1eca3655de3f6101107c298ee5 Mon Sep 17 00:00:00 2001 From: scivision Date: Wed, 21 Aug 2024 16:25:37 -0400 Subject: [PATCH] test:attributes: improve verbosity --- test/test_attributes.f90 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test_attributes.f90 b/test/test_attributes.f90 index 29697d3..e6a947c 100644 --- a/test/test_attributes.f90 +++ b/test/test_attributes.f90 @@ -1,5 +1,7 @@ program test_attributes +!! GCC 7 segfaults if -O3 is on. Fine with -O0 + use, intrinsic:: iso_fortran_env, only: int32, real32, real64, stderr=>error_unit use, intrinsic:: iso_c_binding, only: C_NULL_CHAR @@ -77,6 +79,8 @@ subroutine test_write_attributes(path) call h%delete_attr('/x', 'hello') call h%close() +print '(a)', 'PASSED: HDF5 write attributes: file handle' + end subroutine test_write_attributes @@ -106,8 +110,8 @@ subroutine test_read_attributes(path) if (attr_str /= 'overwrite attrs') error stop 'overwrite attrs failed: ' // attr_str call h%readattr("/x", "empty_char", attr_str) -print *, trim(attr_str) == c_null_char if (len_trim(attr_str) /= 0) then + write(stderr, '(a,L1)') 'hanging null char: ', trim(attr_str) == c_null_char write(stderr, '(a,i0)') "empty char attribute: expected 0 length, got length: ", len_trim(attr_str) error stop "empty char attribute failed" endif @@ -152,6 +156,8 @@ subroutine test_read_attributes(path) call h%close() +print '(a)', 'PASSED: HDF5 read attributes: file handle' + end subroutine test_read_attributes end program