reSIProcate/stack  9694
Defines | Functions
testEmptyHfv.cxx File Reference
#include "resip/stack/SipMessage.hxx"
#include "resip/stack/HeaderTypes.hxx"
#include "rutil/Log.hxx"
#include <iostream>
Include dependency graph for testEmptyHfv.cxx:

Go to the source code of this file.

Defines

#define RESIPROCATE_SUBSYSTEM   Subsystem::SIP

Functions

int main ()

Define Documentation

#define RESIPROCATE_SUBSYSTEM   Subsystem::SIP

Definition at line 12 of file testEmptyHfv.cxx.


Function Documentation

int main ( void  )

Definition at line 15 of file testEmptyHfv.cxx.

References resip::SipMessage::exists(), resip::SipMessage::header(), resip::SipMessage::make(), and resip::RequestLine::uri().

{
   Log::initialize(Log::Cout, Log::Debug ,"testEmptyHfv");   
   resip::Data msg("INVITE sip:foo@bar SIP/2.0\r\n"
                     "Via:\r\n"
                     "From:\r\n"
                     "To:\r\n"
                     "CSeq:\r\n"
                     "Call-ID:\r\n"
                     "Max-Forwards:\r\n"
                   "Content-Length:\r\n\r\n\r\n");
                     
   resip::SipMessage* sip=resip::SipMessage::make(msg);
   
   assert(sip);
   
   try
   {
      if(sip->exists(resip::h_From))
      {
         sip->header(resip::h_From);
         cerr << sip->header(resip::h_From).uri();         
         cerr << "test failed" << endl;
         
         assert(0);         
         return -1;         
      }
   }
   catch(resip::BaseException& e)
   {
      cerr << "Caught: " << e << "as expected, PASSED" << endl;
   }

}

Here is the call graph for this function: