Commit 80239a52 authored by jehan's avatar jehan

add message tester

parent 00e90cef
......@@ -20,7 +20,7 @@
<folderInfo id="cdt.managedbuild.toolchain.gnu.macosx.base.557244179.779699347" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.base.688348245" name="cdt.managedbuild.toolchain.gnu.macosx.base" superClass="cdt.managedbuild.toolchain.gnu.macosx.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.MachO64" id="cdt.managedbuild.target.gnu.platform.macosx.base.1183422670" name="Debug Platform" osList="macosx" superClass="cdt.managedbuild.target.gnu.platform.macosx.base"/>
<builder id="cdt.managedbuild.target.gnu.builder.macosx.base.1706103106" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<builder arguments="-j4 CFLAGS=&quot;-g -Wall&quot;" command="make" id="cdt.managedbuild.target.gnu.builder.macosx.base.1706103106" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.base.2093869426" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.base">
<inputType id="cdt.managedbuild.tool.macosx.c.linker.input.451088761" superClass="cdt.managedbuild.tool.macosx.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
......
......@@ -307,6 +307,28 @@ const char* raw_message = "REGISTER sip:192.168.0.20 SIP/2.0\r\n"\
belle_sip_object_unref(message);
}
static void testMalformedMessageWithWrongStart(void) {
const char * raw_message= "\r\n"
"INVITE sip:jehan@81.56.113.2:50343;transport=tcp;line=f18e0009dd6cc43 SIP/2.0\r\n"
"Via: SIP/2.0/UDP 192.168.1.12:15060;rport=15060;branch=z9hG4bK1596944937;received=81.56.113.2\r\n"
"Via: SIP/2.0/TCP 37.59.129.73;branch=z9hG4bK.SKvK9U327e8mU68XUv5rt144pg\r\n"
"Record-Route: <sip:37.59.129.73;lr;transport=tcp>\r\n"
"Record-Route: <sip:37.59.129.73;lr>\r\n"
"Max-Forwards: 70\r\n"
"From: <sip:jehan@sip.linphone.org>;tag=711138653\r\n"
"To: <sip:jehan@sip.linphone.org>\r\n"
"Call-ID: 977107319\r\n"
"CSeq: 21 INVITE\r\n"
"Contact: <sip:jehan-mac@192.168.1.8:5062>\r\n"
"Subject: Phone call\r\n"
"User-Agent: Linphone/3.5.2 (eXosip2/3.6.0)\r\n"
"Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO\r\n"
"Content-Length: 0\r\n\r\n";
belle_sip_message_t* message = belle_sip_message_parse(raw_message);
CU_ASSERT_PTR_NULL(message);
}
/* NOTE - ORDER IS IMPORTANT - MUST TEST fread() AFTER fprintf() */
test_t message_tests[] = {
......@@ -318,6 +340,7 @@ test_t message_tests[] = {
{ "Origin extraction", test_extract_source },
{ "SIP frag", test_sipfrag },
{ "Malformed invite", testMalformedMessage },
{ "Malformed invite with bad begin", testMalformedMessageWithWrongStart },
{ "Malformed register", testMalformedOptionnalHeaderInMessage },
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment