r24 - in regression_tests/tests: . 1002_SipHeaderAcceptContact
1002_SipHeaderAcceptContact/expected_output
1003_SipHeaderAuthorization
1003_SipHeaderAuthorization/expected_output
1004_SipHeaderCSeq 1004_SipHeaderCSeq/expected_output
1005_SipHeaderCallID 1005_SipHeaderCallID/expected_output
1006_SipHeaderContact 1006_SipHeaderContact/expected_output
1007_SipHeaderContentLength
1007_SipHeaderContentLength/expected_output
1008_SipHeaderContentType
1008_SipHeaderContentType/expected_output 1009_SipHeaderEvent
1009_SipHeaderEvent/expected_output 1010_SipHeaderExpires
1010_SipHeaderExpires/expected_output 1011_SipHeaderFrom
1011_SipHeaderFrom/expected_output 1012_SipHeaderMaxForwards
1012_SipHeaderMaxForwards/expected_output
1013_SipHeaderProxyAuthenticate
1013_SipHeaderProxyAuthenticate/expected_output
1014_SipHeaderProxyAuthorization 1015_SipHeaderRAck
1015_SipHeaderRAck/expected_output 1016_SipHeaderRSeq
1016_SipHeaderRSeq/expected_output 1017_SipHeaderRecordRoute
1017_SipHeaderRecordRoute/expected_output
1018_SipHeaderReferTo 1018_SipHeaderReferTo/expected_output
1019_SipHeaderRequire 1019_SipHeaderRequire/expected_output
1020_SipHeaderRoute 1020_SipHeaderRoute/expected_output
1021_SipHeaderSubject 1021_SipHeaderSubject/expected_output
1022_SipHeaderSupported
1022_SipHeaderSupported/expected_output 1023_SipHeaderTo
1023_SipHeaderTo/expected_output 1024_SipHeaderUnsupported
1025_SipHeaderUserAgent 1026_SipHeaderVia
1027_SipHeaderWWWAuthenticate
1027_SipHeaderWWWAuthenticate/expected_output
1028_SipHeaderWarning 1028_SipHeaderWarning/expected_output
erik at minisip.org
erik at minisip.org
Tue Oct 17 14:42:55 CEST 2006
Author: erik
Date: 2006-10-17 14:42:54 +0200 (Tue, 17 Oct 2006)
New Revision: 24
Added:
regression_tests/tests/1002_SipHeaderAcceptContact/
regression_tests/tests/1002_SipHeaderAcceptContact/Makefile
regression_tests/tests/1002_SipHeaderAcceptContact/expected_output/
regression_tests/tests/1002_SipHeaderAcceptContact/expected_output/expected_output
regression_tests/tests/1002_SipHeaderAcceptContact/test.sh
regression_tests/tests/1002_SipHeaderAcceptContact/tst.cxx
regression_tests/tests/1003_SipHeaderAuthorization/
regression_tests/tests/1003_SipHeaderAuthorization/Makefile
regression_tests/tests/1003_SipHeaderAuthorization/expected_output/
regression_tests/tests/1003_SipHeaderAuthorization/expected_output/expected_output
regression_tests/tests/1003_SipHeaderAuthorization/test.sh
regression_tests/tests/1003_SipHeaderAuthorization/tst.cxx
regression_tests/tests/1004_SipHeaderCSeq/
regression_tests/tests/1004_SipHeaderCSeq/Makefile
regression_tests/tests/1004_SipHeaderCSeq/expected_output/
regression_tests/tests/1004_SipHeaderCSeq/expected_output/expected_output
regression_tests/tests/1004_SipHeaderCSeq/test.sh
regression_tests/tests/1004_SipHeaderCSeq/tst.cxx
regression_tests/tests/1005_SipHeaderCallID/
regression_tests/tests/1005_SipHeaderCallID/Makefile
regression_tests/tests/1005_SipHeaderCallID/expected_output/
regression_tests/tests/1005_SipHeaderCallID/expected_output/expected_output
regression_tests/tests/1005_SipHeaderCallID/test.sh
regression_tests/tests/1005_SipHeaderCallID/tst.cxx
regression_tests/tests/1006_SipHeaderContact/
regression_tests/tests/1006_SipHeaderContact/Makefile
regression_tests/tests/1006_SipHeaderContact/expected_output/
regression_tests/tests/1006_SipHeaderContact/expected_output/expected_output
regression_tests/tests/1006_SipHeaderContact/test.sh
regression_tests/tests/1006_SipHeaderContact/tst.cxx
regression_tests/tests/1007_SipHeaderContentLength/
regression_tests/tests/1007_SipHeaderContentLength/Makefile
regression_tests/tests/1007_SipHeaderContentLength/expected_output/
regression_tests/tests/1007_SipHeaderContentLength/expected_output/expected_output
regression_tests/tests/1007_SipHeaderContentLength/test.sh
regression_tests/tests/1007_SipHeaderContentLength/tst.cxx
regression_tests/tests/1008_SipHeaderContentType/
regression_tests/tests/1008_SipHeaderContentType/Makefile
regression_tests/tests/1008_SipHeaderContentType/expected_output/
regression_tests/tests/1008_SipHeaderContentType/expected_output/expected_output
regression_tests/tests/1008_SipHeaderContentType/test.sh
regression_tests/tests/1008_SipHeaderContentType/tst.cxx
regression_tests/tests/1009_SipHeaderEvent/
regression_tests/tests/1009_SipHeaderEvent/Makefile
regression_tests/tests/1009_SipHeaderEvent/expected_output/
regression_tests/tests/1009_SipHeaderEvent/expected_output/expected_output
regression_tests/tests/1009_SipHeaderEvent/test.sh
regression_tests/tests/1009_SipHeaderEvent/tst.cxx
regression_tests/tests/1010_SipHeaderExpires/
regression_tests/tests/1010_SipHeaderExpires/Makefile
regression_tests/tests/1010_SipHeaderExpires/expected_output/
regression_tests/tests/1010_SipHeaderExpires/expected_output/expected_output
regression_tests/tests/1010_SipHeaderExpires/test.sh
regression_tests/tests/1010_SipHeaderExpires/tst.cxx
regression_tests/tests/1011_SipHeaderFrom/
regression_tests/tests/1011_SipHeaderFrom/Makefile
regression_tests/tests/1011_SipHeaderFrom/expected_output/
regression_tests/tests/1011_SipHeaderFrom/expected_output/expected_output
regression_tests/tests/1011_SipHeaderFrom/test.sh
regression_tests/tests/1011_SipHeaderFrom/tst.cxx
regression_tests/tests/1012_SipHeaderMaxForwards/
regression_tests/tests/1012_SipHeaderMaxForwards/Makefile
regression_tests/tests/1012_SipHeaderMaxForwards/expected_output/
regression_tests/tests/1012_SipHeaderMaxForwards/expected_output/expected_output
regression_tests/tests/1012_SipHeaderMaxForwards/test.sh
regression_tests/tests/1012_SipHeaderMaxForwards/tst.cxx
regression_tests/tests/1013_SipHeaderProxyAuthenticate/
regression_tests/tests/1013_SipHeaderProxyAuthenticate/Makefile
regression_tests/tests/1013_SipHeaderProxyAuthenticate/expected_output/
regression_tests/tests/1013_SipHeaderProxyAuthenticate/expected_output/expected_output
regression_tests/tests/1013_SipHeaderProxyAuthenticate/test.sh
regression_tests/tests/1013_SipHeaderProxyAuthenticate/tst.cxx
regression_tests/tests/1014_SipHeaderProxyAuthorization/
regression_tests/tests/1014_SipHeaderProxyAuthorization/Makefile
regression_tests/tests/1014_SipHeaderProxyAuthorization/expected_output/
regression_tests/tests/1014_SipHeaderProxyAuthorization/test.sh
regression_tests/tests/1014_SipHeaderProxyAuthorization/tst.cxx
regression_tests/tests/1015_SipHeaderRAck/
regression_tests/tests/1015_SipHeaderRAck/Makefile
regression_tests/tests/1015_SipHeaderRAck/expected_output/
regression_tests/tests/1015_SipHeaderRAck/expected_output/expected_output
regression_tests/tests/1015_SipHeaderRAck/test.sh
regression_tests/tests/1015_SipHeaderRAck/tst.cxx
regression_tests/tests/1016_SipHeaderRSeq/
regression_tests/tests/1016_SipHeaderRSeq/Makefile
regression_tests/tests/1016_SipHeaderRSeq/expected_output/
regression_tests/tests/1016_SipHeaderRSeq/expected_output/expected_output
regression_tests/tests/1016_SipHeaderRSeq/test.sh
regression_tests/tests/1016_SipHeaderRSeq/tst.cxx
regression_tests/tests/1017_SipHeaderRecordRoute/
regression_tests/tests/1017_SipHeaderRecordRoute/Makefile
regression_tests/tests/1017_SipHeaderRecordRoute/expected_output/
regression_tests/tests/1017_SipHeaderRecordRoute/expected_output/expected_output
regression_tests/tests/1017_SipHeaderRecordRoute/test.sh
regression_tests/tests/1017_SipHeaderRecordRoute/tst.cxx
regression_tests/tests/1018_SipHeaderReferTo/
regression_tests/tests/1018_SipHeaderReferTo/Makefile
regression_tests/tests/1018_SipHeaderReferTo/expected_output/
regression_tests/tests/1018_SipHeaderReferTo/expected_output/expected_output
regression_tests/tests/1018_SipHeaderReferTo/test.sh
regression_tests/tests/1018_SipHeaderReferTo/tst.cxx
regression_tests/tests/1019_SipHeaderRequire/
regression_tests/tests/1019_SipHeaderRequire/Makefile
regression_tests/tests/1019_SipHeaderRequire/expected_output/
regression_tests/tests/1019_SipHeaderRequire/expected_output/expected_output
regression_tests/tests/1019_SipHeaderRequire/test.sh
regression_tests/tests/1019_SipHeaderRequire/tst.cxx
regression_tests/tests/1020_SipHeaderRoute/
regression_tests/tests/1020_SipHeaderRoute/Makefile
regression_tests/tests/1020_SipHeaderRoute/expected_output/
regression_tests/tests/1020_SipHeaderRoute/expected_output/expected_output
regression_tests/tests/1020_SipHeaderRoute/test.sh
regression_tests/tests/1020_SipHeaderRoute/tst.cxx
regression_tests/tests/1021_SipHeaderSubject/
regression_tests/tests/1021_SipHeaderSubject/Makefile
regression_tests/tests/1021_SipHeaderSubject/expected_output/
regression_tests/tests/1021_SipHeaderSubject/expected_output/expected_output
regression_tests/tests/1021_SipHeaderSubject/test.sh
regression_tests/tests/1021_SipHeaderSubject/tst.cxx
regression_tests/tests/1022_SipHeaderSupported/
regression_tests/tests/1022_SipHeaderSupported/Makefile
regression_tests/tests/1022_SipHeaderSupported/expected_output/
regression_tests/tests/1022_SipHeaderSupported/expected_output/expected_output
regression_tests/tests/1022_SipHeaderSupported/test.sh
regression_tests/tests/1022_SipHeaderSupported/tst.cxx
regression_tests/tests/1023_SipHeaderTo/
regression_tests/tests/1023_SipHeaderTo/Makefile
regression_tests/tests/1023_SipHeaderTo/expected_output/
regression_tests/tests/1023_SipHeaderTo/expected_output/expected_output
regression_tests/tests/1023_SipHeaderTo/test.sh
regression_tests/tests/1023_SipHeaderTo/tst.cxx
regression_tests/tests/1024_SipHeaderUnsupported/
regression_tests/tests/1024_SipHeaderUnsupported/Makefile
regression_tests/tests/1024_SipHeaderUnsupported/expected_output/
regression_tests/tests/1024_SipHeaderUnsupported/test.sh
regression_tests/tests/1024_SipHeaderUnsupported/tst.cxx
regression_tests/tests/1025_SipHeaderUserAgent/
regression_tests/tests/1025_SipHeaderUserAgent/Makefile
regression_tests/tests/1025_SipHeaderUserAgent/expected_output/
regression_tests/tests/1025_SipHeaderUserAgent/test.sh
regression_tests/tests/1025_SipHeaderUserAgent/tst.cxx
regression_tests/tests/1026_SipHeaderVia/
regression_tests/tests/1026_SipHeaderVia/Makefile
regression_tests/tests/1026_SipHeaderVia/expected_output/
regression_tests/tests/1026_SipHeaderVia/test.sh
regression_tests/tests/1026_SipHeaderVia/tst.cxx
regression_tests/tests/1027_SipHeaderWWWAuthenticate/
regression_tests/tests/1027_SipHeaderWWWAuthenticate/Makefile
regression_tests/tests/1027_SipHeaderWWWAuthenticate/expected_output/
regression_tests/tests/1027_SipHeaderWWWAuthenticate/expected_output/expected_output
regression_tests/tests/1027_SipHeaderWWWAuthenticate/test.sh
regression_tests/tests/1027_SipHeaderWWWAuthenticate/tst.cxx
regression_tests/tests/1028_SipHeaderWarning/
regression_tests/tests/1028_SipHeaderWarning/Makefile
regression_tests/tests/1028_SipHeaderWarning/expected_output/
regression_tests/tests/1028_SipHeaderWarning/expected_output/expected_output
regression_tests/tests/1028_SipHeaderWarning/test.sh
regression_tests/tests/1028_SipHeaderWarning/tst.cxx
Log:
* Added more test apps for the regression testing of the SIP header
classes. Note that the "expected_output" is what we output now,
and not necessarily the correct output (some bug fixing is needed).
Added: regression_tests/tests/1002_SipHeaderAcceptContact/Makefile
===================================================================
--- regression_tests/tests/1002_SipHeaderAcceptContact/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1002_SipHeaderAcceptContact/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1002_SipHeaderAcceptContact/expected_output/expected_output
===================================================================
--- regression_tests/tests/1002_SipHeaderAcceptContact/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1002_SipHeaderAcceptContact/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,33 @@
+===
+Test 1:
+Parsed: <Accept-Contact: *;require="something";explicit=somethingelse>
+Result: <Accept-Contact: *;require="something">
+Nr header values: 1
+Feature tag: <require="something">
+Header value 1: <*;require="something">
+===
+Test 2:
+Parsed: <Accept-Contact: *;require="something"; explicit=somethingelse, dummy>
+Result: <Accept-Contact: *;require="something",*;>
+Nr header values: 2
+Feature tag: <require="something">
+Header value 1: <*;require="something">
+Feature tag: <>
+Header value 2: <*;>
+===
+Test 3:
+Parsed: <Accept-Contact: *;mobility="mobile";methods="INVITE">
+Result: <Accept-Contact: *;mobility="mobile">
+Nr header values: 1
+Feature tag: <mobility="mobile">
+Header value 1: <*;mobility="mobile">
+===
+Test 4:
+Parsed: <Accept-Contact: *;
+ mobility="mobile";
+ methods=
+ "INVITE">
+Result: <Accept-Contact: *;;mobility="mobile";;methods;"INVITE">
+Nr header values: 1
+Feature tag: <>
+Header value 1: <*;>
Added: regression_tests/tests/1002_SipHeaderAcceptContact/test.sh
===================================================================
--- regression_tests/tests/1002_SipHeaderAcceptContact/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1002_SipHeaderAcceptContact/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1002_SipHeaderAcceptContact/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1002_SipHeaderAcceptContact/tst.cxx
===================================================================
--- regression_tests/tests/1002_SipHeaderAcceptContact/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1002_SipHeaderAcceptContact/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,48 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderAcceptContact.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* SipHeaderAcceptContact.h */
+ raw.push_back("Accept-Contact: *;require=\"something\";explicit=somethingelse");
+ raw.push_back("Accept-Contact: *;require=\"something\"; explicit=somethingelse, dummy");
+ raw.push_back("Accept-Contact: *;mobility=\"mobile\";methods=\"INVITE\"");
+ raw.push_back("Accept-Contact: *;\n\tmobility=\"mobile\";\n\tmethods=\n\t\"INVITE\"");
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueAcceptContact*> hVal= dynamic_cast<SipHeaderValueAcceptContact*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Feature tag: <"<< hVal->getFeaturetag()<< ">"<<endl;
+ cout << "Header value "<<hv+1<<": <"<<hVal->getString()<<">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1003_SipHeaderAuthorization/Makefile
===================================================================
--- regression_tests/tests/1003_SipHeaderAuthorization/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1003_SipHeaderAuthorization/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1003_SipHeaderAuthorization/expected_output/expected_output
===================================================================
--- regression_tests/tests/1003_SipHeaderAuthorization/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1003_SipHeaderAuthorization/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,42 @@
+SipUri::getString - invalid Uri!
+SipUri::getString - invalid Uri!
+===
+Test 1:
+Parsed: <Authorization: Digest username="bob",
+ realm="biloxi.com", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
+ uri="sip:bob at biloxi.com",
+ qop=auth,
+ nc=00000001,
+ cnonce="0a4f113b",
+ response="6629fae49393a05397450978507c4ef1",
+ opaque="5ccc069c403ebaf9f0171e9517f40e41"
+>
+Result: <Authorization: algorithm="MD5", username="", realm="", nonce="", uri="", response="4a3d55f6612f2a6fac981540f5a0a7c2";realm="biloxi.com";nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093";uri="sip:bob at biloxi.com";qop=auth;nc=00000001;cnonce="0a4f113b";response="6629fae49393a05397450978507c4ef1";opaque="5ccc069c403ebaf9f0171e9517f40e41">
+Nr header values: 1
+Username: <>
+Realm: <"biloxi.com">
+Nonce: <"dcd98b7102dd2f0e8b11d0f600bfb0c093">
+Opaque: <"5ccc069c403ebaf9f0171e9517f40e41">
+Uri: <"sip:bob at biloxi.com">
+qop: <auth>
+SipUri::getString - invalid Uri!
+SipUri::getString - invalid Uri!
+===
+Test 2:
+Parsed: <Authorization: Digest username=bob,
+ realm=biloxi.com, nonce=dcd98b7102dd2f0e8b11d0f600bfb0c093,
+ uri=sip:bob at biloxi.com,
+ qop=auth,
+ nc=00000001,
+ cnonce=0a4f113b,
+ response=6629fae49393a05397450978507c4ef1,
+ opaque=5ccc069c403ebaf9f0171e9517f40e41
+>
+Result: <Authorization: algorithm="MD5", username="", realm="", nonce="", uri="", response="4a3d55f6612f2a6fac981540f5a0a7c2";realm=biloxi.com;nonce=dcd98b7102dd2f0e8b11d0f600bfb0c093;uri=sip:bob at biloxi.com;qop=auth;nc=00000001;cnonce=0a4f113b;response=6629fae49393a05397450978507c4ef1;opaque=5ccc069c403ebaf9f0171e9517f40e41>
+Nr header values: 1
+Username: <>
+Realm: <biloxi.com>
+Nonce: <dcd98b7102dd2f0e8b11d0f600bfb0c093>
+Opaque: <5ccc069c403ebaf9f0171e9517f40e41>
+Uri: <sip:bob at biloxi.com>
+qop: <auth>
Added: regression_tests/tests/1003_SipHeaderAuthorization/test.sh
===================================================================
--- regression_tests/tests/1003_SipHeaderAuthorization/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1003_SipHeaderAuthorization/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1003_SipHeaderAuthorization/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1003_SipHeaderAuthorization/tst.cxx
===================================================================
--- regression_tests/tests/1003_SipHeaderAuthorization/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1003_SipHeaderAuthorization/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,68 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderAuthorization.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* From RFC3261 */
+ raw.push_back("Authorization: Digest username=\"bob\",\n"
+ "\trealm=\"biloxi.com\","
+ "\tnonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\",\n"
+ "\turi=\"sip:bob at biloxi.com\",\n"
+ "\tqop=auth,\n"
+ "\tnc=00000001,\n"
+ "\tcnonce=\"0a4f113b\",\n"
+ "\tresponse=\"6629fae49393a05397450978507c4ef1\",\n"
+ "\topaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\n");
+ raw.push_back("Authorization: Digest username=bob,\n"
+ "\trealm=biloxi.com,"
+ "\tnonce=dcd98b7102dd2f0e8b11d0f600bfb0c093,\n"
+ "\turi=sip:bob at biloxi.com,\n"
+ "\tqop=auth,\n"
+ "\tnc=00000001,\n"
+ "\tcnonce=0a4f113b,\n"
+ "\tresponse=6629fae49393a05397450978507c4ef1,\n"
+ "\topaque=5ccc069c403ebaf9f0171e9517f40e41\n");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueAuthorization*> hVal= dynamic_cast<SipHeaderValueAuthorization*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ //cout << "Method: <"<< hVal->getSipMethod()<< ">"<<endl;
+ cout << "Username: <"<< hVal->getParameter("username")<< ">"<<endl;
+ cout << "Realm: <"<< hVal->getParameter("realm")<< ">"<<endl;
+ cout << "Nonce: <"<< hVal->getParameter("nonce")<< ">"<<endl;
+ cout << "Opaque: <"<< hVal->getParameter("opaque")<< ">"<<endl;
+ cout << "Uri: <"<< hVal->getParameter("uri")<< ">"<<endl;
+ cout << "qop: <"<< hVal->getParameter("qop")<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1004_SipHeaderCSeq/Makefile
===================================================================
--- regression_tests/tests/1004_SipHeaderCSeq/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1004_SipHeaderCSeq/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1004_SipHeaderCSeq/expected_output/expected_output
===================================================================
--- regression_tests/tests/1004_SipHeaderCSeq/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1004_SipHeaderCSeq/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,24 @@
+===
+Test 1:
+Parsed: <CSeq: 1 REGISTER>
+Result: <CSeq: 1 REGISTER>
+Nr header values: 1
+Sequence number: <1>
+Method: <REGISTER>
+===
+Test 2:
+Parsed: <CSeq: 4000000000 SOMEMETHOD>
+Result: <CSeq: 2147483647 SOMEMETHOD>
+Nr header values: 1
+Sequence number: <2147483647>
+Method: <SOMEMETHOD>
+===
+Test 3:
+Parsed: <CSeq: 1234
+ SOMEMETHOD>
+Result: <CSeq: 1234
+ SOMEMETHOD>
+Nr header values: 1
+Sequence number: <1234>
+Method: <
+ SOMEMETHOD>
Added: regression_tests/tests/1004_SipHeaderCSeq/test.sh
===================================================================
--- regression_tests/tests/1004_SipHeaderCSeq/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1004_SipHeaderCSeq/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1004_SipHeaderCSeq/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1004_SipHeaderCSeq/tst.cxx
===================================================================
--- regression_tests/tests/1004_SipHeaderCSeq/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1004_SipHeaderCSeq/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,48 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderCSeq.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* From RFC3261 */
+ raw.push_back("CSeq: 1 REGISTER");
+ raw.push_back("CSeq: 4000000000 SOMEMETHOD");
+ raw.push_back("CSeq: 1234\n\tSOMEMETHOD");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueCSeq*> hVal= dynamic_cast<SipHeaderValueCSeq*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Sequence number: <"<< hVal->getCSeq()<< ">"<<endl;
+ cout << "Method: <"<< hVal->getMethod()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1005_SipHeaderCallID/Makefile
===================================================================
--- regression_tests/tests/1005_SipHeaderCallID/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1005_SipHeaderCallID/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1005_SipHeaderCallID/expected_output/expected_output
===================================================================
--- regression_tests/tests/1005_SipHeaderCallID/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1005_SipHeaderCallID/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,19 @@
+===
+Test 1:
+Parsed: <Call-ID: unique at host >
+Result: <Call-ID: unique at host>
+Nr header values: 1
+ID: <unique at host>
+===
+Test 2:
+Parsed: <i: unique at host>
+Result: <Call-ID: unique at host>
+Nr header values: 1
+ID: <unique at host>
+===
+Test 3:
+Parsed: <Call-ID:
+ somerandomstring >
+Result: <Call-ID: somerandomstring>
+Nr header values: 1
+ID: <somerandomstring>
Added: regression_tests/tests/1005_SipHeaderCallID/test.sh
===================================================================
--- regression_tests/tests/1005_SipHeaderCallID/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1005_SipHeaderCallID/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1005_SipHeaderCallID/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1005_SipHeaderCallID/tst.cxx
===================================================================
--- regression_tests/tests/1005_SipHeaderCallID/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1005_SipHeaderCallID/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,47 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderCallID.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* From RFC3261 */
+ raw.push_back("Call-ID: \t\tunique at host\t");
+ raw.push_back("i: unique at host");
+ raw.push_back("Call-ID: \n\tsomerandomstring \t ");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueCallID*> hVal= dynamic_cast<SipHeaderValueCallID*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "ID: <"<< hVal->getString()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1006_SipHeaderContact/Makefile
===================================================================
--- regression_tests/tests/1006_SipHeaderContact/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1006_SipHeaderContact/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1006_SipHeaderContact/expected_output/expected_output
===================================================================
--- regression_tests/tests/1006_SipHeaderContact/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1006_SipHeaderContact/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,50 @@
+===
+Test 1:
+Parsed: <Contact: <sips:bob at client.biloxi.example.com>>
+Result: <Contact: <sips:bob at client.biloxi.example.com>;expires=1000>
+Nr header values: 1
+Uri: <<sips:bob at client.biloxi.example.com>>
+Expires: <1000>
+===
+Test 2:
+Parsed: <m : <sips:bob at client.biloxi.example.com>;
+ expires=3600>
+Result: <Contact: <sips:bob at client.biloxi.example.com>;expires=3600>
+Nr header values: 1
+Uri: <<sips:bob at client.biloxi.example.com>>
+Expires: <3600>
+===
+Test 3:
+Parsed: <Contact: mailto:bob at biloxi.example.com>
+Result: <Contact: <sip:mailto:bob at biloxi.example.com>;expires=1000>
+Nr header values: 1
+Uri: <<sip:mailto:bob at biloxi.example.com>>
+Expires: <1000>
+===
+Test 4:
+Parsed: <Contact: <mailto:bob at biloxi.example.com>;expires=4294967295>
+Result: <Contact: <sip:mailto:bob at biloxi.example.com>;expires=4294967295>
+Nr header values: 1
+Uri: <<sip:mailto:bob at biloxi.example.com>>
+Expires: <2147483647>
+===
+Test 5:
+Parsed: <Contact: *>
+Result: <Contact: <sip:*>;expires=1000>
+Nr header values: 1
+Uri: <<sip:*>>
+Expires: <1000>
+===
+Test 6:
+Parsed: <m:*>
+Result: <Contact: <sip:*>;expires=1000>
+Nr header values: 1
+Uri: <<sip:*>>
+Expires: <1000>
+===
+Test 7:
+Parsed: <Contact : <sip:alice at client.atlanta.example.com ; transport=tcp> >
+Result: <Contact: <sip:alice at client.atlanta.example.com ;transport=tcp>;expires=1000>
+Nr header values: 1
+Uri: <<sip:alice at client.atlanta.example.com ;transport=tcp>>
+Expires: <1000>
Added: regression_tests/tests/1006_SipHeaderContact/test.sh
===================================================================
--- regression_tests/tests/1006_SipHeaderContact/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1006_SipHeaderContact/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1006_SipHeaderContact/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1006_SipHeaderContact/tst.cxx
===================================================================
--- regression_tests/tests/1006_SipHeaderContact/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1006_SipHeaderContact/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,52 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderContact.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* From RFC3261 */
+ raw.push_back("Contact: <sips:bob at client.biloxi.example.com>");
+ raw.push_back("m\t:\t<sips:bob at client.biloxi.example.com>;\n\texpires=3600");
+ raw.push_back("Contact: mailto:bob at biloxi.example.com");
+ raw.push_back("Contact: <mailto:bob at biloxi.example.com>;expires=4294967295");
+ raw.push_back("Contact: *");
+ raw.push_back("m:*");
+ raw.push_back("Contact : <sip:alice at client.atlanta.example.com ; transport=tcp> ");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueContact*> hVal= dynamic_cast<SipHeaderValueContact*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Uri: <"<< hVal->getUri().getString()<< ">"<<endl;
+ cout << "Expires: <"<< hVal->getExpires()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1007_SipHeaderContentLength/Makefile
===================================================================
--- regression_tests/tests/1007_SipHeaderContentLength/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1007_SipHeaderContentLength/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1007_SipHeaderContentLength/expected_output/expected_output
===================================================================
--- regression_tests/tests/1007_SipHeaderContentLength/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1007_SipHeaderContentLength/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,24 @@
+===
+Test 1:
+Parsed: <Content-Length:0 >
+Result: <Content-Length: 0>
+Nr header values: 1
+Length: <0>
+===
+Test 2:
+Parsed: <l:0>
+Result: <Content-Length: 0>
+Nr header values: 1
+Length: <0>
+===
+Test 3:
+Parsed: <l:-1>
+Result: <Content-Length: 0>
+Nr header values: 1
+Length: <0>
+===
+Test 4:
+Parsed: <Content-Length: 4000000000 >
+Result: <Content-Length: 2147483647>
+Nr header values: 1
+Length: <2147483647>
Added: regression_tests/tests/1007_SipHeaderContentLength/test.sh
===================================================================
--- regression_tests/tests/1007_SipHeaderContentLength/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1007_SipHeaderContentLength/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1007_SipHeaderContentLength/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1007_SipHeaderContentLength/tst.cxx
===================================================================
--- regression_tests/tests/1007_SipHeaderContentLength/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1007_SipHeaderContentLength/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,48 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderContentLength.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* From RFC3261 */
+ raw.push_back("Content-Length:0 ");
+ raw.push_back("l:0");
+ raw.push_back("l:-1");
+ raw.push_back("Content-Length: 4000000000 ");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueContentLength*> hVal= dynamic_cast<SipHeaderValueContentLength*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Length: <"<< hVal->getContentLength()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1008_SipHeaderContentType/Makefile
===================================================================
--- regression_tests/tests/1008_SipHeaderContentType/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1008_SipHeaderContentType/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1008_SipHeaderContentType/expected_output/expected_output
===================================================================
--- regression_tests/tests/1008_SipHeaderContentType/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1008_SipHeaderContentType/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,13 @@
+===
+Test 1:
+Parsed: <Content-Type:application/sdp >
+Result: <Content-Type: application/sdp>
+Nr header values: 1
+Type: <application/sdp>
+===
+Test 2:
+Parsed: <c:
+ text/html >
+Result: <Content-Type: text/html>
+Nr header values: 1
+Type: <text/html>
Added: regression_tests/tests/1008_SipHeaderContentType/test.sh
===================================================================
--- regression_tests/tests/1008_SipHeaderContentType/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1008_SipHeaderContentType/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1008_SipHeaderContentType/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1008_SipHeaderContentType/tst.cxx
===================================================================
--- regression_tests/tests/1008_SipHeaderContentType/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1008_SipHeaderContentType/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,46 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderContentType.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* From RFC3261 */
+ raw.push_back("Content-Type:application/sdp ");
+ raw.push_back("c: \n\ttext/html\t");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueContentType*> hVal= dynamic_cast<SipHeaderValueContentType*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Type: <"<< hVal->getString()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1009_SipHeaderEvent/Makefile
===================================================================
--- regression_tests/tests/1009_SipHeaderEvent/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1009_SipHeaderEvent/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1009_SipHeaderEvent/expected_output/expected_output
===================================================================
--- regression_tests/tests/1009_SipHeaderEvent/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1009_SipHeaderEvent/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,13 @@
+===
+Test 1:
+Parsed: <Event:something>
+Result: <Event: something>
+Nr header values: 1
+Event: <something>
+===
+Test 2:
+Parsed: <Event:
+ something >
+Result: <Event: something>
+Nr header values: 1
+Event: <something>
Added: regression_tests/tests/1009_SipHeaderEvent/test.sh
===================================================================
--- regression_tests/tests/1009_SipHeaderEvent/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1009_SipHeaderEvent/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1009_SipHeaderEvent/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1009_SipHeaderEvent/tst.cxx
===================================================================
--- regression_tests/tests/1009_SipHeaderEvent/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1009_SipHeaderEvent/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,46 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderEvent.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* From RFC3261 */
+ raw.push_back("Event:something");
+ raw.push_back("Event:\n\t\tsomething ");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueEvent*> hVal= dynamic_cast<SipHeaderValueEvent*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Event: <"<< hVal->getString()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1010_SipHeaderExpires/Makefile
===================================================================
--- regression_tests/tests/1010_SipHeaderExpires/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1010_SipHeaderExpires/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1010_SipHeaderExpires/expected_output/expected_output
===================================================================
--- regression_tests/tests/1010_SipHeaderExpires/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1010_SipHeaderExpires/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,13 @@
+===
+Test 1:
+Parsed: <Expires: 5>
+Result: <Event: 5>
+Nr header values: 1
+ERROR: Header value is not the expected type
+===
+Test 2:
+Parsed: <Expires :
+ 4000000000 >
+Result: <Event: 4000000000>
+Nr header values: 1
+ERROR: Header value is not the expected type
Added: regression_tests/tests/1010_SipHeaderExpires/test.sh
===================================================================
--- regression_tests/tests/1010_SipHeaderExpires/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1010_SipHeaderExpires/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1010_SipHeaderExpires/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1010_SipHeaderExpires/tst.cxx
===================================================================
--- regression_tests/tests/1010_SipHeaderExpires/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1010_SipHeaderExpires/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,45 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderExpires.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("Expires: 5");
+ raw.push_back("Expires :\n\t4000000000 ");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueExpires*> hVal= dynamic_cast<SipHeaderValueExpires*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Timeout: <"<< hVal->getTimeout()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1011_SipHeaderFrom/Makefile
===================================================================
--- regression_tests/tests/1011_SipHeaderFrom/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1011_SipHeaderFrom/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1011_SipHeaderFrom/expected_output/expected_output
===================================================================
--- regression_tests/tests/1011_SipHeaderFrom/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1011_SipHeaderFrom/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,37 @@
+===
+Test 1:
+Parsed: <From: Bob <sips:bob at biloxi.example.com>;tag=a73kszlfl>
+Result: <From: "Bob" <sips:bob at biloxi.example.com>;tag=a73kszlfl>
+Nr header values: 1
+Uri: <"Bob" <sips:bob at biloxi.example.com>>
+===
+Test 2:
+Parsed: <F: Anonymous <sip:anonymous at atlanta.com>;tag=1928>
+Result: <From: "Anonymous" <sip:anonymous at atlanta.com>;tag=1928>
+Nr header values: 1
+Uri: <"Anonymous" <sip:anonymous at atlanta.com>>
+===
+Test 3:
+Parsed: <f: user at domain.com>
+Result: <From: <sip:user at domain.com>>
+Nr header values: 1
+Uri: <<sip:user at domain.com>>
+===
+Test 4:
+Parsed: <f : sips:user at domain.com>
+Result: <From: <sips:user at domain.com>>
+Nr header values: 1
+Uri: <<sips:user at domain.com>>
+===
+Test 5:
+Parsed: <From :tel:someuser>
+Result: <From: <tel:someuser>>
+Nr header values: 1
+Uri: <<tel:someuser>>
+===
+Test 6:
+Parsed: <From :
+ tel:user at domain.com>
+Result: <From: <tel:user at domain.com>>
+Nr header values: 1
+Uri: <<tel:user at domain.com>>
Added: regression_tests/tests/1011_SipHeaderFrom/test.sh
===================================================================
--- regression_tests/tests/1011_SipHeaderFrom/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1011_SipHeaderFrom/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1011_SipHeaderFrom/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1011_SipHeaderFrom/tst.cxx
===================================================================
--- regression_tests/tests/1011_SipHeaderFrom/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1011_SipHeaderFrom/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,49 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderFrom.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("From: Bob <sips:bob at biloxi.example.com>;tag=a73kszlfl");
+ raw.push_back("F: Anonymous <sip:anonymous at atlanta.com>;tag=1928");
+ raw.push_back("f: user at domain.com");
+ raw.push_back("f : sips:user at domain.com");
+ raw.push_back("From\t:tel:someuser");
+ raw.push_back("From\t:\n\ttel:user at domain.com");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueFrom*> hVal= dynamic_cast<SipHeaderValueFrom*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Uri: <"<< hVal->getUri().getString() << ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1012_SipHeaderMaxForwards/Makefile
===================================================================
--- regression_tests/tests/1012_SipHeaderMaxForwards/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1012_SipHeaderMaxForwards/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1012_SipHeaderMaxForwards/expected_output/expected_output
===================================================================
--- regression_tests/tests/1012_SipHeaderMaxForwards/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1012_SipHeaderMaxForwards/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,19 @@
+===
+Test 1:
+Parsed: <Max-Forwards: 0 >
+Result: <Max-Forwards: 0>
+Nr header values: 1
+Max forwards: <0>
+===
+Test 2:
+Parsed: <Max-Forwards: -1 >
+Result: <Max-Forwards: -1>
+Nr header values: 1
+Max forwards: <-1>
+===
+Test 3:
+Parsed: <Max-Forwards:
+ 4000000000>
+Result: <Max-Forwards: 2147483647>
+Nr header values: 1
+Max forwards: <2147483647>
Added: regression_tests/tests/1012_SipHeaderMaxForwards/test.sh
===================================================================
--- regression_tests/tests/1012_SipHeaderMaxForwards/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1012_SipHeaderMaxForwards/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1012_SipHeaderMaxForwards/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1012_SipHeaderMaxForwards/tst.cxx
===================================================================
--- regression_tests/tests/1012_SipHeaderMaxForwards/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1012_SipHeaderMaxForwards/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,46 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderMaxForwards.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("Max-Forwards: 0 ");
+ raw.push_back("Max-Forwards: -1 ");
+ raw.push_back("Max-Forwards: \t\n\t4000000000");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueMaxForwards*> hVal= dynamic_cast<SipHeaderValueMaxForwards*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Max forwards: <"<< hVal->getMaxForwards()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1013_SipHeaderProxyAuthenticate/Makefile
===================================================================
--- regression_tests/tests/1013_SipHeaderProxyAuthenticate/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1013_SipHeaderProxyAuthenticate/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1013_SipHeaderProxyAuthenticate/expected_output/expected_output
===================================================================
--- regression_tests/tests/1013_SipHeaderProxyAuthenticate/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1013_SipHeaderProxyAuthenticate/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,28 @@
+===
+Test 1:
+Parsed: <Proxy-Authenticate: Digest realm="atlanta.example.com",
+ qop="auth",
+ nonce="f84f1cec41e6cbe5aea9c8e88d359",
+ opaque="",
+ stale=FALSE,
+ algorithm=MD5>
+Result: <Proxy-Authenticate: Digest realm="atlanta.example.com",qop="auth",nonce="f84f1cec41e6cbe5aea9c8e88d359",opaque="",stale=FALSE,algorithm=MD5>
+Nr header values: 1
+Auth method: <Digest>
+Realm: <"atlanta.example.com">
+Qop: <"auth">
+Opaque: <"">
+Stale: <FALSE>
+Algorithm: <MD5>
+===
+Test 2:
+Parsed: <Proxy-Authenticate: Digest realm=atlanta.example.com, qop=auth, nonce=f84f1cec41e6cbe5aea9c8e88d359, opaque="", stale=FALSE,
+ algorithm=MD5>
+Result: <Proxy-Authenticate: Digest realm=atlanta.example.com,qop=auth,nonce=f84f1cec41e6cbe5aea9c8e88d359,opaque="",stale=FALSE,algorithm=MD5>
+Nr header values: 1
+Auth method: <Digest>
+Realm: <atlanta.example.com>
+Qop: <auth>
+Opaque: <"">
+Stale: <FALSE>
+Algorithm: <MD5>
Added: regression_tests/tests/1013_SipHeaderProxyAuthenticate/test.sh
===================================================================
--- regression_tests/tests/1013_SipHeaderProxyAuthenticate/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1013_SipHeaderProxyAuthenticate/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1013_SipHeaderProxyAuthenticate/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1013_SipHeaderProxyAuthenticate/tst.cxx
===================================================================
--- regression_tests/tests/1013_SipHeaderProxyAuthenticate/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1013_SipHeaderProxyAuthenticate/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,52 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderProxyAuthenticate.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back( "Proxy-Authenticate: Digest realm=\"atlanta.example.com\",\n qop=\"auth\",\n nonce=\"f84f1cec41e6cbe5aea9c8e88d359\",\n opaque=\"\",\n stale=FALSE,\n algorithm=MD5" );
+ raw.push_back( "Proxy-Authenticate: Digest realm=atlanta.example.com, qop=auth, nonce=f84f1cec41e6cbe5aea9c8e88d359, opaque=\"\", stale=FALSE,\n\talgorithm=MD5" );
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueProxyAuthenticate*> hVal= dynamic_cast<SipHeaderValueProxyAuthenticate*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Auth method: <"<< hVal->getAuthMethod()<< ">"<<endl;
+
+ cout << "Realm: <"<<hVal->getParameter("realm")<<">"<<endl;
+ cout << "Qop: <"<<hVal->getParameter("qop")<<">"<<endl;
+ cout << "Opaque: <"<<hVal->getParameter("opaque")<<">"<<endl;
+ cout << "Stale: <"<<hVal->getParameter("stale")<<">"<<endl;
+ cout << "Algorithm: <"<<hVal->getParameter("algorithm")<<">"<<endl;
+
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1014_SipHeaderProxyAuthorization/Makefile
===================================================================
--- regression_tests/tests/1014_SipHeaderProxyAuthorization/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1014_SipHeaderProxyAuthorization/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1014_SipHeaderProxyAuthorization/test.sh
===================================================================
--- regression_tests/tests/1014_SipHeaderProxyAuthorization/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1014_SipHeaderProxyAuthorization/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1014_SipHeaderProxyAuthorization/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1014_SipHeaderProxyAuthorization/tst.cxx
===================================================================
--- regression_tests/tests/1014_SipHeaderProxyAuthorization/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1014_SipHeaderProxyAuthorization/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,61 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderProxyAuthorization.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back( "Proxy-Authorization: Digest username=\"alice\",\n"
+ " realm=\"atlanta.example.com\",\n"
+ " nonce=\"wf84f1ceczx41ae6cbe5aea9c8e88d359\", opaque=\"\",\n"
+ " uri=\"sip:bob at biloxi.example.com\",\n"
+ " response=\"42ce3cef44b22f50c6a6071bc8\"" );
+
+ raw.push_back( "Proxy-Authorization: DIGEST username=alice,\t"
+ "realm=atlanta.example.com,"
+ "nonce=wf84f1ceczx41ae6cbe5aea9c8e88d359, opaque=\"\","
+ "uri=sip:bob at biloxi.example.com,"
+ "response=42ce3cef44b22f50c6a6071bc8" );
+
+
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout <<"===\n"
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueProxyAuthorization*> hVal= dynamic_cast<SipHeaderValueProxyAuthorization*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Response: <"<<hVal->getParameter("response")<<">"<<endl;
+ cout << "Realm: <"<<hVal->getParameter("realm")<<">"<<endl;
+ cout << "Nonce: <"<<hVal->getParameter("nonce")<<">"<<endl;
+ cout << "Opaque: <"<<hVal->getParameter("opaque")<<">"<<endl;
+ cout << "Uri: <"<<hVal->getParameter("uri")<<">"<<endl;
+ cout << "Username: <"<<hVal->getParameter("username")<<">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1015_SipHeaderRAck/Makefile
===================================================================
--- regression_tests/tests/1015_SipHeaderRAck/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1015_SipHeaderRAck/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1015_SipHeaderRAck/expected_output/expected_output
===================================================================
--- regression_tests/tests/1015_SipHeaderRAck/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1015_SipHeaderRAck/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,31 @@
+===
+Test 1:
+Parsed: <RAck: 1000 2000 SOMEMETHOD>
+Result: <RAck: 1000 2000 SOMEMETHOD>
+Nr header values: 1
+Response num: <1000>
+CSeq num: <2000>
+Method: < SOMEMETHOD>
+===
+Test 2:
+Parsed: <RAck:
+ 1000
+ 2000
+ SOMEMETHOD >
+Result: <RAck: 1000 0
+ 2000
+ SOMEMETHOD>
+Nr header values: 1
+Response num: <1000>
+CSeq num: <0>
+Method: <
+ 2000
+ SOMEMETHOD>
+===
+Test 3:
+Parsed: <RAck:1000 2000 SOMEMETHOD>
+Result: <RAck: 1000 0 2000 SOMEMETHOD>
+Nr header values: 1
+Response num: <1000>
+CSeq num: <0>
+Method: < 2000 SOMEMETHOD>
Added: regression_tests/tests/1015_SipHeaderRAck/test.sh
===================================================================
--- regression_tests/tests/1015_SipHeaderRAck/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1015_SipHeaderRAck/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1015_SipHeaderRAck/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1015_SipHeaderRAck/tst.cxx
===================================================================
--- regression_tests/tests/1015_SipHeaderRAck/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1015_SipHeaderRAck/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,49 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderRAck.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("RAck: 1000 2000 SOMEMETHOD");
+ raw.push_back("RAck:\n 1000\n 2000\n\tSOMEMETHOD\t");
+ raw.push_back("RAck:1000\t2000\tSOMEMETHOD");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueRAck*> hVal= dynamic_cast<SipHeaderValueRAck*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Response num: <"<< hVal->getResponseNum()<< ">"<<endl;
+ cout << "CSeq num: <"<< hVal->getCSeqNum()<< ">"<<endl;
+ cout << "Method: <"<< hVal->getMethod()<< ">"<<endl;
+
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1016_SipHeaderRSeq/Makefile
===================================================================
--- regression_tests/tests/1016_SipHeaderRSeq/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1016_SipHeaderRSeq/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1016_SipHeaderRSeq/expected_output/expected_output
===================================================================
--- regression_tests/tests/1016_SipHeaderRSeq/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1016_SipHeaderRSeq/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,32 @@
+===
+Test 1:
+Parsed: <RSeq: 1000 >
+Result: <RSeq: 1000>
+Nr header values: 1
+RSeq: <1000>
+===
+Test 2:
+Parsed: <RSeq:
+ 1000 >
+Result: <RSeq: 1000>
+Nr header values: 1
+RSeq: <1000>
+===
+Test 3:
+Parsed: <RSeq:1000>
+Result: <RSeq: 1000>
+Nr header values: 1
+RSeq: <1000>
+===
+Test 4:
+Parsed: <RSeq:
+ 1000>
+Result: <RSeq: 1000>
+Nr header values: 1
+RSeq: <1000>
+===
+Test 5:
+Parsed: <RSeq: -10>
+Result: <RSeq: 0>
+Nr header values: 1
+RSeq: <0>
Added: regression_tests/tests/1016_SipHeaderRSeq/test.sh
===================================================================
--- regression_tests/tests/1016_SipHeaderRSeq/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1016_SipHeaderRSeq/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1016_SipHeaderRSeq/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1016_SipHeaderRSeq/tst.cxx
===================================================================
--- regression_tests/tests/1016_SipHeaderRSeq/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1016_SipHeaderRSeq/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,48 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderRSeq.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("RSeq: 1000 ");
+ raw.push_back("RSeq:\n 1000\t");
+ raw.push_back("RSeq:1000");
+ raw.push_back("RSeq:\n\t1000");
+ raw.push_back("RSeq: -10");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueRSeq*> hVal= dynamic_cast<SipHeaderValueRSeq*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "RSeq: <"<< hVal->getRSeq()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1017_SipHeaderRecordRoute/Makefile
===================================================================
--- regression_tests/tests/1017_SipHeaderRecordRoute/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1017_SipHeaderRecordRoute/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1017_SipHeaderRecordRoute/expected_output/expected_output
===================================================================
--- regression_tests/tests/1017_SipHeaderRecordRoute/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1017_SipHeaderRecordRoute/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,20 @@
+===
+Test 1:
+Parsed: <Record-Route: <sip:ss1.atlanta.example.com;lr>>
+Result: <Record-Route: <sip:ss1.atlanta.example.com;lr>>
+Nr header values: 1
+String: <<sip:ss1.atlanta.example.com>
+===
+Test 2:
+Parsed: <Record-Route: <sip:ss2.biloxi.example.com;lr>,
+ <sip:ss1.atlanta.example.com;lr>>
+Result: <Record-Route: <sip:ss2.biloxi.example.com;lr>,<sip:ss1.atlanta.example.com;lr>>
+Nr header values: 2
+String: <<sip:ss2.biloxi.example.com>
+String: <<sip:ss1.atlanta.example.com>
+===
+Test 3:
+Parsed: <Record-Route: <sip:ss2.biloxi.example.com>>
+Result: <Record-Route: <sip:ss2.biloxi.example.com>>
+Nr header values: 1
+String: <<sip:ss2.biloxi.example.com>>
Added: regression_tests/tests/1017_SipHeaderRecordRoute/test.sh
===================================================================
--- regression_tests/tests/1017_SipHeaderRecordRoute/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1017_SipHeaderRecordRoute/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1017_SipHeaderRecordRoute/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1017_SipHeaderRecordRoute/tst.cxx
===================================================================
--- regression_tests/tests/1017_SipHeaderRecordRoute/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1017_SipHeaderRecordRoute/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,46 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderRecordRoute.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("Record-Route: <sip:ss1.atlanta.example.com;lr>");
+ raw.push_back("Record-Route: <sip:ss2.biloxi.example.com;lr>,\n <sip:ss1.atlanta.example.com;lr>");
+ raw.push_back("Record-Route: <sip:ss2.biloxi.example.com>");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueRecordRoute*> hVal= dynamic_cast<SipHeaderValueRecordRoute*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "String: <"<< hVal->getString()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1018_SipHeaderReferTo/Makefile
===================================================================
--- regression_tests/tests/1018_SipHeaderReferTo/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1018_SipHeaderReferTo/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1018_SipHeaderReferTo/expected_output/expected_output
===================================================================
--- regression_tests/tests/1018_SipHeaderReferTo/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1018_SipHeaderReferTo/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,13 @@
+===
+Test 1:
+Parsed: <Refer-To: sip:user at domain.org >
+Result: <Refer-To: sip:user at domain.org>
+Nr header values: 1
+String: <sip:user at domain.org>
+===
+Test 2:
+Parsed: <Refer-To :
+ sip:asdf at ss1.atlanta.example.com>
+Result: <Refer-To: sip:asdf at ss1.atlanta.example.com>
+Nr header values: 1
+String: <sip:asdf at ss1.atlanta.example.com>
Added: regression_tests/tests/1018_SipHeaderReferTo/test.sh
===================================================================
--- regression_tests/tests/1018_SipHeaderReferTo/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1018_SipHeaderReferTo/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1018_SipHeaderReferTo/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1018_SipHeaderReferTo/tst.cxx
===================================================================
--- regression_tests/tests/1018_SipHeaderReferTo/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1018_SipHeaderReferTo/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,45 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderReferTo.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("Refer-To: sip:user at domain.org ");
+ raw.push_back("Refer-To :\n\tsip:asdf at ss1.atlanta.example.com");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueReferTo*> hVal= dynamic_cast<SipHeaderValueReferTo*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "String: <"<< hVal->getString()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1019_SipHeaderRequire/Makefile
===================================================================
--- regression_tests/tests/1019_SipHeaderRequire/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1019_SipHeaderRequire/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1019_SipHeaderRequire/expected_output/expected_output
===================================================================
--- regression_tests/tests/1019_SipHeaderRequire/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1019_SipHeaderRequire/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,13 @@
+===
+Test 1:
+Parsed: <Require: something>
+Result: <Require: something>
+Nr header values: 1
+String: <something>
+===
+Test 2:
+Parsed: <Require :
+ something >
+Result: <Require: something>
+Nr header values: 1
+String: <something>
Added: regression_tests/tests/1019_SipHeaderRequire/test.sh
===================================================================
--- regression_tests/tests/1019_SipHeaderRequire/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1019_SipHeaderRequire/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1019_SipHeaderRequire/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1019_SipHeaderRequire/tst.cxx
===================================================================
--- regression_tests/tests/1019_SipHeaderRequire/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1019_SipHeaderRequire/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,45 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderRequire.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("Require: something");
+ raw.push_back("Require :\n\tsomething\t ");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueRequire*> hVal= dynamic_cast<SipHeaderValueRequire*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "String: <"<< hVal->getString()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1020_SipHeaderRoute/Makefile
===================================================================
--- regression_tests/tests/1020_SipHeaderRoute/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1020_SipHeaderRoute/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1020_SipHeaderRoute/expected_output/expected_output
===================================================================
--- regression_tests/tests/1020_SipHeaderRoute/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1020_SipHeaderRoute/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,15 @@
+===
+Test 1:
+Parsed: <Route: <sip:ss1.atlanta.example.com;lr>, <sip:ss2.biloxi.example.com;lr>>
+Result: <Route: <sip:ss1.atlanta.example.com;lr>,<sip:ss2.biloxi.example.com;lr>>
+Nr header values: 2
+Route: <<sip:ss1.atlanta.example.com>
+Route: <<sip:ss2.biloxi.example.com>
+===
+Test 2:
+Parsed: <Route :
+ <sip:ss1.atlanta.example.com;lr> , <sip:ss2.biloxi.example.com;lr> >
+Result: <Route: <sip:ss1.atlanta.example.com;lr>,<sip:ss2.biloxi.example.com;lr>>
+Nr header values: 2
+Route: <<sip:ss1.atlanta.example.com>
+Route: <<sip:ss2.biloxi.example.com>
Added: regression_tests/tests/1020_SipHeaderRoute/test.sh
===================================================================
--- regression_tests/tests/1020_SipHeaderRoute/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1020_SipHeaderRoute/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1020_SipHeaderRoute/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1020_SipHeaderRoute/tst.cxx
===================================================================
--- regression_tests/tests/1020_SipHeaderRoute/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1020_SipHeaderRoute/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,45 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderRoute.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("Route: <sip:ss1.atlanta.example.com;lr>, <sip:ss2.biloxi.example.com;lr>");
+ raw.push_back("Route :\n <sip:ss1.atlanta.example.com;lr>\t,\t<sip:ss2.biloxi.example.com;lr> ");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueRoute*> hVal= dynamic_cast<SipHeaderValueRoute*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Route: <"<< hVal->getRoute()<< ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1021_SipHeaderSubject/Makefile
===================================================================
--- regression_tests/tests/1021_SipHeaderSubject/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1021_SipHeaderSubject/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1021_SipHeaderSubject/expected_output/expected_output
===================================================================
--- regression_tests/tests/1021_SipHeaderSubject/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1021_SipHeaderSubject/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,38 @@
+===
+Test 1:
+Parsed: <Subject: >
+Result: <Subject: >
+Nr header values: 1
+Subject: <>
+===
+Test 2:
+Parsed: <Subject:
+ >
+Result: <Subject: >
+Nr header values: 1
+Subject: <>
+===
+Test 3:
+Parsed: <S:
+ some subject>
+Result: <Subject: some subject>
+Nr header values: 1
+Subject: <some subject>
+===
+Test 4:
+Parsed: <S:
+ "a single subject, ok?">
+Result: <Subject: "a single subject,ok?">
+Nr header values: 2
+Subject: <"a single subject>
+Subject: <ok?">
+===
+Test 5:
+Parsed: <s:
+ "a single,
+ subject, ok?">
+Result: <Subject: "a single,subject,ok?">
+Nr header values: 3
+Subject: <"a single>
+Subject: <subject>
+Subject: <ok?">
Added: regression_tests/tests/1021_SipHeaderSubject/test.sh
===================================================================
--- regression_tests/tests/1021_SipHeaderSubject/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1021_SipHeaderSubject/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1021_SipHeaderSubject/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1021_SipHeaderSubject/tst.cxx
===================================================================
--- regression_tests/tests/1021_SipHeaderSubject/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1021_SipHeaderSubject/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,49 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderSubject.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* SipHeaderSubject.h */
+ raw.push_back("Subject: ");
+ raw.push_back("Subject:\n ");
+ raw.push_back("S:\n some subject");
+ raw.push_back("S:\n \"a single subject, ok?\"");
+ raw.push_back("s:\n \"a single,\n subject, ok?\"");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueSubject*> hVal= dynamic_cast<SipHeaderValueSubject*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout<< "Subject: <"<<hVal->getString()<<">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1022_SipHeaderSupported/Makefile
===================================================================
--- regression_tests/tests/1022_SipHeaderSupported/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1022_SipHeaderSupported/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1022_SipHeaderSupported/expected_output/expected_output
===================================================================
--- regression_tests/tests/1022_SipHeaderSupported/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1022_SipHeaderSupported/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,44 @@
+===
+Test 1:
+Parsed: <Supported: >
+Result: <Supported: >
+Nr header values: 1
+Supported: <>
+===
+Test 2:
+Parsed: <Supported:>
+Result: <Supported: >
+Nr header values: 1
+Supported: <>
+===
+Test 3:
+Parsed: <Supported:
+ >
+Result: <Supported: >
+Nr header values: 1
+Supported: <>
+===
+Test 4:
+Parsed: <Supported:
+ >
+Result: <Supported: >
+Nr header values: 1
+Supported: <>
+===
+Test 5:
+Parsed: <Supported:first,second,third>
+Result: <Supported: first,second,third>
+Nr header values: 3
+Supported: <first>
+Supported: <second>
+Supported: <third>
+===
+Test 6:
+Parsed: <Supported:first
+ ,second,
+ third >
+Result: <Supported: first,second,third>
+Nr header values: 3
+Supported: <first>
+Supported: <second>
+Supported: <third>
Added: regression_tests/tests/1022_SipHeaderSupported/test.sh
===================================================================
--- regression_tests/tests/1022_SipHeaderSupported/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1022_SipHeaderSupported/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1022_SipHeaderSupported/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1022_SipHeaderSupported/tst.cxx
===================================================================
--- regression_tests/tests/1022_SipHeaderSupported/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1022_SipHeaderSupported/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,49 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderSupported.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("Supported: ");
+ raw.push_back("Supported:");
+ raw.push_back("Supported:\n ");
+ raw.push_back("Supported:\n\t");
+ raw.push_back("Supported:first,second,third");
+ raw.push_back("Supported:first\n ,second,\n\tthird\t");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueSupported*> hVal= dynamic_cast<SipHeaderValueSupported*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout<< "Supported: <"<<hVal->getString()<<">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1023_SipHeaderTo/Makefile
===================================================================
--- regression_tests/tests/1023_SipHeaderTo/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1023_SipHeaderTo/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1023_SipHeaderTo/expected_output/expected_output
===================================================================
--- regression_tests/tests/1023_SipHeaderTo/expected_output/expected_output 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1023_SipHeaderTo/expected_output/expected_output 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,37 @@
+===
+Test 1:
+Parsed: <To: Bob <sips:bob at biloxi.example.com>;tag=a73kszlfl>
+Result: <To: "Bob" <sips:bob at biloxi.example.com>;tag=a73kszlfl>
+Nr header values: 1
+Uri: <"Bob" <sips:bob at biloxi.example.com>>
+===
+Test 2:
+Parsed: <T: Anonymous <sip:anonymous at atlanta.com>;tag=1928>
+Result: <To: "Anonymous" <sip:anonymous at atlanta.com>;tag=1928>
+Nr header values: 1
+Uri: <"Anonymous" <sip:anonymous at atlanta.com>>
+===
+Test 3:
+Parsed: <t: user at domain.com>
+Result: <To: <sip:user at domain.com>>
+Nr header values: 1
+Uri: <<sip:user at domain.com>>
+===
+Test 4:
+Parsed: <t : sips:user at domain.com>
+Result: <To: <sips:user at domain.com>>
+Nr header values: 1
+Uri: <<sips:user at domain.com>>
+===
+Test 5:
+Parsed: <TO :tel:someuser>
+Result: <To: <tel:someuser>>
+Nr header values: 1
+Uri: <<tel:someuser>>
+===
+Test 6:
+Parsed: <to :
+ tel:user at domain.com>
+Result: <To: <tel:user at domain.com>>
+Nr header values: 1
+Uri: <<tel:user at domain.com>>
Added: regression_tests/tests/1023_SipHeaderTo/test.sh
===================================================================
--- regression_tests/tests/1023_SipHeaderTo/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1023_SipHeaderTo/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1023_SipHeaderTo/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1023_SipHeaderTo/tst.cxx
===================================================================
--- regression_tests/tests/1023_SipHeaderTo/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1023_SipHeaderTo/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,49 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderTo.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ raw.push_back("To: Bob <sips:bob at biloxi.example.com>;tag=a73kszlfl");
+ raw.push_back("T: Anonymous <sip:anonymous at atlanta.com>;tag=1928");
+ raw.push_back("t: user at domain.com");
+ raw.push_back("t : sips:user at domain.com");
+ raw.push_back("TO\t:tel:someuser");
+ raw.push_back("to\t:\n\ttel:user at domain.com");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "===\n"
+ "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<">" << endl;
+
+ int noValues = h->getNoValues();
+ cout<<"Nr header values: "<< noValues << endl;
+ for (int hv=0; hv<noValues; hv++){
+
+ MRef<SipHeaderValueTo*> hVal= dynamic_cast<SipHeaderValueTo*>( *h->getHeaderValue(hv) );
+ assert(h->getHeaderValue(hv));
+ if (!hVal){
+ if (h->getHeaderValue(hv)){
+ cout <<"ERROR: Header value is not the expected type"<< endl;
+ }else{
+ cout <<"ERROR: header value is NULL!"<<endl;
+ }
+ }else{
+ cout << "Uri: <"<< hVal->getUri().getString() << ">"<<endl;
+ }
+ }
+ }
+
+ return 0;
+}
Added: regression_tests/tests/1024_SipHeaderUnsupported/Makefile
===================================================================
--- regression_tests/tests/1024_SipHeaderUnsupported/Makefile 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1024_SipHeaderUnsupported/Makefile 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,4 @@
+tst: tst.cxx
+ g++ -Wall -g -o tst $(CPP_FLAGS) $(LD_FLAGS) tst.cxx -lmsip -lpthread -lssl
+clean:
+ rm -f build_output diff_output test_output tst
Added: regression_tests/tests/1024_SipHeaderUnsupported/test.sh
===================================================================
--- regression_tests/tests/1024_SipHeaderUnsupported/test.sh 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1024_SipHeaderUnsupported/test.sh 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+make > build_output 2>&1 || exit 2
+./tst > test_output 2>&1 || exit 3
+echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output
+if [ -e expected_output/expected_output ] ; then
+ diff test_output expected_output/expected_output > diff_output ;
+else
+ echo "EXPECTED VALUE OR TEST OUTPUT NOT FOUND!" > diff_output ;
+fi
+exit 0
+
Property changes on: regression_tests/tests/1024_SipHeaderUnsupported/test.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: regression_tests/tests/1024_SipHeaderUnsupported/tst.cxx
===================================================================
--- regression_tests/tests/1024_SipHeaderUnsupported/tst.cxx 2006-10-17 11:51:27 UTC (rev 23)
+++ regression_tests/tests/1024_SipHeaderUnsupported/tst.cxx 2006-10-17 12:42:54 UTC (rev 24)
@@ -0,0 +1,49 @@
+
+#include<iostream>
+#include<list>
+#include<libmsip/SipHeaderUnsupported.h>
+#include<libmsip/SipStack.h>
+
+using namespace std;
+
+int main(){
+ SipStack s(new SipCommonConfig );
+ list<string> raw;
+
+ /* SipHeaderUnsupported.h */
+ raw.push_back("Unsupported:");
+ raw.push_back("Unsupported:\n\t");
+ raw.push_back("Unsupported:something");
+ raw.push_back("Unsupported:something, somethingelse");
+ raw.push_back("Unsupported:something,\n\t\tsomethingelse\t");
+
+
+ list<string>::iterator i;
+ int j=1;
+ for (i=raw.begin(); i!=raw.end(); i++,j++){
+ cout << "===\n";
+ MRef<SipHeader*> h = SipHeader::parseHeader(*i);
+ cout << "Test "<<j<<":\n"
+ "Parsed: <"<<*i<<">\n"
+ "Result: <"<<h->getString()<<