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
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 @@
 }
 
 /* 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 @@
 		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));