/[resiprocate]/main/resip/stack/test/testEmptyHeader.cxx
ViewVC logotype

Annotation of /main/resip/stack/test/testEmptyHeader.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8432 - (hide annotations) (download)
Wed Mar 4 22:03:30 2009 UTC (10 years, 9 months ago) by adam
File MIME type: text/plain
File size: 4175 byte(s)
Minor manual cleanup of "const char *" problems

1 alan 1336 #include <iostream>
2     #include <memory>
3    
4 jason 5276 #include "rutil/DataStream.hxx"
5 derek 5283 #include "resip/stack/SipMessage.hxx"
6     #include "resip/stack/Helper.hxx"
7     #include "resip/stack/test/TestSupport.hxx"
8     #include "resip/stack/ExtensionHeader.hxx"
9     #include "resip/stack/UnknownParameterType.hxx"
10 jason 5276 #include "rutil/Logger.hxx"
11 alan 1336
12 derek 5283 #include "resip/stack/test/tassert.h"
13 alan 1336
14     using namespace resip;
15     using namespace std;
16    
17     #define RESIPROCATE_SUBSYSTEM Subsystem::TEST
18     #define CRLF "\r\n"
19 ryker 1513
20 alan 1336 int
21     main(int argc, char** argv)
22     {
23    
24 derek 2948 Log::initialize(Log::Cout, Log::Debug, argv[0]);
25 alan 1336
26     {
27     tassert_init(1); (void)tassert_stack_ptr;
28     tassert_reset();
29 adam 8432 const char * txt =(
30 alan 1336 "SIP/2.0 489 Bad Event" CRLF
31 ryker 1539 "Via: SIP/2.0/UDP RjS.localdomain:5070;branch=z9hG4bK-c87542-899769382-1--c87542-" CRLF
32 jason 3433 "CSeq: 1 SUBSCRIBE" CRLF
33 alan 1336 "Allow-Events: " CRLF
34     "Call-ID: f354ce714fb8a95c" CRLF
35     "From: <sip:RjS@127.0.0.1:5070>;tag=59e7dd57" CRLF
36     "To: <sip:RjS@127.0.0.1:5060>" CRLF
37     CRLF
38     );
39     TestSupport::prettyPrint(txt,strlen(txt));
40    
41     auto_ptr<SipMessage> response(TestSupport::makeMessage(txt,true));
42    
43     cerr << *response << endl;
44    
45     tassert(response->exists(h_AllowEvents));
46    
47 adam 8432 const char * txt2 =(
48 alan 1336 "SIP/2.0 489 Bad Event" CRLF
49 ryker 1539 "Via: SIP/2.0/UDP RjS.localdomain:5070;branch=z9hG4bK-c87542-899769382-1--c87542-" CRLF
50 jason 3433 "CSeq: 1 SUBSCRIBE" CRLF
51 alan 1336 "Call-ID: f354ce714fb8a95c" CRLF
52     "From: <sip:RjS@127.0.0.1:5070>;tag=59e7dd57" CRLF
53     "To: <sip:RjS@127.0.0.1:5060>" CRLF
54     "Allow-Events: " CRLF
55     CRLF
56     );
57    
58     SipMessage * r2 = TestSupport::makeMessage(txt2,true);
59    
60     tassert(r2->exists(h_AllowEvents) );
61    
62     tassert_verify(1);
63     tassert_report();
64     return 0;
65     }
66     }
67 fluffy 1796 /* ====================================================================
68     * The Vovida Software License, Version 1.0
69     *
70     * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
71     *
72     * Redistribution and use in source and binary forms, with or without
73     * modification, are permitted provided that the following conditions
74     * are met:
75     *
76     * 1. Redistributions of source code must retain the above copyright
77     * notice, this list of conditions and the following disclaimer.
78     *
79     * 2. Redistributions in binary form must reproduce the above copyright
80     * notice, this list of conditions and the following disclaimer in
81     * the documentation and/or other materials provided with the
82     * distribution.
83     *
84     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
85     * and "Vovida Open Communication Application Library (VOCAL)" must
86     * not be used to endorse or promote products derived from this
87     * software without prior written permission. For written
88     * permission, please contact vocal@vovida.org.
89     *
90     * 4. Products derived from this software may not be called "VOCAL", nor
91     * may "VOCAL" appear in their name, without prior written
92     * permission of Vovida Networks, Inc.
93     *
94     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
95     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
96     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
97     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
98     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
99     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
100     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
101     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
102     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
103     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
104     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
105     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
106     * DAMAGE.
107     *
108     * ====================================================================
109     *
110     * This software consists of voluntary contributions made by Vovida
111     * Networks, Inc. and many individuals on behalf of Vovida Networks,
112     * Inc. For more information on Vovida Networks, Inc., please see
113     * <http://www.vovida.org/>.
114     *
115     */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27