call_julienne_assert_ Interface

public interface call_julienne_assert_

Subroutines

private pure module subroutine idiomatic_assert(test_diagnosis, file, line, description)

Error terminate if test_diagnosis%test_passed() == .false., in which case the stop code contains

  1. The description argument if present and if called via `julienne_assert; otherwise, a copy of the invoking statement,
  2. The value of test_diagnosis%diagnostics_string(),,
  3. The file name if present, and
  4. The line number if present.

Most compilers write the stop code to error_unit.

Usage

call julienne_assert(.all. (["a","b","c"] .isBefore. "efg")) call_julienne_assert(.all. (["a","b","c"] .isBefore. "efg"))

The first line above guarantees execution, whereas the second ensures removal when compiled without -DASSERTIONS. When invoked via macro, the second line also causes the automatic insertion of items 1-4 above.

Arguments

Type IntentOptional Attributes Name
type(test_diagnosis_t), intent(in) :: test_diagnosis
character(len=*), intent(in), optional :: file
integer, intent(in), optional :: line
character(len=*), intent(in), optional :: description

private pure module subroutine logical_assert(assertion, file, line, description)

Error terminate if assertion == .false., in which case the stop code contains

  • The description argument if present and if called via `julienne_assert; otherwise, a copy of the invoking statement,
  • The file name if present, and
  • The line number if present.

Most compilers write the stop code to error_unit.

Usage

call julienne_assert(associated(A)) call_julienne_assert(associated(A))

The first line above guarantees execution, whereas the second ensures removal when compiled without -DASSERTIONS. When invoked via macro, the second line also causes the automatic insertion of items 1-4 above.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: assertion
character(len=*), intent(in), optional :: file
integer, intent(in), optional :: line
character(len=*), intent(in), optional :: description