test_get_attribute_string Subroutine

public subroutine test_get_attribute_string()

Arguments

None

Calls

proc~~test_get_attribute_string~~CallsGraph proc~test_get_attribute_string test_get_attribute_string assertequal assertequal proc~test_get_attribute_string->assertequal asserttrue asserttrue proc~test_get_attribute_string->asserttrue none~add_attribute~2 Variable%add_attribute proc~test_get_attribute_string->none~add_attribute~2 none~get_attribute Variable%get_attribute proc~test_get_attribute_string->none~get_attribute none~get_shape UnlimitedEntity%get_shape proc~test_get_attribute_string->none~get_shape none~get_value UnlimitedEntity%get_value proc~test_get_attribute_string->none~get_value none~add_attribute_1d Variable%add_attribute_1d none~add_attribute~2->none~add_attribute_1d interface~mapl_assert MAPL_Assert none~get_attribute->interface~mapl_assert none~at~140 StringAttributeMap%at none~get_attribute->none~at~140 proc~mapl_return MAPL_Return none~get_attribute->proc~mapl_return none~get_shape->proc~mapl_return none~get_value->proc~mapl_return none~add_attribute_1d->proc~mapl_return none~insert~98 StringAttributeMap%insert none~add_attribute_1d->none~insert~98 none~find~39 StringAttributeMap%find none~at~140->none~find~39 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 none~insert_pair~12 StringAttributeMap%insert_pair none~insert~98->none~insert_pair~12

Source Code

   subroutine test_get_attribute_string()
      type (Variable) :: var
      type (Attribute), pointer :: attr
      class (*), pointer :: value

      !integer :: EMPTY(0)
      var = Variable(type=pFIO_INT32, dimensions='x')
      call var%add_attribute('pet_name', 'kitty')

      attr => var%get_attribute('pet_name')
      @assertEqual(empty, attr%get_shape())

      value => attr%get_value()
      select type (value)
      type is (character(len=*))
         @assertEqual('kitty', value)
      type is (StringWrap)
         @assertEqual('kitty', value%value)
      class default
         @assertTrue(1==2)
      end select

   end subroutine test_get_attribute_string