test_equal_diff_attributes Subroutine

public subroutine test_equal_diff_attributes()

Arguments

None

Calls

proc~~test_equal_diff_attributes~~CallsGraph proc~test_equal_diff_attributes test_equal_diff_attributes assertfalse assertfalse proc~test_equal_diff_attributes->assertfalse asserttrue asserttrue proc~test_equal_diff_attributes->asserttrue none~add_attribute~3 FileMetadata%add_attribute proc~test_equal_diff_attributes->none~add_attribute~3 none~add_attribute_0d~2 FileMetadata%add_attribute_0d none~add_attribute~3->none~add_attribute_0d~2 none~add_attribute_1d~2 FileMetadata%add_attribute_1d none~add_attribute~3->none~add_attribute_1d~2 none~add_attribute~2 Variable%add_attribute none~add_attribute_0d~2->none~add_attribute~2 proc~mapl_return MAPL_Return none~add_attribute_0d~2->proc~mapl_return none~add_attribute_1d~2->none~add_attribute~2 none~add_attribute_1d~2->proc~mapl_return none~add_attribute_1d Variable%add_attribute_1d none~add_attribute~2->none~add_attribute_1d at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Source Code

   subroutine test_equal_diff_attributes()
      type (FileMetadata) :: cf1, cf2


      call cf1%add_attribute('attr1', 1)
      @assertFalse(cf1 == cf2)
      ! guard against missing extra items in cf2
      @assertFalse(cf2 == cf1)

      call cf1%add_attribute('attr2', 2.)
      call cf2%add_attribute('attr2', 2.)
      call cf2%add_attribute('attr1', 1)
      @assertTrue(cf1 == cf2)

      call cf1%add_attribute('attr3', 'cat')
      call cf2%add_attribute('attr3', 'dog')
      @assertFalse(cf1 == cf2)

   end subroutine test_equal_diff_attributes