Commit 65f06bf6 authored by Pekka Pessi's avatar Pekka Pessi

test_soa.c: added test with user SDP containing already rejected media

darcs-hash:20070823170201-65a35-2a33110f729e667da5ea89c70e44de9a98aaa45d.gz
parent cd418ec7
......@@ -1264,6 +1264,69 @@ int test_media_replace(struct context *ctx)
}
int test_media_reject(struct context *ctx)
{
BEGIN();
int n;
soa_session_t *a, *b;
char const *offer = NONE, *answer = NONE;
isize_t offerlen = (isize_t)-1, answerlen = (isize_t)-1;
sdp_session_t const *a_sdp, *b_sdp;
sdp_media_t const *m;
sdp_rtpmap_t const *rm;
char const a_caps[] =
"v=0\r\n"
"o=left 219498671 2 IN IP4 127.0.0.2\r\n"
"c=IN IP4 127.0.0.2\r\n"
"m=audio 5008 RTP/AVP 0 8 97\r\n"
"a=rtpmap:97 GSM/8000\n"
;
char const b_caps[] =
"m=audio 0 RTP/AVP 96 97\n"
"a=rtpmap:96 G7231/8000\n"
"a=rtpmap:97 G729/8000\n";
TEST_1(a = soa_create("static", ctx->root, ctx));
TEST_1(b = soa_create("static", ctx->root, ctx));
TEST(soa_set_user_sdp(a, 0, a_caps, strlen(a_caps)), 1);
TEST(soa_set_user_sdp(b, 0, b_caps, strlen(b_caps)), 1);
n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
n = soa_get_local_sdp(a, NULL, &offer, &offerlen); TEST(n, 1);
TEST_1(offer != NULL && offer != NONE);
n = soa_set_remote_sdp(b, 0, offer, offerlen); TEST(n, 1);
n = soa_get_local_sdp(b, NULL, &answer, &answerlen); TEST(n, 0);
n = soa_generate_answer(b, test_completed); TEST(n, 0);
n = soa_get_local_sdp(b, &b_sdp, &answer, &answerlen); TEST(n, 1);
TEST_1(answer != NULL && answer != NONE);
n = soa_set_remote_sdp(a, 0, answer, -1); TEST(n, 1);
n = soa_process_answer(a, test_completed); TEST(n, 0);
TEST_1(soa_is_complete(b));
TEST(soa_activate(b, NULL), 0);
TEST_1(soa_is_complete(a));
TEST(soa_activate(a, NULL), 0);
TEST(soa_is_audio_active(a), SOA_ACTIVE_REJECTED);
TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_REJECTED);
TEST_VOID(soa_terminate(a, NULL));
TEST_VOID(soa_terminate(b, NULL));
TEST_VOID(soa_destroy(a));
TEST_VOID(soa_destroy(b));
END();
}
int test_asynch_offer_answer(struct context *ctx)
{
BEGIN();
......@@ -1459,6 +1522,7 @@ int main(int argc, char *argv[])
retval |= test_static_offer_answer(ctx); SINGLE_FAILURE_CHECK();
retval |= test_codec_selection(ctx); SINGLE_FAILURE_CHECK();
retval |= test_media_replace(ctx); SINGLE_FAILURE_CHECK();
retval |= test_media_reject(ctx); SINGLE_FAILURE_CHECK();
retval |= test_asynch_offer_answer(ctx); SINGLE_FAILURE_CHECK();
}
......
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