From dd68c44ad47d4ec16eca2c695f1a350bb7c0b35c Mon Sep 17 00:00:00 2001 From: dhruvecosmob Date: Thu, 10 Feb 2022 21:22:07 +0530 Subject: [PATCH] Fix SOA unit test issue i>different ip address and ii>mismatch codec number in sdp with changing test data. --- libsofia-sip-ua/soa/test_soa.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libsofia-sip-ua/soa/test_soa.c b/libsofia-sip-ua/soa/test_soa.c index adc65563..1374edf6 100644 --- a/libsofia-sip-ua/soa/test_soa.c +++ b/libsofia-sip-ua/soa/test_soa.c @@ -951,7 +951,8 @@ int test_codec_selection(struct context *ctx) TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected); TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 3); TEST_S(rm->rm_encoding, "GSM"); - /* Not use same payload as remote so 97 from answer */ + /* We do not expect payload type as 96 here anymore as we stopped using the same payload type as remote had + since 4703f3ade78a89cdc37f673b5bde3435ab71dc27 so 97 stays. */ TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 97); TEST_S(rm->rm_encoding, "G729"); TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111); @@ -1007,10 +1008,10 @@ int test_codec_selection(struct context *ctx) TEST_S(rm->rm_encoding, "CN"); TEST_1(!rm->rm_next); - /* Answering end matches payload types - then sorts by local preference, - not use same payload type as remote, - then select best codec => GSM with pt 3 */ + /* Answering end matches payload types then sorts by local preference, + then select best codec => GSM with pt 3 + Note : we stopped using the same payload type as remote had + since 4703f3ade78a89cdc37f673b5bde3435ab71dc27 so not expect 97 here. */ TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected); TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 3); TEST_S(rm->rm_encoding, "GSM"); @@ -1264,7 +1265,8 @@ int test_codec_selection(struct context *ctx) TEST_1(!m->m_next); TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected); - /* Not use same payload as remote so 97 from answer */ + /* We do not expect payload type as 96 here anymore as we stopped using the same payload type as remote had + since 4703f3ade78a89cdc37f673b5bde3435ab71dc27 so 97 stays. */ TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 97); TEST_S(rm->rm_encoding, "G729"); TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111); @@ -2242,11 +2244,11 @@ int test_address_selection(struct context *ctx) TEST_OC_ADDRESS(a, "2001:1508:1003::21a:a0ff:fe71:813", ip6); TEST_VOID(soa_terminate(a, NULL)); - /* SOATAG_AF(SOA_AF_IP4_IP6) and SOATAG_USER_O_LINE() tag remove so, o= mentions IP6 => select IP4 */ - n = soa_set_user_sdp(a, 0, "o=- 1 1 IN IP4 ::\r\n" + /* SOATAG_AF(SOA_AF_IP4_IP6) and SOATAG_USER_O_LINE() tag remove from so, o= mentions IP6 => select IP6 */ + n = soa_set_user_sdp(a, 0, "o=- 1 1 IN IP6 ::\r\n" "m=audio 5008 RTP/AVP 0 8", -1); TEST(n, 1); n = soa_generate_offer(a, 1, test_completed); TEST(n, 0); - TEST_OC_ADDRESS(a, "11.12.13.14", ip4); + TEST_OC_ADDRESS(a, "2001:1508:1003::21a:a0ff:fe71:813", ip6); TEST_VOID(soa_process_reject(a, NULL)); /* SOATAG_AF(SOA_AF_IP4_IP6), c= uses non-local IP6