From fb37239b20e7ec5be77c847950a0f3c72fbbed88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Fri, 8 Feb 2019 20:15:19 +0000 Subject: [PATCH] testsuite: use binary mode for stdout on Windows It's much easier than adjusting the test logic to account for the extra \r. --- glib/tests/testing-helper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/glib/tests/testing-helper.c b/glib/tests/testing-helper.c index 43127e8dd..b0e1f4a98 100644 --- a/glib/tests/testing-helper.c +++ b/glib/tests/testing-helper.c @@ -17,6 +17,11 @@ */ #include +#ifdef G_OS_WIN32 +#include +#include +#include +#endif static void test_pass (void) @@ -47,6 +52,14 @@ main (int argc, { char *argv1; +#ifdef G_OS_WIN32 + /* Windows opens std streams in text mode, with \r\n EOLs. + * Sometimes it's easier to force a switch to binary mode than + * to account for extra \r in testcases. + */ + setmode (fileno (stdout), O_BINARY); +#endif + g_return_val_if_fail (argc > 1, 1); argv1 = argv[1];