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>
This commit is contained in:
Marc-André Lureau 2022-04-07 19:00:32 +04:00
parent 5efb84f24a
commit b8eb64b350
2 changed files with 9 additions and 2 deletions

View File

@ -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' : {},

View File

@ -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 doesnt exist on Windows");
#endif
}
int