summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-31 20:34:52 +0200
committerHarald Welte <laforge@gnumonks.org>2018-06-01 18:25:57 +0200
commit336820cf5ec2f63c76205bfa64eadce43421e55f (patch)
tree408dd22123d321f133e3eee83db3027ba1e35bfd
parent354722e2529d453f14d217ec13e24dabc60ad6a3 (diff)
BSC_Tests.ttcn: Split f_connect_handler() off f_start_handler()
In case we want to derive other component types by extending MSC_ConnectionHandler, we will want to connect additional ports before starting the component. Hence, split the connect part into f_create_handler(), while keeping the create + start part in f_start_handler(). Change-Id: If272816b7e720e8b8f000f7ab8baa20619b35fb7
-rw-r--r--bsc/BSC_Tests.ttcn17
1 files changed, 10 insertions, 7 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 9b92207..40e777e 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1431,13 +1431,8 @@ import from MSC_ConnectionHandler all;
type function void_fn(charstring id) runs on MSC_ConnHdlr;
-/* helper function to create, connect and start a MSC_ConnHdlr component */
-function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars := omit)
-runs on test_CT return MSC_ConnHdlr {
- var charstring id := testcasename();
- var MSC_ConnHdlr vc_conn;
-
- vc_conn := MSC_ConnHdlr.create(id);
+/* helper function to create and connect a MSC_ConnHdlr component */
+function f_connect_handler(inout MSC_ConnHdlr vc_conn) runs on test_CT {
connect(vc_conn:BSSMAPEM, g_bssap.vc_BSSMAP:PROC);
connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC);
connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT);
@@ -1448,6 +1443,14 @@ runs on test_CT return MSC_ConnHdlr {
}
connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT);
connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
+}
+
+function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars := omit)
+runs on test_CT return MSC_ConnHdlr {
+ var charstring id := testcasename();
+ var MSC_ConnHdlr vc_conn;
+ vc_conn := MSC_ConnHdlr.create(id);
+ f_connect_handler(vc_conn);
vc_conn.start(f_handler_init(fn, id, pars));
return vc_conn;
}