Commit f8cc5def authored by Pekka Pessi's avatar Pekka Pessi

torture_sip.c: added test for Content-Type

darcs-hash:20080520133308-65a35-867d7cc2144b97c98d19721e1899bf6f8a4f6cee.gz
parent 9c6da05a
......@@ -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);
......
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