From 0796a6c0fcd31f2d52a50a1ffd699897d658b088 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Tue, 11 Jul 2017 01:42:41 +0630 Subject: 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 --- tests/gsm0408/gsm0408_test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/gsm0408') diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 1b326ee54..fcdc8f8ed 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,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); @@ -168,7 +168,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); @@ -188,7 +188,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, __func__); @@ -216,7 +216,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; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; @@ -249,7 +249,7 @@ static inline void test_si2q_long(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; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; -- cgit v1.2.3