Skip to content

Commit

Permalink
Remove nusiance output
Browse files Browse the repository at this point in the history
Stop printing:
```
with diagnostic data "(none provided)"
```
at the end of every assertion failure that didn't provide diagnostic
data. It's pedantic and redundant.
  • Loading branch information
bonachea committed Oct 4, 2024
1 parent 1dfa637 commit 7d19a9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions example/invoke-via-macro.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ program invoke_via_macro
print *,'Here comes the expected assertion failure:'
print *
#endif
!call_assert(1+1>2)
!call_assert_describe(1+1>2, "Mathematics is broken!")
call_assert_diagnose(1+1>2, "example with array diagnostic data" , intrinsic_array_t([1,1,2])) ! false assertion

end program invoke_via_macro
5 changes: 3 additions & 2 deletions src/assert/assert_subroutine_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
represent_diagnostics_as_string: &
if (.not. present(diagnostic_data)) then

trailer = "(none provided)"
trailer = ""

else

Expand All @@ -51,10 +51,11 @@
class default
trailer = "of unsupported type."
end select
trailer = ' with diagnostic data "' // trailer // '"'

end if represent_diagnostics_as_string

error stop header // ' with diagnostic data "' // trailer // '"'
error stop header // trailer

end if check_assertion

Expand Down

0 comments on commit 7d19a9d

Please sign in to comment.