aboutsummaryrefslogtreecommitdiffstats
path: root/mgw/MGCP_Test.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-18 18:40:01 +0100
committerHarald Welte <laforge@gnumonks.org>2017-11-18 18:40:01 +0100
commita01e38d371b6106611544bb7fccc6d496a2acb18 (patch)
tree6fa38a8a93320d29e3249a7bea411d39e2719a3b /mgw/MGCP_Test.ttcn
parentba62c8c95b9cbfd220be0f6c5ced6e6a837f0f41 (diff)
mgw: Handle MgcpParameterList more elegantly, less repetition
Diffstat (limited to 'mgw/MGCP_Test.ttcn')
-rw-r--r--mgw/MGCP_Test.ttcn29
1 files changed, 11 insertions, 18 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 21460d0a..3decaed5 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -446,6 +446,11 @@ module MGCP_Test {
f_dlcx_ignore(ep, call_id);
}
+ function f_mgcp_par_append(inout template MgcpParameterList list, template MgcpParameter par) {
+ var integer len := lengthof(list);
+ list[len] := par;
+ }
+
/* test CRCX with unsupported Parameters */
testcase TC_crcx_unsupp_param() runs on dummy_CT {
var template MgcpCommand cmd;
@@ -457,13 +462,9 @@ module MGCP_Test {
f_init();
cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
- cmd.params := {
- t_MgcpParConnMode("recvonly"),
- ts_MgcpParCallId(call_id),
- t_MgcpParLocConnOpt("p:20"),
- /* osmo-bsc_mgcp/mgw doesn't implement notifications */
- { "N", "foobar" }
- }
+ /* osmo-bsc_mgcp/mgw doesn't implement notifications */
+ f_mgcp_par_append(cmd.params, MgcpParameter:{ "N", "foobar" });
+
resp := mgcp_transceive_mgw(cmd, rtmpl);
setverdict(pass);
@@ -521,11 +522,7 @@ module MGCP_Test {
f_init();
cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
- cmd.params := {
- t_MgcpParConnMode("recvonly"),
- ts_MgcpParCallId(call_id),
- t_MgcpParLocConnOpt("p:111")
- }
+ cmd.params[2] := t_MgcpParLocConnOpt("p:111");
resp := mgcp_transceive_mgw(cmd, rtmpl);
setverdict(pass);
@@ -543,12 +540,8 @@ module MGCP_Test {
f_init();
cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
- cmd.params := {
- t_MgcpParConnMode("recvonly"),
- ts_MgcpParCallId(call_id),
- /* p:20 is permitted only once and not twice! */
- t_MgcpParLocConnOpt("p:20, a:AMR, p:20")
- }
+ /* p:20 is permitted only once and not twice! */
+ cmd.params[2] := t_MgcpParLocConnOpt("p:20, a:AMR, p:20");
resp := mgcp_transceive_mgw(cmd, rtmpl);
setverdict(pass);