diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-08 18:28:16 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-12 18:48:59 +0200 |
commit | d1520bd06ef902f0c198bd841b15ac27855be696 (patch) | |
tree | 3eacb5a5fcce89202173b9e388742c7bc95895c5 /tests | |
parent | da2702646c1065eaa2d501a7f33776dcc2f0f11c (diff) | |
download | glib-d1520bd06ef902f0c198bd841b15ac27855be696.tar.gz |
glib/tests: move spawn-test-win32-gui
Fixes: commit 762ed2e82b ("Move tests/spawn-test.c -> glib/tests/spawn-test.c")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/meson.build | 6 | ||||
-rw-r--r-- | tests/spawn-test-win32-gui.c | 88 |
2 files changed, 0 insertions, 94 deletions
diff --git a/tests/meson.build b/tests/meson.build index 9c8821132..907863bc8 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -42,12 +42,6 @@ test_extra_programs = { 'assert-msg-test' : {}, } -if host_machine.system() == 'windows' - test_extra_programs += { - 'spawn-test-win32-gui' : {'win_subsystem' : 'windows'} - } -endif - module_suffix = [] # Keep the autotools convention for shared module suffix because GModule # depends on it: https://gitlab.gnome.org/GNOME/glib/issues/520 diff --git a/tests/spawn-test-win32-gui.c b/tests/spawn-test-win32-gui.c deleted file mode 100644 index 34945f524..000000000 --- a/tests/spawn-test-win32-gui.c +++ /dev/null @@ -1,88 +0,0 @@ -#include <windows.h> -#include <io.h> -#include <errno.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <fcntl.h> - -#ifdef __CYGWIN__ -/* For read() and write() */ -#include <unistd.h> -/* Cygwin does not prototype __argc and __argv in stdlib.h */ -extern int __argc; -extern char** __argv; -#endif - -int _stdcall -WinMain (struct HINSTANCE__ *hInstance, - struct HINSTANCE__ *hPrevInstance, - char *lpszCmdLine, - int nCmdShow) -{ - if (__argc >= 2 && strcmp (__argv[1], "print_argv0") == 0) - { - printf ("%s", __argv[0]); - } - else if (__argc <= 2) - { - printf ("This is stdout\n"); - fflush (stdout); - - fprintf (stderr, "This is stderr\n"); - fflush (stderr); - } - else if (__argc == 4 && strcmp (__argv[1], "pipes") == 0) - { - int infd = atoi (__argv[2]); - int outfd = atoi (__argv[3]); - int k, n; - char buf[100] = {0}; - - if (infd < 0 || outfd < 0) - { - printf ("spawn-test-win32-gui: illegal fds on command line %s", - lpszCmdLine); - exit (1); - } - - n = strlen ("Hello there"); - if (write (outfd, &n, sizeof (n)) == -1 || - write (outfd, "Hello there", n) == -1) - { - int errsv = errno; - printf ("spawn-test-win32-gui: Write error: %s", strerror (errsv)); - exit (1); - } - - if ((k = read (infd, &n, sizeof (n))) != sizeof (n)) - { - printf ("spawn-test-win32-gui: Got only %d bytes, wanted %d", - k, (int)sizeof (n)); - exit (1); - } - - printf ("spawn-test-win32-gui: Parent says %d bytes to read", n); - - if ((k = read (infd, buf, n)) != n) - { - int errsv = errno; - if (k == -1) - printf ("spawn-test-win32-gui: Read error: %s", strerror (errsv)); - else - printf ("spawn-test-win32-gui: Got only %d bytes", k); - exit (1); - } - - n = strlen ("See ya"); - if (write (outfd, &n, sizeof (n)) == -1 || - write (outfd, "See ya", n) == -1) - { - int errsv = errno; - printf ("spawn-test-win32-gui: Write error: %s", strerror (errsv)); - exit (1); - } - } - - return 0; -} |