test_make_valuestring_string Subroutine

public subroutine test_make_valuestring_string()

Arguments

None

Calls

proc~~test_make_valuestring_string~~CallsGraph proc~test_make_valuestring_string test_make_valuestring_string assertequal assertequal proc~test_make_valuestring_string->assertequal interface~get_value get_value proc~test_make_valuestring_string->interface~get_value proc~valuestring_mismatch valuestring_mismatch proc~test_make_valuestring_string->proc~valuestring_mismatch

Source Code

   subroutine test_make_valuestring_string()
      character(len=*), parameter :: EXPECTED = 'Value' // DEFTAG
      character(len=*), parameter :: DEFAULT = 'Value'
      character(len=:), allocatable :: value
      type(HConfigParams) :: params
      integer :: status
      character(len=:), allocatable :: valuestring
      character(len=:), allocatable :: error_message

      params = HConfigParams(hconfig, 'label')
      call get_value(params, value, default=DEFAULT, valuestring=valuestring, rc=status)
      @assertEqual(0, status, ERROR_GET_FAILED)
      if(EXPECTED /= valuestring) error_message = valuestring_mismatch(valuestring, EXPECTED)
      @assertEqual(EXPECTED, valuestring, error_message)

   end subroutine test_make_valuestring_string