From 6bfda782b9cc30b5c10ad0290949c6d25d4c83cf Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 26 Jun 2009 20:30:46 +0200 Subject: make tests compile again after talloc branch changes --- openbsc/tests/channel/Makefile.am | 1 + openbsc/tests/channel/channel_test.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'openbsc/tests/channel') diff --git a/openbsc/tests/channel/Makefile.am b/openbsc/tests/channel/Makefile.am index 60defe0a6..5a3477cf5 100644 --- a/openbsc/tests/channel/Makefile.am +++ b/openbsc/tests/channel/Makefile.am @@ -9,6 +9,7 @@ channel_test_SOURCES = channel_test.c \ $(top_srcdir)/src/debug.c \ $(top_srcdir)/src/timer.c \ $(top_srcdir)/src/select.c \ + $(top_srcdir)/src/talloc.c \ $(top_srcdir)/src/gsm_data.c channel_test_LDADD = -ldl -ldbi diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 1787e358c..ab165c720 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -19,6 +19,7 @@ */ #include +#include #include @@ -47,20 +48,24 @@ void paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscriber, int int main(int argc, char** argv) { - struct gsm_network network; + struct gsm_network *network; + struct gsm_bts *bts; printf("Testing the gsm_subscriber chan logic\n"); /* Create a dummy network */ - network.bts[0].location_area_code = 23; - network.bts[0].network = &network; + network = gsm_network_init(1, 1, NULL); + if (!network) + exit(1); + bts = gsm_bts_alloc(network, GSM_BTS_TYPE_BS11, 0, 0); + bts->location_area_code = 23; /* Create a dummy subscriber */ struct gsm_subscriber *subscr = subscr_alloc(); subscr->lac = 23; /* Ask for a channel... */ - subscr_get_channel(subscr, &network, RSL_CHANNEED_TCH_F, subscr_cb, (void*)0x2342L); + subscr_get_channel(subscr, network, RSL_CHANNEED_TCH_F, subscr_cb, (void*)0x2342L); while (1) { bsc_select_main(0); -- cgit v1.2.3