From fb7f43b8ada9a82554b22e4c07315403fc261970 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 13 Sep 2023 05:42:41 +0200 Subject: [PATCH] sip: pass CallPars into f_TC_*() Move composition of CallPars out of all f_* functions into their TC_* functions, so that future tests can reuse the f_* functions with different CallPars. An upcoming patch wants to call f_TC_mo_success_rel_sip() with different CallPars. Change-Id: Icdcaa7a8a0fadcd6f5715ad052e286b904ded570 --- sip/SIP_Tests.ttcn | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn index 935eed35d..67e78188e 100644 --- a/sip/SIP_Tests.ttcn +++ b/sip/SIP_Tests.ttcn @@ -410,7 +410,7 @@ testcase TC_mt_success_rel_gsm_ipv6() runs on test_CT { /* Successful MT Call, which is subsequently released by SIP side */ private function f_TC_mt_success_rel_sip(charstring id) runs on ConnHdlr { - var CallPars cp := valueof(t_CallPars(false)); + var CallPars cp := g_pars.g_cp; f_CallPars_compute(cp); cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 1.1.1.1\r\ns=GSM Call\r\nc=IN " & f_mgcp_addr2addrtype(cp.sip_rtp_addr) & " " & cp.sip_rtp_addr & @@ -429,6 +429,7 @@ testcase TC_mt_success_rel_sip() runs on test_CT { var ConnHdlr vc_conn; f_init(); pars := valueof(t_Pars); + pars.g_cp := valueof(t_CallPars(false)); vc_conn := f_start_handler(refers(f_TC_mt_success_rel_sip), pars); vc_conn.done; } @@ -473,7 +474,7 @@ testcase TC_mo_success_rel_gsm_ipv6() runs on test_CT { /* Successful MO Call, which is subsequently released by SIP side */ private function f_TC_mo_success_rel_sip(charstring id) runs on ConnHdlr { - var CallPars cp := valueof(t_CallPars(true)); + var CallPars cp := g_pars.g_cp; f_CallPars_compute(cp); cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 1.1.1.1\r\ns=GSM Call\r\nc=IN " & f_mgcp_addr2addrtype(cp.sip_rtp_addr) & " " & cp.sip_rtp_addr & @@ -492,13 +493,14 @@ testcase TC_mo_success_rel_sip() runs on test_CT { var ConnHdlr vc_conn; f_init(); pars := valueof(t_Pars); + pars.g_cp := valueof(t_CallPars(is_mo := true)); vc_conn := f_start_handler(refers(f_TC_mo_success_rel_sip), pars); vc_conn.done; } /* SETUP followed by DISC results in lingering B-leg (OS#3518)*/ private function f_TC_mo_setup_disc_late_rtp(charstring id) runs on ConnHdlr { - var CallPars cp := valueof(t_CallPars(true)); + var CallPars cp := g_pars.g_cp; f_CallPars_compute(cp); cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 1.1.1.1\r\ns=GSM Call\r\nc=IN " & f_mgcp_addr2addrtype(cp.sip_rtp_addr) & " " & cp.sip_rtp_addr & @@ -546,6 +548,7 @@ testcase TC_mo_setup_disc_late_rtp() runs on test_CT { var ConnHdlr vc_conn; f_init(); pars := valueof(t_Pars); + pars.g_cp := valueof(t_CallPars(is_mo := true)); vc_conn := f_start_handler(refers(f_TC_mo_setup_disc_late_rtp), pars); vc_conn.done; }