From b8eb64b350449e65bcd75b79172eee231966ea9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 7 Apr 2022 19:00:32 +0400 Subject: [PATCH] gio/tests: add unix-fd test to win32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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 7b4613403..7867918f5 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 b29ddca1f..ca20e80ab 100644 --- a/gio/tests/unix-fd.c +++ b/gio/tests/unix-fd.c @@ -2,8 +2,11 @@ #include #include #include -#include +#ifdef G_OS_UNIX +#include #include +#endif +#include /* 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