test_simple_constructor Subroutine

public subroutine test_simple_constructor()

Arguments

None

Calls

proc~~test_simple_constructor~~CallsGraph proc~test_simple_constructor test_simple_constructor assertequal assertequal proc~test_simple_constructor->assertequal interface~mapl_varspecget MAPL_VarSpecGet proc~test_simple_constructor->interface~mapl_varspecget proc~mapl_varspeccreateinlist MAPL_VarSpecCreateInList proc~test_simple_constructor->proc~mapl_varspeccreateinlist interface~mapl_assert MAPL_Assert proc~mapl_varspeccreateinlist->interface~mapl_assert interface~mapl_varspecgetindex MAPL_VarSpecGetIndex proc~mapl_varspeccreateinlist->interface~mapl_varspecgetindex 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_simple_constructor()
      integer :: status
      type (MAPL_VarSpec), pointer :: specs(:) => null()
      character(:), allocatable :: units
      character(ESMF_MAXSTR) :: found_short_name, found_units

      units='barn'
      call MAPL_VarSpecCreateInList(specs, &
           short_name='fred', &
           units = units, &
           rc=status)
      @assertEqual(0, status)

      @assertEqual(1, size(specs))

      call MAPL_VarSpecGet(specs(1), short_name=found_short_name, units=found_units)
      @assertEqual('fred', trim(found_short_name))
      @assertEqual(units, found_units)

   end subroutine test_simple_constructor