diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-06-26 20:30:46 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-06-26 20:30:46 +0200 |
commit | 6bfda782b9cc30b5c10ad0290949c6d25d4c83cf (patch) | |
tree | d6571e9b14171f28dfe281d15658a4c1d5569b0e | |
parent | 470ec29b0db526c1592f6a270652657315efddca (diff) |
make tests compile again after talloc branch changes
-rw-r--r-- | openbsc/tests/channel/Makefile.am | 1 | ||||
-rw-r--r-- | openbsc/tests/channel/channel_test.c | 13 | ||||
-rw-r--r-- | openbsc/tests/sms/sms_test.c | 2 |
3 files changed, 11 insertions, 5 deletions
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 <stdio.h> +#include <stdlib.h> #include <assert.h> @@ -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); diff --git a/openbsc/tests/sms/sms_test.c b/openbsc/tests/sms/sms_test.c index dfc43cf70..5c3c7c7fc 100644 --- a/openbsc/tests/sms/sms_test.c +++ b/openbsc/tests/sms/sms_test.c @@ -92,7 +92,7 @@ int main(int argc, char** argv) for(i=0;i<SMS_NUM;i++) { /* Setup SMS msgb */ - msg = msgb_alloc(sms_data[i].len); + msg = msgb_alloc(sms_data[i].len, "SMS"); sms = msgb_put(msg, sms_data[i].len); memcpy(sms, sms_data[i].data, sms_data[i].len); |