aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2020-05-10 22:48:01 +0300
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2020-05-11 00:33:05 +0300
commit69ba8be60e83bac1c1a13bf25fa1c823ec867ced (patch)
tree7c58636aee61c84ee7446e6e4affadec66faf313 /tests
parent169c229d27edae2ed859733564a76dc75c8526c1 (diff)
handover_test: Properly allocate MSC data struct.
Without a properly allocated MSC struct, touching counters crashes the test. Change-Id: I7498d2891259be9b532845627f14ac75e98e703e
Diffstat (limited to 'tests')
-rw-r--r--tests/handover/handover_test.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 0d9871702..bdc18c3eb 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -217,19 +217,11 @@ static struct gsm_bts *create_bts(int arfcn)
void create_conn(struct gsm_lchan *lchan)
{
- static struct bsc_msc_data fake_msc_data = {};
- fake_msc_data.network = bsc_gsmnet;
static unsigned int next_imsi = 0;
char imsi[sizeof(lchan->conn->bsub->imsi)];
struct gsm_network *net = lchan->ts->trx->bts->network;
struct gsm_subscriber_connection *conn;
struct mgcp_client *fake_mgcp_client = (void*)talloc_zero(net, int);
- uint8_t *amr_conf;
-
- /* HACK: lchan_fsm.c requires some AMR codec rates to be enabled,
- * lets pretend that all AMR codec rates are allowed */
- amr_conf = (uint8_t*) &fake_msc_data.amr_conf;
- amr_conf[1] = 0xff;
conn = bsc_subscr_con_allocate(net);
@@ -239,7 +231,7 @@ void create_conn(struct gsm_lchan *lchan)
net->mgw.tdefs,
"test",
"fake endpoint");
- conn->sccp.msc = &fake_msc_data;
+ conn->sccp.msc = osmo_msc_data_alloc(net, 0);
lchan->conn = conn;
conn->lchan = lchan;