test_equal_values Subroutine

public subroutine test_equal_values()

Arguments

None

Calls

proc~~test_equal_values~~CallsGraph proc~test_equal_values test_equal_values assertfalse assertfalse proc~test_equal_values->assertfalse asserttrue asserttrue proc~test_equal_values->asserttrue

Source Code

   subroutine test_equal_values()
      type (UnlimitedEntity) :: a
      type (UnlimitedEntity) :: b
      character(len=:),allocatable :: c1,c2
     
      ! test without initialization
      @assertTrue(a == b)

      a = UnlimitedEntity(1.)
      b = UnlimitedEntity(2.)

      @assertTrue(a == a)
      @assertFalse(a /= a)
      @assertFalse(a == b)
      @assertTrue(a /= b)

      a = UnlimitedEntity([.true., .false.])
      b = UnlimitedEntity([.true., .true.])

      @assertTrue(a == a)
      @assertFalse(a /= a)
      @assertFalse(a == b)
      @assertTrue(a /= b)

      c1 = 'a'
      c2 = 'a'
      a = UnlimitedEntity(c1)
      b = UnlimitedEntity(c2)

      @assertTrue(a == a)
      @assertFalse(a /= a)
      @assertFalse(a /= b)
      @assertTrue(a == b)

      c1 = 'abcd'
      c2 = 'abcde'
      a = UnlimitedEntity(c1)
      b = UnlimitedEntity(c2)

      @assertTrue(a == a)
      @assertFalse(a /= a)
      @assertTrue(a /= b)
      @assertFalse(a == b)

      a = UnlimitedEntity('N')
      b = UnlimitedEntity('N')
      @assertTrue(a == b)

   end subroutine test_equal_values