diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2017-07-11 01:42:41 +0630 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2017-07-11 18:49:53 +0300 |
commit | afaa728e0b223e6359ebe12ef12b1f1e67d24f03 (patch) | |
tree | a9381668430fd4c62e13edabdc1a2a67f653c731 /openbsc/tests | |
parent | 28295c94d91c7415b15019c3a37dadc565da753f (diff) |
libcommon: Fix log output for bts>0.
Fixes regression probably introduced in c696cc28.
For bts>0 logging doesn't show bts number correctly when printing lchan
identification string - it will always show it as "bts=0". The reason for
this is that the identification string is cached before bts->nr value is
set to a proper value.
This patch sets bts->nr as part of the first step of the bts structure
initialization, before caching happens thus making sure the cached
identification string is cached with the correct values.
Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
Diffstat (limited to 'openbsc/tests')
-rw-r--r-- | openbsc/tests/channel/channel_test.c | 2 | ||||
-rw-r--r-- | openbsc/tests/gsm0408/gsm0408_test.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index eb045adc9..6d12d2de4 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -70,7 +70,7 @@ void test_request_chan(void) network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->location_area_code = 23; /* Create a dummy subscriber */ diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 08cf43f50..9c966a959 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -128,7 +128,7 @@ static inline void test_si2q_segfault(void) if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -143,7 +143,7 @@ static inline void test_si2q_mu(void) if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -163,7 +163,7 @@ static inline void test_si2q_u(void) if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts); @@ -190,7 +190,7 @@ static inline void test_si2q_e(void) if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; |