!
! RMIF ADDC warning message test case
!
! An RMIF Client receives an "OPENED" message from an RMIF Server in response to
! it's "OPEN" message. The "OPENED" message indicates that the RMIF connection is
! established.
!
! If the client tries to add a channel to the RMIF connection before the remote
! connection is established (via the "ADDC" message) the following warning
! occurs:
!
! "WARN: No channel open for 10. On different remote R:RMIF-Remote localhost:port"
!
! The ADDC message should not be sent to an RMIF Server until the RMIF connection
! has been OPENED.
! You should not get this warning after the RMIF connection has been OPENED.
!
! <scenario>- The RMIF client configuration scenario (see test_rmif_addc_client
!             for details.)
! <sPort>   - The KNOWN port of the server.  Client uses any available port.
! <timeout> - The timeout (max time) that this test should run before aborting
!
! @bug     1057  RMIF: channel warning messages for unknown reasons
! @author  Jim Roush
! @since   NeXtMidas 2.5.1
!
startmacro L:scenario[1] L:sPort[-1] D:timeout[10]
  switch DEBUG         debug        GET DEF=false    SDEF=true
  switch DEBUGSERVER   debugs       GET DEF=^debug   SDEF=true
  switch DEBUGCLIENT   debugc       GET DEF=^debug   SDEF=true
  switch VERBOSE       verbose      GET DEF=false    SDEF=true
  switch VERBOSESERVER verboses     GET DEF=^verbose SDEF=true
  switch VERBOSECLIENT verbosec     GET DEF=^verbose SDEF=true
  switch STATEM        statemachine GET DEF=false    SDEF=true

  ! call RMIF test framework standard setup (see included standard_rmif_procs.mminc)
  call standardSetup timeout sPort

  pipe on
    ! Single server and single client
    %test_rmif_addc_server/id=SERVER/STATEM=^statemachine/DEBUG=^debugs/VERBOSE=^verboses/BG this ^sPort

    if ^scenario eq 2 then
       %test_rmif_addc_client/id=CLIENT/STATEM=^statemachine/DEBUG=^debugc/VERBOSE=^verbosec/BG this ^sPort ^scenario
    elseif ^scenario eq 3 then
       %test_rmif_addc_client/id=CLIENT/STATEM=^statemachine/DEBUG=^debugc/VERBOSE=^verbosec/BG this ^sPort ^scenario
    elseif ^scenario eq 4 then
       %test_rmif_addc_client/id=CLIENT/STATEM=^statemachine/DEBUG=^debugc/VERBOSE=^verbosec/BG this ^sPort ^scenario
    elseif ^scenario eq 5 then
       %test_rmif_addc_client/id=CLIENT/STATEM=^statemachine/DEBUG=^debugc/VERBOSE=^verbosec/BG this ^sPort ^scenario
    else
       ! Defaults to scenario 1
       %test_rmif_addc_client/id=CLIENT/STATEM=^statemachine/DEBUG=^debugc/VERBOSE=^verbosec/BG this ^sPort 1
    endif
  pipe off

endmacro

!******************************************************************************!
procedure processMessage m:msg
  if debug then
    say "^reg.main.name: Got message name=^msg.name fid=^msg.fid info=^msg.info data=^msg.data"
  endif

  if false then ! Your message name goes here
    !
    ! Your message(s) processing goes here
    !
  else
    call processStandardMessages
  endif
return

! These are a set of standard procedures
include standard_rmif_procs.mminc
