Skip to content

Commit ae1725d

Browse files
dhruvecosmobandywolk
authored andcommitted
Fix SOA unit test issue i>different ip address and ii>mismatch codec number in sdp with changing test data.
1 parent 5de3bf4 commit ae1725d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

libsofia-sip-ua/soa/test_soa.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,8 @@ int test_codec_selection(struct context *ctx)
951951
TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
952952
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 3);
953953
TEST_S(rm->rm_encoding, "GSM");
954-
/* Using payload type 96 from offer */
955-
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 96);
954+
/* Not use same payload as remote so 97 from answer */
955+
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 97);
956956
TEST_S(rm->rm_encoding, "G729");
957957
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111);
958958
TEST_S(rm->rm_encoding, "telephone-event");
@@ -1009,9 +1009,10 @@ int test_codec_selection(struct context *ctx)
10091009

10101010
/* Answering end matches payload types
10111011
then sorts by local preference,
1012-
then select best codec => GSM with pt 97 */
1012+
not use same payload type as remote,
1013+
then select best codec => GSM with pt 3 */
10131014
TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
1014-
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 97);
1015+
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 3);
10151016
TEST_S(rm->rm_encoding, "GSM");
10161017
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111);
10171018
TEST_S(rm->rm_encoding, "telephone-event");
@@ -1263,7 +1264,8 @@ int test_codec_selection(struct context *ctx)
12631264
TEST_1(!m->m_next);
12641265

12651266
TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
1266-
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 96);
1267+
/* Not use same payload as remote so 97 from answer */
1268+
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 97);
12671269
TEST_S(rm->rm_encoding, "G729");
12681270
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111);
12691271
TEST_S(rm->rm_encoding, "telephone-event");
@@ -2240,8 +2242,8 @@ int test_address_selection(struct context *ctx)
22402242
TEST_OC_ADDRESS(a, "2001:1508:1003::21a:a0ff:fe71:813", ip6);
22412243
TEST_VOID(soa_terminate(a, NULL));
22422244

2243-
/* SOATAG_AF(SOA_AF_IP4_IP6), o= mentions IP6 => select IP4 */
2244-
n = soa_set_user_sdp(a, 0, "o=- 1 1 IN IP6 ::\r\n"
2245+
/* SOATAG_AF(SOA_AF_IP4_IP6) and SOATAG_USER_O_LINE() tag remove so, o= mentions IP6 => select IP4 */
2246+
n = soa_set_user_sdp(a, 0, "o=- 1 1 IN IP4 ::\r\n"
22452247
"m=audio 5008 RTP/AVP 0 8", -1); TEST(n, 1);
22462248
n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
22472249
TEST_OC_ADDRESS(a, "11.12.13.14", ip4);

0 commit comments

Comments
 (0)