aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-18 18:54:20 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-23 00:14:53 +0100
commit9f7b1955d15c84e60cbc2c05cddc083993b140f3 (patch)
treea161fae2370fba77047da3cbc1f95f276399318a
parenta8d896954d6c60f1940fcef4741b91b10fabc443 (diff)
bsc_test.c: Use proper network/bts/lchan structures
don't mock them, simply call the respective functions to get a gsm_network and a gsm_bts with all its subordinate members. Change-Id: I8bdf009d3c7e2473dd42da02762039a19430d6ce
-rw-r--r--tests/bsc/bsc_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 1d7baa1cb..1fb51aadc 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -30,6 +30,7 @@
#include <osmocom/bsc/osmo_bsc.h>
#include <osmocom/bsc/bsc_msc_data.h>
#include <osmocom/bsc/gsm_04_80.h>
+#include <osmocom/bsc/common_bsc.h>
#include <osmocom/core/application.h>
#include <osmocom/core/backtrace.h>
@@ -121,14 +122,12 @@ static void test_scan(void)
{
int i;
- struct gsm_network *net;
- struct gsm_bts *bts;
+ struct gsm_network *net = bsc_network_init(NULL, 1, 1);
+ struct gsm_bts *bts = gsm_bts_alloc(net, 0);
struct osmo_bsc_sccp_con *sccp_con;
struct bsc_msc_data *msc;
struct gsm_subscriber_connection *conn;
- net = talloc_zero(NULL, struct gsm_network);
- bts = talloc_zero(net, struct gsm_bts);
sccp_con = talloc_zero(net, struct osmo_bsc_sccp_con);
msc = talloc_zero(net, struct bsc_msc_data);
conn = talloc_zero(net, struct gsm_subscriber_connection);
@@ -137,6 +136,7 @@ static void test_scan(void)
sccp_con->msc = msc;
conn->bts = bts;
conn->sccp_con = sccp_con;
+ conn->lchan = &bts->c0->ts[1].lchan[0];
/* start testing with proper messages */
printf("Testing BTS<->MSC message scan.\n");