From 871c4b46988420e161dd7b30d86b802fe96f4565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 12 Jan 2023 19:49:11 +0100 Subject: [PATCH] spawn-test-win32-gui: Write state to stderr Makes TAP happier --- glib/tests/spawn-test-win32-gui.c | 18 +++++++++--------- glib/tests/spawn-test.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/glib/tests/spawn-test-win32-gui.c b/glib/tests/spawn-test-win32-gui.c index 34945f524..46353c8f3 100644 --- a/glib/tests/spawn-test-win32-gui.c +++ b/glib/tests/spawn-test-win32-gui.c @@ -26,7 +26,7 @@ WinMain (struct HINSTANCE__ *hInstance, } else if (__argc <= 2) { - printf ("This is stdout\n"); + printf ("# This is stdout\n"); fflush (stdout); fprintf (stderr, "This is stderr\n"); @@ -41,36 +41,36 @@ WinMain (struct HINSTANCE__ *hInstance, if (infd < 0 || outfd < 0) { - printf ("spawn-test-win32-gui: illegal fds on command line %s", + fprintf (stderr, "spawn-test-win32-gui: illegal fds on command line %s\n", lpszCmdLine); exit (1); } n = strlen ("Hello there"); if (write (outfd, &n, sizeof (n)) == -1 || - write (outfd, "Hello there", n) == -1) + write (outfd, "Hello there\n", n) == -1) { int errsv = errno; - printf ("spawn-test-win32-gui: Write error: %s", strerror (errsv)); + fprintf (stderr, "spawn-test-win32-gui: Write error: %s\n", strerror (errsv)); exit (1); } if ((k = read (infd, &n, sizeof (n))) != sizeof (n)) { - printf ("spawn-test-win32-gui: Got only %d bytes, wanted %d", + fprintf (stderr, "spawn-test-win32-gui: Got only %d bytes, wanted %d\n", k, (int)sizeof (n)); exit (1); } - printf ("spawn-test-win32-gui: Parent says %d bytes to read", n); + fprintf (stderr, "spawn-test-win32-gui: Parent says %d bytes to read\n", n); if ((k = read (infd, buf, n)) != n) { int errsv = errno; if (k == -1) - printf ("spawn-test-win32-gui: Read error: %s", strerror (errsv)); + fprintf (stderr, "spawn-test-win32-gui: Read error: %s\n", strerror (errsv)); else - printf ("spawn-test-win32-gui: Got only %d bytes", k); + fprintf (stderr, "spawn-test-win32-gui: Got only %d bytes\n", k); exit (1); } @@ -79,7 +79,7 @@ WinMain (struct HINSTANCE__ *hInstance, write (outfd, "See ya", n) == -1) { int errsv = errno; - printf ("spawn-test-win32-gui: Write error: %s", strerror (errsv)); + fprintf (stderr, "spawn-test-win32-gui: Write error: %s\n", strerror (errsv)); exit (1); } } diff --git a/glib/tests/spawn-test.c b/glib/tests/spawn-test.c index c0b6829fe..7da666e3f 100644 --- a/glib/tests/spawn-test.c +++ b/glib/tests/spawn-test.c @@ -149,7 +149,7 @@ test_spawn_basics (void) g_assert_no_error (err); g_assert_true (result); - g_assert_cmpstr (output, ==, "This is stdout\r\n"); + g_assert_cmpstr (output, ==, "# This is stdout\r\n"); g_assert_cmpstr (erroutput, ==, "This is stderr\r\n"); g_free (output);