Skip to content

Commit

Permalink
fix(test_description_test): work around gfortran
Browse files Browse the repository at this point in the history
  • Loading branch information
rouson committed Dec 31, 2024
1 parent d3f11bc commit 0749e47
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions test/test_description_test.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,34 @@ logical function tautology()

function check_substring_search() result(tests_pass)
logical, allocatable :: tests_pass(:)

type(test_description_t), allocatable :: test_descriptions(:)

associate(test_descriptions => [ &
#if ! HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY

procedure(test_function_i), pointer :: null_ptr
null_ptr => null()

test_descriptions = [ &
test_description_t("an example substring" , null_ptr) &
,test_description_t("another example substring", null_ptr) &
,test_description_t("moving right along" , null_ptr) &
,test_description_t("nothing to see here" , null_ptr) &
]
#else

test_descriptions = [ &
test_description_t("an example substring" , null()) &
,test_description_t("another example substring", null()) &
,test_description_t("moving right along" , null()) &
,test_description_t("nothing to see here" , null()) &
])
]
#endif
tests_pass = [ &
test_descriptions(1)%contains_text(string_t("example") ) &
, test_descriptions(2)%contains_text( "example" ) &
,.not. test_descriptions(3)%contains_text(string_t("missing string")) &
,.not. test_descriptions(4)%contains_text( "missing string" ) &
]
end associate
end function

end module test_description_test_m

0 comments on commit 0749e47

Please sign in to comment.