gbproxy: Make sure all BssgpCfg have a valid create_cb
We cannot specify create_cb function references from the config file,
so let's patch them into the data structure at start-up.
Change-Id: Idac9e97dde62b61d0423fdde16e3bd700d5287c0
diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 5bb77d3..30a019e 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -289,6 +289,15 @@
return ret;
};
+private function f_fix_create_cb(inout BssgpConfig cfg)
+{
+ for (var integer i := 0; i < lengthof(cfg.bvc); i := i + 1) {
+ if (not isbound(cfg.bvc[i].create_cb)) {
+ cfg.bvc[i].create_cb := refers(BSSGP_Emulation.DefaultCreateCallback)
+ }
+ }
+}
+
private function f_init_gb_pcu(inout GbInstance gb, charstring id, integer offset) runs on test_CT {
var charstring ns_id := id & "-NS(PCU[" & int2str(offset) & "])";
var charstring bssgp_id := id & "-BSSGP(PCU[" & int2str(offset) & "])";
@@ -364,8 +373,10 @@
}
for (i := 0; i < lengthof(mp_gbconfigs); i := i+1) {
g_pcu[i].cfg := mp_gbconfigs[i];
+ /* make sure all have a proper crate_cb, which cannot be specified in config file */
+ f_fix_create_cb(g_pcu[i].cfg);
/* concatenate all the PCU-side BVCs for the SGSN side */
- g_sgsn[0].cfg.bvc := g_sgsn[0].cfg.bvc & mp_gbconfigs[i].bvc;
+ g_sgsn[0].cfg.bvc := g_sgsn[0].cfg.bvc & g_pcu[i].cfg.bvc;
}
f_init_vty();