[glib/fix-protocol-test-win32] Use win32 io channel on windows for the protocol test



commit 22b3a5ec009a4d1eecef95f4823ce7a61285bf6b
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Thu Jan 24 12:50:44 2019 +0100

    Use win32 io channel on windows for the protocol test
    
    We must use the platform specific method to create an IO channel
    out of an fd. The test still does not work on Windows but
    this is a step forward in the direction to make it work.

 glib/tests/protocol.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/glib/tests/protocol.c b/glib/tests/protocol.c
index 18ebe61d1..4713f3d0b 100644
--- a/glib/tests/protocol.c
+++ b/glib/tests/protocol.c
@@ -162,7 +162,11 @@ test_message (void)
   tlb = g_test_log_buffer_new ();
   loop = g_main_loop_new (NULL, FALSE);
 
+#ifdef G_OS_WIN32
+  channel = g_io_channel_win32_new_fd (pipes[0]);
+#else
   channel = g_io_channel_unix_new (pipes[0]);
+#endif
   g_io_channel_set_close_on_unref (channel, TRUE);
   g_io_channel_set_encoding (channel, NULL, NULL);
   g_io_channel_set_buffered (channel, FALSE);
@@ -285,7 +289,11 @@ test_error (void)
       tlb = g_test_log_buffer_new ();
       loop = g_main_loop_new (NULL, FALSE);
 
+#ifdef G_OS_WIN32
+      channel = g_io_channel_win32_new_fd (pipes[0]);
+#else
       channel = g_io_channel_unix_new (pipes[0]);
+#endif
       g_io_channel_set_close_on_unref (channel, TRUE);
       g_io_channel_set_encoding (channel, NULL, NULL);
       g_io_channel_set_buffered (channel, FALSE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]