aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-09-13 05:42:41 +0200
committerneels <nhofmeyr@sysmocom.de>2023-09-15 14:53:06 +0000
commitfb7f43b8ada9a82554b22e4c07315403fc261970 (patch)
tree7d185aac00cbcb1c3eb3da56e92df3ff7338ced4
parentc35b6579161cc86f2a535feeb32252a53587788b (diff)
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
-rw-r--r--sip/SIP_Tests.ttcn9
1 files changed, 6 insertions, 3 deletions
diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn
index 935eed35..67e78188 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;
}