aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-01 16:11:39 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-04-04 17:54:37 +0200
commit113e30cb0639cefbafdad2862c5e69b0e17d9bf3 (patch)
tree753dbe0cc7a4e7fd09cb44e9da2db7be401916f7 /tests
parent091fcf147ae83d8daec92b2506d14e5e5ad35f80 (diff)
use osmo_init_logging2() with proper talloc ctx
Completely drop bts_log_init(), call osmo_init_logging2() directly instead: all callers of bts_log_init() passed NULL as category string, so all it ever did was call osmo_init_logging(). The bts_log_info is already declared in the .h. Here and there also define a proper talloc root context instead of using NULL. Change-Id: Ic049f77bef74123b95350bcae182a468e0086b9c
Diffstat (limited to 'tests')
-rw-r--r--tests/agch/agch_test.c2
-rw-r--r--tests/cipher/cipher_test.c2
-rw-r--r--tests/handover/handover_test.c2
-rw-r--r--tests/meas/meas_test.c2
-rw-r--r--tests/misc/misc_test.c9
-rw-r--r--tests/paging/paging_test.c2
-rw-r--r--tests/tx_power/tx_power_test.c2
7 files changed, 13 insertions, 8 deletions
diff --git a/tests/agch/agch_test.c b/tests/agch/agch_test.c
index 6efbc248..ab59ebfe 100644
--- a/tests/agch/agch_test.c
+++ b/tests/agch/agch_test.c
@@ -222,7 +222,7 @@ int main(int argc, char **argv)
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
msgb_talloc_ctx_init(tall_bts_ctx, 0);
- bts_log_init(NULL);
+ osmo_init_logging2(tall_bts_ctx, &bts_log_info);
bts = gsm_bts_alloc(tall_bts_ctx, 0);
if (bts_init(bts) < 0) {
diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c
index 5e2bdc02..a7343c08 100644
--- a/tests/cipher/cipher_test.c
+++ b/tests/cipher/cipher_test.c
@@ -68,7 +68,7 @@ int main(int argc, char **argv)
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
msgb_talloc_ctx_init(tall_bts_ctx, 0);
- bts_log_init(NULL);
+ osmo_init_logging2(tall_bts_ctx, &bts_log_info);
bts = gsm_bts_alloc(tall_bts_ctx, 0);
if (bts_init(bts) < 0) {
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 1c0a4da7..c7bd8f8d 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -67,7 +67,7 @@ int main(int argc, char **argv)
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
msgb_talloc_ctx_init(tall_bts_ctx, 0);
- bts_log_init(NULL);
+ osmo_init_logging2(tall_bts_ctx, &bts_log_info);
osmo_stderr_target->categories[DHO].loglevel = LOGL_DEBUG;
bts = gsm_bts_alloc(tall_bts_ctx, 0);
diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c
index a283c476..cbc673fd 100644
--- a/tests/meas/meas_test.c
+++ b/tests/meas/meas_test.c
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
msgb_talloc_ctx_init(tall_bts_ctx, 0);
- bts_log_init(NULL);
+ osmo_init_logging2(tall_bts_ctx, &bts_log_info);
osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG;
bts = gsm_bts_alloc(tall_bts_ctx, 0);
diff --git a/tests/misc/misc_test.c b/tests/misc/misc_test.c
index e4542354..c4d3a595 100644
--- a/tests/misc/misc_test.c
+++ b/tests/misc/misc_test.c
@@ -24,11 +24,14 @@
#include <osmo-bts/msg_utils.h>
#include <osmo-bts/logging.h>
+#include <osmocom/core/application.h>
#include <osmocom/gsm/protocol/ipaccess.h>
#include <stdlib.h>
#include <stdio.h>
+void *ctx = NULL;
+
static const uint8_t ipa_rsl_connect[] = {
0x00, 0x1c, 0xff, 0x10, 0x80, 0x00, 0x0a, 0x0d,
0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x70, 0x61, 0x63,
@@ -161,7 +164,7 @@ static void test_bts_supports_cm(void)
{
struct gsm_bts *bts;
- bts = gsm_bts_alloc(NULL, 0);
+ bts = gsm_bts_alloc(ctx, 0);
gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_V1);
gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_V1);
@@ -184,7 +187,9 @@ static void test_bts_supports_cm(void)
int main(int argc, char **argv)
{
- bts_log_init(NULL);
+ ctx = talloc_named_const(NULL, 0, "misc_test");
+
+ osmo_init_logging2(ctx, &bts_log_info);
test_sacch_get();
test_msg_utils_ipa();
diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c
index f4f0934e..bf28661a 100644
--- a/tests/paging/paging_test.c
+++ b/tests/paging/paging_test.c
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
msgb_talloc_ctx_init(tall_bts_ctx, 0);
- bts_log_init(NULL);
+ osmo_init_logging2(tall_bts_ctx, &bts_log_info);
bts = gsm_bts_alloc(tall_bts_ctx, 0);
if (bts_init(bts) < 0) {
diff --git a/tests/tx_power/tx_power_test.c b/tests/tx_power/tx_power_test.c
index a47d186c..ad3f68ce 100644
--- a/tests/tx_power/tx_power_test.c
+++ b/tests/tx_power/tx_power_test.c
@@ -211,7 +211,7 @@ int main(int argc, char **argv)
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
msgb_talloc_ctx_init(tall_bts_ctx, 0);
- bts_log_init(NULL);
+ osmo_init_logging2(tall_bts_ctx, &bts_log_info);
osmo_stderr_target->categories[DL1C].loglevel = LOGL_DEBUG;
log_set_print_filename(osmo_stderr_target, 0);