summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-04-13 08:19:35 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-04-13 08:19:35 -0400
commit0e55346420e74a562b42d14a136c07a4bbd9d955 (patch)
tree720f9d72a116488c04eecdca71d2a10867139265
parent67b8c7ea8adeef5e2db5e2ed65a15db1e6c91f74 (diff)
Skip the writable test if the file is not writable2.29.2
Since make distcheck operates on a readonly source tree.
-rw-r--r--glib/tests/mappedfile.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c
index 2678fd20d..b9f2aa1dc 100644
--- a/glib/tests/mappedfile.c
+++ b/glib/tests/mappedfile.c
@@ -1,5 +1,9 @@
+#include <config.h>
#include <glib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#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);