test_add_spec_grows_container Subroutine

public subroutine test_add_spec_grows_container()

Arguments

None

Calls

proc~~test_add_spec_grows_container~~CallsGraph proc~test_add_spec_grows_container test_add_spec_grows_container assertequal assertequal proc~test_add_spec_grows_container->assertequal interface~mapl_varspecgetindex MAPL_VarSpecGetIndex proc~test_add_spec_grows_container->interface~mapl_varspecgetindex proc~mapl_varspeccreateinlist MAPL_VarSpecCreateInList proc~test_add_spec_grows_container->proc~mapl_varspeccreateinlist proc~mapl_varspeccreateinlist->interface~mapl_varspecgetindex interface~mapl_assert MAPL_Assert proc~mapl_varspeccreateinlist->interface~mapl_assert proc~mapl_return MAPL_Return proc~mapl_varspeccreateinlist->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_varspeccreateinlist->proc~mapl_verify 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 proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_add_spec_grows_container()
      integer :: status
      type (MAPL_VarSpec), pointer :: specs(:) => null()
      character(:), allocatable :: units
      integer :: idx

      units='barn'
      call MAPL_VarSpecCreateInList(specs, &
           short_name='fred', &
           units = units, &
           rc=status)
      units='barn'
      call MAPL_VarSpecCreateInList(specs, &
           short_name='barney', &
           units = units, &
           rc=status)

      @assertEqual(2, size(specs))

      idx = MAPL_VarSpecGetIndex(specs, name='fred', rc=status)
      @assertEqual(0, status)
      @assertEqual(1, idx)

      idx = MAPL_VarSpecGetIndex(specs, name='barney', rc=status)
      @assertEqual(0, status)
      @assertEqual(2, idx)
      
   end subroutine test_add_spec_grows_container