[glib: 2/11] gio/tests: add unix-fd test to win32




commit b8eb64b350449e65bcd75b79172eee231966ea9c
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Thu Apr 7 19:00:32 2022 +0400

    gio/tests: add unix-fd test to win32
    
    The "/unix-fd/scm" test is quite Unix-specific, the next patch is going
    to add a portable test.
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 gio/tests/meson.build | 2 +-
 gio/tests/unix-fd.c   | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 7b4613403a..7867918f5d 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -115,6 +115,7 @@ gio_tests = {
   'tls-interaction' : {'extra_sources' : ['gtesttlsbackend.c']},
   'tls-database' : {'extra_sources' : ['gtesttlsbackend.c']},
   'tls-bindings' : {'extra_sources' : ['gtesttlsbackend.c']},
+  'unix-fd' : {},
   'gdbus-address-get-session' : {
     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
     'should_fail' : host_system == 'darwin',
@@ -194,7 +195,6 @@ if host_machine.system() != 'windows'
     'resolver-parsing' : {'dependencies' : [network_libs]},
     'socket-address' : {},
     'stream-rw_all' : {},
-    'unix-fd' : {},
     'unix-mounts' : {},
     'unix-streams' : {},
     'g-file-info-filesystem-readonly' : {},
diff --git a/gio/tests/unix-fd.c b/gio/tests/unix-fd.c
index b29ddca1f4..ca20e80ab3 100644
--- a/gio/tests/unix-fd.c
+++ b/gio/tests/unix-fd.c
@@ -2,8 +2,11 @@
 #include <gio/gnetworking.h>
 #include <gio/gunixfdmessage.h>
 #include <gio/gunixsocketaddress.h>
-#include <string.h>
+#ifdef G_OS_UNIX
+#include <glib-unix.h>
 #include <unistd.h>
+#endif
+#include <string.h>
 
 /* ensures that no FDs are left open at the end */
 static void
@@ -41,6 +44,7 @@ create_fd_list (gint *fd_list)
 static void
 test_scm (void)
 {
+#ifndef G_OS_WIN32
   GError *err = NULL;
   GUnixFDMessage *message;
   GUnixFDMessage **mv;
@@ -228,6 +232,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
   g_object_unref (list);
 
   check_fd_list (fd_list);
+#else
+  g_test_skip ("FD SCM support doesn’t exist on Windows");
+#endif
 }
 
 int


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