summaryrefslogtreecommitdiffstats
path: root/tests/socket
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/socket
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/socket')
-rw-r--r--tests/socket/socket_test.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/socket/socket_test.c b/tests/socket/socket_test.c
index 11ef8da4..37e02819 100644
--- a/tests/socket/socket_test.c
+++ b/tests/socket/socket_test.c
@@ -35,6 +35,8 @@
#include "../config.h"
+void *ctx = NULL;
+
static int test_sockinit(void)
{
int fd, rc;
@@ -44,7 +46,7 @@ static int test_sockinit(void)
fd = osmo_sock_init(AF_INET, SOCK_DGRAM, IPPROTO_UDP,
"0.0.0.0", 0, OSMO_SOCK_F_BIND);
OSMO_ASSERT(fd >= 0);
- name = osmo_sock_get_name(NULL, fd);
+ name = osmo_sock_get_name(ctx, fd);
/* expect it to be not connected. We cannot match on INADDR_ANY,
* as apparently that won't work on FreeBSD if there's only one
* address (e.g. 127.0.0.1) assigned to the entire system, like
@@ -82,7 +84,7 @@ static int test_sockinit2(void)
fd = osmo_sock_init2(AF_INET, SOCK_DGRAM, IPPROTO_UDP,
"0.0.0.0", 0, NULL, 0, OSMO_SOCK_F_BIND);
OSMO_ASSERT(fd >= 0);
- name = osmo_sock_get_name(NULL, fd);
+ name = osmo_sock_get_name(ctx, fd);
/* expect it to be not connected. We cannot match on INADDR_ANY,
* as apparently that won't work on FreeBSD if there's only one
* address (e.g. 127.0.0.1) assigned to the entire system, like
@@ -111,7 +113,7 @@ static int test_sockinit2(void)
fd = osmo_sock_init2(AF_INET, SOCK_DGRAM, IPPROTO_UDP, "127.0.0.1", 0, "127.0.0.1", 53,
OSMO_SOCK_F_BIND|OSMO_SOCK_F_CONNECT);
OSMO_ASSERT(fd >= 0);
- name = osmo_sock_get_name(NULL, fd);
+ name = osmo_sock_get_name(ctx, fd);
#ifndef __FreeBSD__
/* For some reason, on the jenkins.osmocom.org build slave with
* FreeBSD 10 inside a jail, it fails. Works fine on laforge's
@@ -134,7 +136,8 @@ static struct log_info info = {
int main(int argc, char *argv[])
{
- osmo_init_logging(&info);
+ ctx = talloc_named_const(NULL, 0, "socket_test");
+ osmo_init_logging2(ctx, &info);
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);