From 6b33845b11825a6ba90828523459a0ee4c8268bf Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Fri, 3 Sep 2021 00:20:44 +0200 Subject: [PATCH] sip: origin: Do not use CallsNetworkWatch during tests As local testing showed we might get netlink message headers of type NLMSG_ERROR which leads to a warning being printed and the test to fail. --- plugins/sip/calls-sip-origin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/sip/calls-sip-origin.c b/plugins/sip/calls-sip-origin.c index 18d3f93..bfd6a1c 100644 --- a/plugins/sip/calls-sip-origin.c +++ b/plugins/sip/calls-sip-origin.c @@ -1433,10 +1433,10 @@ calls_sip_origin_accounts_interface_init (CallsAccountInterface *iface) static void calls_sip_origin_init (CallsSipOrigin *self) { - CallsNetworkWatch *nw = calls_network_watch_get_default (); + const char *sip_test_env = g_getenv ("CALLS_SIP_TEST"); - if (nw) - g_signal_connect_swapped (nw, "network-changed", + if (!sip_test_env || sip_test_env[0] == '\0') + g_signal_connect_swapped (calls_network_watch_get_default (), "network-changed", G_CALLBACK (on_network_changed), self); self->call_handles = g_hash_table_new (NULL, NULL);