From ad131c874a4e1a315e1993dd2bd1db2ae70c81f8 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 4 Oct 2018 06:18:59 +0700 Subject: BTS_Tests.ttcn: share as_rsl_sacch_ind() and as_rsl_any_ind() Change-Id: I7ace54643c10df38a3ea941242f8b65264ef1322 --- bts/BTS_Tests.ttcn | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 162bfe69..c95f48ab 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -3728,6 +3728,23 @@ function f_unitdata_mt(RslLinkId link_id, octetstring l3) runs on ConnHdlr { } } +/* Expect (or not expect) SACCH messages (Measurement Reports) */ +private altstep as_rsl_sacch_ind(boolean exp_sacch) runs on ConnHdlr { + [exp_sacch] RSL.receive(tr_RSL_UNITDATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) { repeat; } + [not exp_sacch] RSL.receive(tr_RSL_UNITDATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) { + setverdict(fail, "Unexpected (SACCH) UNIT_DATA_IND message!"); + mtc.stop; + } +} +/* Expect (or not expect) other kinds of messages */ +private altstep as_rsl_any_ind(boolean exp_any) runs on ConnHdlr { + [exp_any] RSL.receive { repeat; } + [not exp_any] RSL.receive { + setverdict(fail, "Unexpected RSL message!"); + mtc.stop; + } +} + /* Send UI frame from MS and expect it to arrive as RLL UNITDATA IND on Abis */ function f_unitdata_mo( RslLinkId link_id, @@ -3743,18 +3760,8 @@ function f_unitdata_mo( [] RSL.receive(tr_RSL_UNITDATA_IND(g_chan_nr, link_id, l3)) { setverdict(pass); } - /* Expect (or not expect) SACCH messages (Measurement Reports) */ - [exp_sacch] RSL.receive(tr_RSL_UNITDATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) { repeat; } - [not exp_sacch] RSL.receive(tr_RSL_UNITDATA_IND(g_chan_nr, tr_RslLinkID_SACCH(?))) { - setverdict(fail, "Unexpected (SACCH) UNIT_DATA_IND message!"); - mtc.stop; - } - /* Expect (or not expect) other kinds of messages */ - [exp_any] RSL.receive { repeat; } - [not exp_any] RSL.receive { - setverdict(fail, "Unexpected RSL message!"); - mtc.stop; - } + [] as_rsl_sacch_ind(exp_sacch); + [] as_rsl_any_ind(exp_any); [] T.timeout { setverdict(fail, "Timeout waiting for UNIT_DATA_IND"); mtc.stop; -- cgit v1.2.3