From: Matthias Clasen Date: Wed, 13 Apr 2011 12:19:35 +0000 (-0400) Subject: Skip the writable test if the file is not writable X-Git-Tag: 2.29.2^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e55346420e74a562b42d14a136c07a4bbd9d955;p=platform%2Fupstream%2Fglib.git Skip the writable test if the file is not writable Since make distcheck operates on a readonly source tree. --- diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c index 2678fd2..b9f2aa1 100644 --- a/glib/tests/mappedfile.c +++ b/glib/tests/mappedfile.c @@ -1,5 +1,9 @@ +#include #include #include +#ifdef HAVE_UNISTD_H +#include +#endif static void test_empty (void) @@ -38,6 +42,12 @@ test_writable (void) const gchar *old = "MMMMMMMMMMMMMMMMMMMMMMMMM"; const gchar *new = "abcdefghijklmnopqrstuvxyz"; + if (access (SRCDIR "/4096-random-bytes", W_OK) != 0) + { + g_test_message ("Skipping writable mapping test"); + return; + } + error = NULL; file = g_mapped_file_new (SRCDIR "/4096-random-bytes", TRUE, &error); g_assert_no_error (error);