make tests compile again after talloc branch changes
diff --git a/openbsc/tests/channel/Makefile.am b/openbsc/tests/channel/Makefile.am
index 60defe0..5a3477c 100644
--- a/openbsc/tests/channel/Makefile.am
+++ b/openbsc/tests/channel/Makefile.am
@@ -9,6 +9,7 @@
$(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 1787e35..ab165c7 100644
--- a/openbsc/tests/channel/channel_test.c
+++ b/openbsc/tests/channel/channel_test.c
@@ -19,6 +19,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <assert.h>
@@ -47,20 +48,24 @@
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);