Tue May 20 09:33:08 EDT 2008 Pekka.Pessi@nokia.com

* torture_sip.c: added test for Content-Type


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8616 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-05-25 15:03:51 +00:00
parent d6cfff626d
commit f2a92f3b38
2 changed files with 34 additions and 2 deletions

View File

@ -1 +1 @@
Sun May 25 10:58:52 EDT 2008
Sun May 25 11:03:45 EDT 2008

View File

@ -2227,7 +2227,6 @@ static int test_accept(void)
static int test_content_disposition(void)
{
/* Test Accept header */
sip_content_disposition_t *cd, *cd0;
su_home_t *home;
@ -2247,6 +2246,38 @@ static int test_content_disposition(void)
END();
}
static int test_content_type(void)
{
sip_content_type_t *c;
sip_content_type_t c0[1];
su_home_t *home;
BEGIN();
TEST_1(home = su_home_create());
TEST_1(c = sip_content_type_make(home, "application/sdp ; charset = utf-8"));
TEST_S(c->c_type, "application/sdp");
TEST_S(c->c_subtype, "sdp");
TEST_1(c->c_params && c->c_params[0] && !c->c_params[1]);
TEST_S(c->c_params[0], "charset=utf-8");
TEST_P(c->c_params[1], NULL);
sip_content_type_init(c0);
c = sip_content_type_dup(home, c0);
TEST_P(c->c_type, NULL);
TEST_P(c->c_subtype, NULL);
c0->c_type = "text";
c = sip_content_type_dup(home, c0);
TEST_S(c->c_type, "text");
TEST_P(c->c_subtype, NULL);
su_home_unref(home);
END();
}
static int test_www_authenticate(void)
{
sip_www_authenticate_t *www;
@ -3570,6 +3601,7 @@ int main(int argc, char *argv[])
retval |= test_refer(); fflush(stdout);
retval |= test_route(); fflush(stdout);
retval |= test_request_disposition(); fflush(stdout);
retval |= test_content_type(); fflush(stdout);
retval |= test_caller_prefs(); fflush(stdout);
retval |= test_callerpref_scoring(); fflush(stdout);
retval |= test_warning(); fflush(stdout);