tests/autoptr: Don't use /dev/null under Windows

Use the "nul" device instead.

https://bugzilla.gnome.org/show_bug.cgi?id=795569
This commit is contained in:
Christoph Reiter 2018-04-26 11:25:14 +02:00 committed by Christoph Reiter
parent a8b4d516aa
commit 0d10dd9fe5

View File

@ -97,7 +97,13 @@ test_g_hmac (void)
static void
test_g_io_channel (void)
{
g_autoptr(GIOChannel) val = g_io_channel_new_file ("/dev/null", "r", NULL);
#ifdef G_OS_WIN32
const gchar *devnull = "nul";
#else
const gchar *devnull = "/dev/null";
#endif
g_autoptr(GIOChannel) val = g_io_channel_new_file (devnull, "r", NULL);
g_assert (val != NULL);
}