Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33035 )
Change subject: BTS_Tests: f_est_dchan(): add support for CSD channel modes ......................................................................
Patch Set 1:
(1 comment)
File bts/BTS_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33035/comment/e002476a_a17e4... PS1, Line 2546: case (tr_RSL_ChanMode_SIGN)
what? you can use templates as cases?
Yeah, why not? :) ETSI ES 201 873-1 defines the syntax as follows:
``` select "(" SingleExpression ")" "{" { case "(" { TemplateInstance[","] } ")" StatementBlock }+ [ case else StatementBlock ] "}" ```
I wonder how is that implemented, given that 2 templates could match the same value...
I guess the one that matches first wins.
did you make sure this works as expected?
Yes. Actually we already do have templates-in-select in our code base:
``` bsc/BSC_Tests.ttcn: select (arfcn_) { bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((259..293), false, ?)) { band := "GSM450"; } bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((306..340), false, ?)) { band := "GSM480"; } bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((438..511), false, ?)) { band := "GSM750"; } bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((128..251), false, ?)) { band := "GSM850"; } bsc/BSC_Tests.ttcn- case (tr_GsmBandArfcn((0..124), false, ?)) { band := "GSM900"; } ```