mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
testsuite: use binary mode for stdout on Windows
It's much easier than adjusting the test logic to account for the extra \r.
This commit is contained in:
parent
16dc979d0e
commit
fb37239b20
@ -17,6 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <io.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_pass (void)
|
test_pass (void)
|
||||||
@ -47,6 +52,14 @@ main (int argc,
|
|||||||
{
|
{
|
||||||
char *argv1;
|
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);
|
g_return_val_if_fail (argc > 1, 1);
|
||||||
argv1 = argv[1];
|
argv1 = argv[1];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user