unit_test_l2 Subroutine

private subroutine unit_test_l2(this, res, expected, msg, name, group)

Type Bound

unit_test

Arguments

Type IntentOptional Attributes Name
class(unit_test), intent(inout) :: this
logical, intent(in), dimension(:,:) :: res
logical, intent(in), dimension(:,:) :: expected
character(len=*), intent(in), optional :: msg
character(len=*), intent(in), optional :: name
character(len=*), intent(in), optional :: group

Calls

proc~~unit_test_l2~~CallsGraph proc~unit_test_l2 unit_test%unit_test_l2 proc~print_msg unit_test%print_msg proc~unit_test_l2->proc~print_msg colorize colorize proc~print_msg->colorize

Called by

proc~~unit_test_l2~~CalledByGraph proc~unit_test_l2 unit_test%unit_test_l2 none~check unit_test%check none~check->proc~unit_test_l2 program~demo_forunittest demo_forunittest program~demo_forunittest->none~check program~demo_old demo_old program~demo_old->none~check program~test1 test1 program~test1->none~check program~test2 test2 program~test2->none~check

Source Code

   subroutine unit_test_l2(this, res, expected, msg, name, group)
      class(unit_test), intent(inout) :: this
      logical, intent(in), dimension(:,:) :: res, expected
      character(*), intent(in), optional :: msg
      character(len=*), optional, intent(in) :: name
      character(len=*), optional, intent(in) :: group

      if (present(name)) then
         this%name = name
      else
         this%name = 'none'
      end if

      if (present(msg)) then
         this%msg = msg
      else
         this%msg = 'none'
      end if

      if (present(group)) then
         this%group = group
      else
         this%group = 'none'
      end if
      this%result = all(res .eqv. expected)

      call this%print_msg(this%result)
   end subroutine unit_test_l2