summaryrefslogtreecommitdiffstats
path: root/bsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-08-12 11:42:01 +0000
committerlaforge <laforge@osmocom.org>2020-08-13 05:37:28 +0000
commit63e2e1886a238e10e8aaad82dd95c6d22add4f91 (patch)
treeb7ed36aafef43b5f2fb9ba703d5a7b690bef7107 /bsc
parent4c365329a963434fe4bb04fec94e5d3d3bb4749c (diff)
bsc CBSP: f_page2rsl(): allow expecting specific nr of blocks
Subsequent patch I3cace19f9e5adc8ebab13ef2328a36dc150b2b31 adds a test with specific payload lengths. To verify the correctness of the number-of-blocks calculation (recently fixed), allow pinpointing the expected blocks count. Change-Id: Ie58a6175e55ab2679dc69f9e191d0efc0e84cde0
Diffstat (limited to 'bsc')
-rw-r--r--bsc/BSC_Tests_CBSP.ttcn8
1 files changed, 7 insertions, 1 deletions
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index ea080a2..657d172 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -310,7 +310,8 @@ private function f_cbsp_block_count_enc(integer num_blocks) return integer
}
/* build a RSL_Message receive template from a CBSP page */
-private function f_page2rsl(CBSP_IE page, uint16_t msg_id, uint16_t ser_no, boolean ext_cbch := false)
+private function f_page2rsl(CBSP_IE page, uint16_t msg_id, uint16_t ser_no, boolean ext_cbch := false,
+ template (present) integer expect_blocks := ?)
return template (present) RSL_Message
{
var template RSL_Message tr;
@@ -325,6 +326,11 @@ return template (present) RSL_Message
num_blocks := num_blocks + 1;
}
+ if (not istemplatekind(expect_blocks, "omit") and not match(num_blocks, expect_blocks)) {
+ setverdict(fail, "mismatch: CBSP page expect_blocks == ", expect_blocks, ", but generated num_blocks == ", num_blocks);
+ mtc.stop;
+ }
+
var integer lblock := f_cbsp_block_count_enc(num_blocks);
tr := tr_RSL_SMSCB_CMD(tr_RslCbCmdType(lblock), f_pad_oct(payload, 88, '00'O));