julienne_assert_m Module

Define interfaces for writing assertions


Uses

  • module~~julienne_assert_m~~UsesGraph module~julienne_assert_m julienne_assert_m module~julienne_test_diagnosis_m julienne_test_diagnosis_m module~julienne_assert_m->module~julienne_test_diagnosis_m iso_c_binding iso_c_binding module~julienne_test_diagnosis_m->iso_c_binding module~julienne_string_m julienne_string_m module~julienne_test_diagnosis_m->module~julienne_string_m module~julienne_string_m->iso_c_binding

Used by

  • module~~julienne_assert_m~~UsedByGraph module~julienne_assert_m julienne_assert_m module~julienne_assert_s julienne_assert_s module~julienne_assert_s->module~julienne_assert_m module~julienne_bin_s julienne_bin_s module~julienne_bin_s->module~julienne_assert_m module~julienne_m julienne_m module~julienne_m->module~julienne_assert_m module~julienne_string_s julienne_string_s module~julienne_string_s->module~julienne_assert_m module~julienne_test_description_s julienne_test_description_s module~julienne_test_description_s->module~julienne_assert_m module~julienne_test_suite_s julienne_test_suite_s module~julienne_test_suite_s->module~julienne_m program~assertions assertions program~assertions->module~julienne_m program~check_for_command_line_argument check_for_command_line_argument program~check_for_command_line_argument->module~julienne_m program~get_command_line_flag_value get_command_line_flag_value program~get_command_line_flag_value->module~julienne_m program~scaffold scaffold program~scaffold->module~julienne_m

Interfaces

public interface call_julienne_assert_

  • 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

public interface julienne_assert

  • 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