summaryrefslogtreecommitdiffstats
path: root/tests/vty
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-05 03:02:35 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-04-06 04:37:50 +0200
commita829b45c8553765dfdd7201e1875a033a91d3a90 (patch)
tree64c0b73850ecc5aac87e3f76860d5a79f8eed30a /tests/vty
parent3a32147366faa6e08ae37700b1314b92f7b788a7 (diff)
use osmo_init_logging2() with proper talloc ctx
Ironically, when deprecating osmo_init_logging() in I216837780e9405fdaec8059c63d10699c695b360, I forgot to change the callers within libosmocore itself, i.e. in the various regression tests. Change-Id: Ia36c248f99353d5baaa2533f46a2f60a8579bdf8
Diffstat (limited to 'tests/vty')
-rw-r--r--tests/vty/vty_test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c
index 42646eb4..a3478e1d 100644
--- a/tests/vty/vty_test.c
+++ b/tests/vty/vty_test.c
@@ -41,6 +41,7 @@
#include <osmocom/vty/stats.h>
static enum event last_vty_connection_event = -1;
+void *ctx = NULL;
static void test_cmd_string_from_valstr(void)
{
@@ -55,7 +56,7 @@ static void test_cmd_string_from_valstr(void)
/* check against character strings that could break printf */
- cmd = vty_cmd_string_from_valstr (NULL, printf_seq_vs, "[prefix%s%s%s%s%s]", "[sep%s%s%s%s%s]", "[end%s%s%s%s%s]", 1);
+ cmd = vty_cmd_string_from_valstr (ctx, printf_seq_vs, "[prefix%s%s%s%s%s]", "[sep%s%s%s%s%s]", "[end%s%s%s%s%s]", 1);
printf ("Tested with %%s-strings, resulting cmd = '%s'\n", cmd);
talloc_free (cmd);
}
@@ -428,12 +429,15 @@ int main(int argc, char **argv)
.cat = default_categories,
.num_cat = ARRAY_SIZE(default_categories),
};
- void *stats_ctx = talloc_named_const(NULL, 1, "stats test context");
+ void *stats_ctx;
+
+ ctx = talloc_named_const(NULL, 0, "stats test context");
+ stats_ctx = talloc_named_const(ctx, 1, "stats test context");
osmo_signal_register_handler(SS_L_VTY, vty_event_cb, NULL);
/* Fake logging. */
- osmo_init_logging(&log_info);
+ osmo_init_logging2(ctx, &log_info);
/* Init stats */
osmo_stats_init(stats_ctx);