test_connectionpt_less_full Subroutine

public subroutine test_connectionpt_less_full()

Arguments

None

Calls

proc~~test_connectionpt_less_full~~CallsGraph proc~test_connectionpt_less_full test_connectionpt_less_full assert_that assert_that proc~test_connectionpt_less_full->assert_that false false proc~test_connectionpt_less_full->false true true proc~test_connectionpt_less_full->true

Source Code

   subroutine test_connectionpt_less_full()
      type(ConnectionPt) :: cp(2,2,2)
      integer :: i, j, k

      cp(1,1,1) = ConnectionPt('A', state_intent='import', short_name='A')
      cp(2,1,1) = ConnectionPt('A', state_intent='import', short_name='B')
      cp(1,2,1) = ConnectionPt('A',state_intent='export', short_name='A')
      cp(2,2,1) = ConnectionPt('A',state_intent='export', short_name='B')
      cp(1,1,2) = ConnectionPt('B', state_intent='import', short_name='A')
      cp(2,1,2) = ConnectionPt('B', state_intent='import', short_name='B')
      cp(1,2,2) = ConnectionPt('B',state_intent='export', short_name='A')
      cp(2,2,2) = ConnectionPt('B',state_intent='export', short_name='B')
        ! Identical pts are neither less nor greater
        do k = 1, 2
           do j = 1, 2
              do i = 1, 2
                 @assert_that((cp(i,j,k) < cp(i,j,k)), is(false()))
              end do
           end do
        end do

        ! Pairwise
        do j = 1, 2
           do i = 1, 2
              @assert_that(cp(i,j,1) < cp(i,j,2), is(true()))
              @assert_that(cp(i,j,2) < cp(i,j,1), is(false()))
           end do
        end do

        do k = 1, 2
           do i = 1, 2
              @assert_that(cp(i,1,k) < cp(i,2,k), is(true()))
              @assert_that(cp(i,2,k) < cp(i,1,k), is(false()))
           end do
        end do

        do k = 1, 2
           do j = 1, 2
              @assert_that(cp(1,j,k) < cp(2,j,k), is(true()))
              @assert_that(cp(2,j,k) < cp(1,j,k), is(false()))
           end do
        end do

   end subroutine test_connectionpt_less_full