fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34672?usp=email )
Change subject: BTS_Tests: separate generating g_AllChannels[] into a function ...................................................................... BTS_Tests: separate generating g_AllChannels[] into a function Change-Id: Iab2d009b977255b16028c77a9b96df48d270ed1c Related: SYS#5313, OS#5956 --- M bts/BTS_Tests.ttcn 1 file changed, 50 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/72/34672/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index df18403..6e4a36a 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -515,6 +515,44 @@ trxc_conn_id := res.connId; } +private function f_gen_chans_for_ts(uint3_t tn, PchanConfig config) +return ChannelNrs +{ + select (config) { + case (GSM_PCHAN_CCCH_SDCCH4) { + return { valueof(ts_RslChanNr_SDCCH4(tn, 0)), + valueof(ts_RslChanNr_SDCCH4(tn, 1)), + valueof(ts_RslChanNr_SDCCH4(tn, 2)), + valueof(ts_RslChanNr_SDCCH4(tn, 3)) }; + } + case (GSM_PCHAN_SDCCH8) { + return { valueof(ts_RslChanNr_SDCCH8(tn, 0)), + valueof(ts_RslChanNr_SDCCH8(tn, 1)), + valueof(ts_RslChanNr_SDCCH8(tn, 2)), + valueof(ts_RslChanNr_SDCCH8(tn, 3)), + valueof(ts_RslChanNr_SDCCH8(tn, 4)), + valueof(ts_RslChanNr_SDCCH8(tn, 5)), + valueof(ts_RslChanNr_SDCCH8(tn, 6)), + valueof(ts_RslChanNr_SDCCH8(tn, 7)) }; + } + case (GSM_PCHAN_TCHH_TCHF_PDCH) { + return { valueof(ts_RslChanNr_Lm(tn, 0)), + valueof(ts_RslChanNr_Lm(tn, 1)), + valueof(ts_RslChanNr_Bm(tn)) }; + } + case (GSM_PCHAN_TCHH) { + return { valueof(ts_RslChanNr_Lm(tn, 0)), + valueof(ts_RslChanNr_Lm(tn, 1)) }; + } + case (GSM_PCHAN_TCHF, + GSM_PCHAN_TCHF_PDCH) { + return { valueof(ts_RslChanNr_Bm(tn)) }; + } + } + + return { }; +} + /* global init function (without PCUIF connection) */ friend function f_init(uint8_t trx_nr := 0) runs on test_CT @@ -550,41 +588,8 @@ /* Generate list of all logical channels from module parameters */ for (var integer tn := 0; tn < lengthof(trx_pars.ts); tn := tn + 1) { - select (trx_pars.ts[tn].config) { - case (GSM_PCHAN_CCCH_SDCCH4) { - g_AllChannels := g_AllChannels & - { valueof(ts_RslChanNr_SDCCH4(tn, 0)), - valueof(ts_RslChanNr_SDCCH4(tn, 1)), - valueof(ts_RslChanNr_SDCCH4(tn, 2)), - valueof(ts_RslChanNr_SDCCH4(tn, 3)) }; - } - case (GSM_PCHAN_SDCCH8) { - g_AllChannels := g_AllChannels & - { valueof(ts_RslChanNr_SDCCH8(tn, 0)), - valueof(ts_RslChanNr_SDCCH8(tn, 1)), - valueof(ts_RslChanNr_SDCCH8(tn, 2)), - valueof(ts_RslChanNr_SDCCH8(tn, 3)), - valueof(ts_RslChanNr_SDCCH8(tn, 4)), - valueof(ts_RslChanNr_SDCCH8(tn, 5)), - valueof(ts_RslChanNr_SDCCH8(tn, 6)), - valueof(ts_RslChanNr_SDCCH8(tn, 7)) }; - } - case (GSM_PCHAN_TCHH_TCHF_PDCH) { - g_AllChannels := g_AllChannels & - { valueof(ts_RslChanNr_Lm(tn, 0)), - valueof(ts_RslChanNr_Lm(tn, 1)), - valueof(ts_RslChanNr_Bm(tn)) }; - } - case (GSM_PCHAN_TCHH) { - g_AllChannels := g_AllChannels & - { valueof(ts_RslChanNr_Lm(tn, 0)), - valueof(ts_RslChanNr_Lm(tn, 1)) }; - } - case (GSM_PCHAN_TCHF, GSM_PCHAN_TCHF_PDCH) { - g_AllChannels := g_AllChannels & - { valueof(ts_RslChanNr_Bm(tn)) }; - } - } + var PchanConfig config := trx_pars.ts[tn].config; + g_AllChannels := g_AllChannels & f_gen_chans_for_ts(tn, config); } f_init_rsl(id); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34672?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Iab2d009b977255b16028c77a9b96df48d270ed1c Gerrit-Change-Number: 34672 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanits...@sysmocom.de> Gerrit-MessageType: newchange