[calls] sip: origin: Do not use CallsNetworkWatch during tests



commit 6b33845b11825a6ba90828523459a0ee4c8268bf
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Fri Sep 3 00:20:44 2021 +0200

    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 18d3f93b..bfd6a1cb 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]