[glib/2325-symlink-replace-file] WIP
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/2325-symlink-replace-file] WIP
- Date: Wed, 10 Mar 2021 17:28:46 +0000 (UTC)
commit 9aedc08240bd189fb58f7c3199d2ca781426a2d3
Author: Philip Withnall <pwithnall endlessos org>
Date: Wed Mar 10 17:28:41 2021 +0000
WIP
Signed-off-by: Philip Withnall <pwithnall endlessos org>
gio/tests/file.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/gio/tests/file.c b/gio/tests/file.c
index bccda5874..b1b19ad03 100644
--- a/gio/tests/file.c
+++ b/gio/tests/file.c
@@ -915,7 +915,7 @@ test_replace_symlink (void)
/* FIXME: These tests have only been checked on Linux. Most of them are probably
* applicable on Windows, too, but that has not been tested yet.
* See https://gitlab.gnome.org/GNOME/glib/-/issues/2325 */
-#ifdef G_OS_UNIX
+#ifdef __linux__
/* Different kinds of file which create_test_file() can create. */
typedef enum
@@ -1148,7 +1148,7 @@ check_test_file (GFile *test_file,
g_free (target_basename);
}
-#endif /* G_OS_UNIX */
+#endif /* __linux__ */
/* A big test for g_file_replace() and g_file_replace_readwrite(). The
* @test_data is a boolean: %TRUE to test g_file_replace_readwrite(), %FALSE to
@@ -1169,7 +1169,7 @@ check_test_file (GFile *test_file,
static void
test_replace (gconstpointer test_data)
{
-#ifdef G_OS_UNIX
+#ifdef __linux__
gboolean read_write = GPOINTER_TO_UINT (test_data);
const gchar *new_contents = "this is a new test message which should be written to source";
const gchar *original_source_contents = "this is some test content in source";
@@ -1678,16 +1678,6 @@ test_replace (gconstpointer test_data)
guint n_files;
GError *local_error = NULL;
- /* Socket tests will only work on Linux due to the way we use mknod(). */
-#if !defined(__linux__)
- if (tests[i].setup_source_type == FILE_TEST_SETUP_TYPE_SOCKET ||
- tests[i].setup_backup_type == FILE_TEST_SETUP_TYPE_SOCKET)
- {
- g_test_message ("Skipping test %" G_GSIZE_FORMAT " due to socket use", i);
- continue;
- }
-#endif
-
/* Create a fresh, empty working directory. */
tmpdir_path = g_dir_make_tmp ("g_file_replace_XXXXXX", &local_error);
g_assert_no_error (local_error);
@@ -1823,8 +1813,8 @@ test_replace (gconstpointer test_data)
g_clear_object (&source_file);
g_clear_object (&tmpdir);
}
-#else /* if !G_OS_UNIX */
- g_test_skip ("File replacement tests can only be run on Unix")
+#else /* if !__linux__ */
+ g_test_skip ("File replacement tests can only be run on Linux")
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]