summaryrefslogtreecommitdiff
path: root/net-libs/glib-networking/files/glib-networking-2.76.0-libproxy-0.5.patch
blob: e59fe9a07416bbd0f64221189ead4cc4e154f387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
https://bugs.gentoo.org/907303
https://gitlab.gnome.org/GNOME/glib-networking/-/commit/a7db10e8862050f19af5c2eebcd1d590a04d5ced

From a7db10e8862050f19af5c2eebcd1d590a04d5ced Mon Sep 17 00:00:00 2001
From: Jan-Michael Brummer <jan.brummer@tabos.org>
Date: Tue, 13 Jun 2023 17:10:11 +0200
Subject: [PATCH] Fix tests using libproxy 0.5

New libproxy 0.5 now behaves just like glib, additional checks aren't
needed.

Fixes: https://gitlab.gnome.org/GNOME/glib-networking/-/issues/212
--- a/proxy/tests/common.c
+++ b/proxy/tests/common.c
@@ -172,13 +172,15 @@ static void
 test_proxy_ignore_common (void)
 {
   GProxyResolver *resolver;
-  gboolean is_libproxy;
   GError *error = NULL;
   char **proxies;
   int i;
 
+#ifndef LIBPROXY_0_5
+  gboolean is_libproxy = g_strcmp0 (g_getenv ("GIO_PROXY_TEST_NAME"), "libproxy") == 0;
+#endif
+
   resolver = g_proxy_resolver_get_default ();
-  is_libproxy = g_strcmp0 (g_getenv ("GIO_PROXY_TEST_NAME"), "libproxy") == 0;
 
   for (i = 0; i < n_ignore_tests; i++)
     {
@@ -186,9 +188,11 @@ test_proxy_ignore_common (void)
                                          NULL, &error);
       g_assert_no_error (error);
 
+#ifndef LIBPROXY_0_5
       if (is_libproxy && ignore_tests[i].libproxy_fails)
         g_assert_cmpstr (proxies[0], ==, "http://localhost:8080");
       else
+#endif
         g_assert_cmpstr (proxies[0], ==, ignore_tests[i].proxy);
 
       g_strfreev (proxies);
--- a/proxy/tests/meson.build
+++ b/proxy/tests/meson.build
@@ -18,9 +18,16 @@ foreach program: proxy_test_programs
     )
   endif
 
+  c_flags = []
+
+  if libproxy_dep.version() >= '0.5.0'
+    c_flags += '-DLIBPROXY_0_5'
+  endif
+
   exe = executable(
     test_name,
     program[0] + '.c',
+    c_args : c_flags,
     include_directories: top_inc,
     dependencies: program[2],
     install: enable_installed_tests,
-- 
GitLab