test_make_valuestring_logical Subroutine

public subroutine test_make_valuestring_logical()

Arguments

None

Calls

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

Source Code

   subroutine test_make_valuestring_logical()
      character(len=*), parameter :: EXPECTED = 'T' // DEFTAG
      logical, parameter :: DEFAULT = .TRUE.
      logical :: 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_logical