assert_positive_i_1 Subroutine

private subroutine assert_positive_i_1(this, i, fail)

Arguments

Type IntentOptional AttributesName
class(tester_t), intent(inout) :: this
integer, intent(in), dimension(:):: i
logical, intent(in), optional :: fail

Source Code


Source Code

  subroutine assert_positive_i_1(this, i, fail)
    class(tester_t), intent(inout) :: this
    integer, intent(in), dimension(:) :: i
    logical, intent(in), optional :: fail

    this% n_tests = this% n_tests + 1

    if ( minval(i) < 0 ) then
       if (.not. present(fail) .or. (present(fail) .and. fail .eqv. .false.)) then
          this% n_errors = this% n_errors + 1
       end if
    end if

  end subroutine assert_positive_i_1