reSIProcate/stack  9694
Defines | Functions
testEmptyHeader.cxx File Reference
#include <iostream>
#include <memory>
#include "rutil/DataStream.hxx"
#include "resip/stack/SipMessage.hxx"
#include "resip/stack/Helper.hxx"
#include "resip/stack/test/TestSupport.hxx"
#include "resip/stack/ExtensionHeader.hxx"
#include "resip/stack/UnknownParameterType.hxx"
#include "rutil/Logger.hxx"
#include "resip/stack/test/tassert.h"
Include dependency graph for testEmptyHeader.cxx:

Go to the source code of this file.

Defines

#define RESIPROCATE_SUBSYSTEM   Subsystem::TEST
#define CRLF   "\r\n"

Functions

int main (int argc, char **argv)

Define Documentation

#define CRLF   "\r\n"

Definition at line 18 of file testEmptyHeader.cxx.

Referenced by main().

#define RESIPROCATE_SUBSYSTEM   Subsystem::TEST

Definition at line 17 of file testEmptyHeader.cxx.


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 21 of file testEmptyHeader.cxx.

References resip::Log::Cout, CRLF, resip::Log::Debug, resip::SipMessage::exists(), resip::Log::initialize(), resip::TestSupport::makeMessage(), and resip::TestSupport::prettyPrint().

{
  
   Log::initialize(Log::Cout, Log::Debug, argv[0]);
   
   {
     tassert_init(1); (void)tassert_stack_ptr;
     tassert_reset();
     const char * txt =(              
       "SIP/2.0 489 Bad Event" CRLF
       "Via: SIP/2.0/UDP RjS.localdomain:5070;branch=z9hG4bK-c87542-899769382-1--c87542-" CRLF
       "CSeq: 1 SUBSCRIBE" CRLF
       "Allow-Events: " CRLF
       "Call-ID:  f354ce714fb8a95c" CRLF
       "From:  <sip:RjS@127.0.0.1:5070>;tag=59e7dd57" CRLF
       "To:  <sip:RjS@127.0.0.1:5060>" CRLF
       CRLF
       );
     TestSupport::prettyPrint(txt,strlen(txt));

     auto_ptr<SipMessage> response(TestSupport::makeMessage(txt,true));

     cerr << *response << endl;
     
     tassert(response->exists(h_AllowEvents));

     const char * txt2 =(              
       "SIP/2.0 489 Bad Event" CRLF
       "Via: SIP/2.0/UDP RjS.localdomain:5070;branch=z9hG4bK-c87542-899769382-1--c87542-" CRLF
       "CSeq: 1 SUBSCRIBE" CRLF
       "Call-ID:  f354ce714fb8a95c" CRLF
       "From:  <sip:RjS@127.0.0.1:5070>;tag=59e7dd57" CRLF
       "To:  <sip:RjS@127.0.0.1:5060>" CRLF
       "Allow-Events: " CRLF
       CRLF
       );

     SipMessage * r2 = TestSupport::makeMessage(txt2,true);

     tassert(r2->exists(h_AllowEvents) );

     tassert_verify(1);
     tassert_report();
     return 0;
   }
}

Here is the call graph for this function: