test_get_attribute_scalar_int Subroutine

public subroutine test_get_attribute_scalar_int()

Arguments

None

Calls

proc~~test_get_attribute_scalar_int~~CallsGraph proc~test_get_attribute_scalar_int test_get_attribute_scalar_int assertequal assertequal proc~test_get_attribute_scalar_int->assertequal asserttrue asserttrue proc~test_get_attribute_scalar_int->asserttrue none~add_attribute~2 Variable%add_attribute proc~test_get_attribute_scalar_int->none~add_attribute~2 none~get_attribute Variable%get_attribute proc~test_get_attribute_scalar_int->none~get_attribute none~get_shape UnlimitedEntity%get_shape proc~test_get_attribute_scalar_int->none~get_shape none~get_value UnlimitedEntity%get_value proc~test_get_attribute_scalar_int->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~226 StringAttributeMap%at none~get_attribute->none~at~226 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~170 StringAttributeMap%insert none~add_attribute_1d->none~insert~170 none~find~59 StringAttributeMap%find none~at~226->none~find~59 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~18 StringAttributeMap%insert_pair none~insert~170->none~insert_pair~18

Source Code

   subroutine test_get_attribute_scalar_int()
      type (Variable) :: var
      type (Attribute), pointer :: attr
      class (*), pointer :: value
      
      var = Variable(type=pFIO_INT32, dimensions='x')
      call var%add_attribute('pet_age', 15)

      attr => var%get_attribute('pet_age')
      @assertEqual(EMPTY, attr%get_shape())

      value => attr%get_value()
      select type (value)
      type is (integer(INT32))
         @assertEqual(15, value)
      class default
         @assertTrue(1==2)
      end select

   end subroutine test_get_attribute_scalar_int