aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-10 21:28:35 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-10 21:28:35 +0200
commitd57e67e8da3726ba1caf787f639c7c0cfb9f8b09 (patch)
treedc86abc617e34be6530547f0ab304922c21d161b
parentac3fc27257c16a74c524a1c070ce029d10ca7815 (diff)
sysmobts: Fix the unit test after the internal band changes
-rw-r--r--tests/sysmobts/sysmobts_test.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c
index 938bd8ca..291f6da8 100644
--- a/tests/sysmobts/sysmobts_test.c
+++ b/tests/sysmobts/sysmobts_test.c
@@ -20,6 +20,7 @@
#include <osmo-bts/bts.h>
#include "femtobts.h"
+#include "l1_if.h"
#include "utils.h"
#include <stdio.h>
@@ -47,11 +48,21 @@ static void test_sysmobts_auto_band(void)
{
struct gsm_bts bts;
struct gsm_bts_role_bts btsb;
+ struct gsm_bts_trx trx;
+ struct femtol1_hdl hdl;
int i;
memset(&bts, 0, sizeof(bts));
memset(&btsb, 0, sizeof(btsb));
+ memset(&trx, 0, sizeof(trx));
+ memset(&hdl, 0, sizeof(hdl));
bts.role = &btsb;
+ trx.bts = &bts;
+ trx.role_bts.l1h = &hdl;
+
+ /* claim to support all hw_info's */
+ hdl.hw_info.band_support = GSM_BAND_850 | GSM_BAND_900 |
+ GSM_BAND_1800 | GSM_BAND_1900;
/* start with the current option */
printf("Testing the no auto-band mapping.\n");
@@ -62,7 +73,7 @@ static void test_sysmobts_auto_band(void)
btsb.auto_band = 0;
bts.band = direct_map[i][0];
arfcn = direct_map[i][2];
- res = sysmobts_select_femto_band(&bts, arfcn);
+ res = sysmobts_select_femto_band(&trx, arfcn);
printf("No auto-band band(%d) arfcn(%u) want(%d) got(%d)\n",
bts.band, arfcn, direct_map[i][1], res);
OSMO_ASSERT(res == direct_map[i][1]);
@@ -77,7 +88,7 @@ static void test_sysmobts_auto_band(void)
btsb.auto_band = 1;
bts.band = direct_map[i][0];
arfcn = direct_map[i][2];
- res = sysmobts_select_femto_band(&bts, arfcn);
+ res = sysmobts_select_femto_band(&trx, arfcn);
printf("Auto-band band(%d) arfcn(%u) want(%d) got(%d)\n",
bts.band, arfcn, direct_map[i][1], res);
OSMO_ASSERT(res == direct_map[i][1]);
@@ -92,7 +103,7 @@ static void test_sysmobts_auto_band(void)
btsb.auto_band = 1;
bts.band = dcs_to_dcs[i][0];
arfcn = dcs_to_dcs[i][2];
- res = sysmobts_select_femto_band(&bts, arfcn);
+ res = sysmobts_select_femto_band(&trx, arfcn);
printf("DCS to DCS band(%d) arfcn(%u) want(%d) got(%d)\n",
bts.band, arfcn, dcs_to_dcs[i][1], res);
OSMO_ASSERT(res == dcs_to_dcs[i][1]);
@@ -107,7 +118,7 @@ static void test_sysmobts_auto_band(void)
btsb.auto_band = 1;
bts.band = pcs_to_pcs[i][0];
arfcn = pcs_to_pcs[i][2];
- res = sysmobts_select_femto_band(&bts, arfcn);
+ res = sysmobts_select_femto_band(&trx, arfcn);
printf("PCS to PCS band(%d) arfcn(%u) want(%d) got(%d)\n",
bts.band, arfcn, pcs_to_pcs[i][1], res);
OSMO_ASSERT(res == pcs_to_pcs[i][1]);