mappedfile test: permit ENODEV on /dev/null
authorRyan Lortie <desrt@desrt.ca>
Sun, 23 Feb 2014 05:47:29 +0000 (00:47 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sun, 23 Feb 2014 05:47:29 +0000 (00:47 -0500)
mmap() on /dev/null returns ENODEV on old Linux versions and also on
Hurd, so accept that in the testcase.

https://bugzilla.gnome.org/show_bug.cgi?id=722360

glib/tests/mappedfile.c

index 99c26c9..ccaea34 100644 (file)
@@ -54,6 +54,7 @@ test_device (void)
 
   file = g_mapped_file_new ("/dev/null", FALSE, &error);
   g_assert (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_INVAL) ||
+            g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NODEV) ||
             g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM));
   g_assert (file == NULL);
   g_error_free (error);