Merge branch 'wip/pwithnall/more-macos-fixes' into 'main'

tests: Fix macOS failures in the file tests

See merge request GNOME/glib!2779
This commit is contained in:
Simon McVittie 2022-06-25 10:23:49 +00:00
commit 99a7c6351c
2 changed files with 19 additions and 16 deletions

View File

@ -587,6 +587,9 @@ g_app_info_create_from_commandline (const char *commandline,
GAppInfoCreateFlags flags,
GError **error)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"Creating an app info from a command line not currently supported");
return NULL;
}

View File

@ -1988,7 +1988,7 @@ on_new_tmp_done (GObject *object,
GError *error = NULL;
GMainLoop *loop = user_data;
gchar *basename;
gchar *parent_path;
GFile *tmpdir = NULL;
g_assert_null (object);
@ -2009,9 +2009,9 @@ on_new_tmp_done (GObject *object,
g_assert_no_error (error);
parent = g_file_get_parent (file);
parent_path = g_file_get_path (parent);
tmpdir = g_file_new_for_path (g_get_tmp_dir ());
g_assert_cmpstr (g_get_tmp_dir (), ==, parent_path);
g_assert_true (g_file_equal (tmpdir, parent));
g_main_loop_quit (loop);
@ -2020,7 +2020,7 @@ on_new_tmp_done (GObject *object,
g_object_unref (iostream);
g_object_unref (info);
g_free (basename);
g_free (parent_path);
g_object_unref (tmpdir);
}
static void
@ -2087,7 +2087,7 @@ on_new_tmp_dir_done (GObject *object,
GError *error = NULL;
GMainLoop *loop = user_data;
gchar *basename;
gchar *parent_path;
GFile *tmpdir = NULL;
g_assert_null (object);
@ -2106,9 +2106,9 @@ on_new_tmp_dir_done (GObject *object,
g_assert_cmpuint (g_file_info_get_file_type (info), ==, G_FILE_TYPE_DIRECTORY);
parent = g_file_get_parent (file);
parent_path = g_file_get_path (parent);
tmpdir = g_file_new_for_path (g_get_tmp_dir ());
g_assert_cmpstr (g_get_tmp_dir (), ==, parent_path);
g_assert_true (g_file_equal (tmpdir, parent));
g_main_loop_quit (loop);
@ -2116,7 +2116,7 @@ on_new_tmp_dir_done (GObject *object,
g_object_unref (parent);
g_object_unref (info);
g_free (basename);
g_free (parent_path);
g_object_unref (tmpdir);
}
static void
@ -3493,8 +3493,8 @@ test_query_default_handler_uri (void)
GFile *file;
GFile *invalid_file;
#ifdef G_OS_WIN32
g_test_skip ("Default URI handlers are not currently supported on Windows");
#if defined(G_OS_WIN32) || defined(__APPLE__)
g_test_skip ("Default URI handlers are not currently supported on Windows or macOS");
return;
#endif
@ -3536,8 +3536,8 @@ test_query_default_handler_file (void)
const char buffer[] = "Text file!\n";
const guint8 binary_buffer[] = "\xde\xad\xbe\xff";
#ifdef G_OS_WIN32
g_test_skip ("Default URI handlers are not currently supported on Windows");
#if defined(G_OS_WIN32) || defined(__APPLE__)
g_test_skip ("Default URI handlers are not currently supported on Windows or macOS");
return;
#endif
@ -3626,8 +3626,8 @@ test_query_default_handler_file_async (void)
const guint8 binary_buffer[] = "\xde\xad\xbe\xff";
GError *error = NULL;
#ifdef G_OS_WIN32
g_test_skip ("Default URI handlers are not currently supported on Windows");
#if defined(G_OS_WIN32) || defined(__APPLE__)
g_test_skip ("Default URI handlers are not currently supported on Windows or macOS");
return;
#endif
@ -3716,8 +3716,8 @@ test_query_default_handler_uri_async (void)
GFile *file;
GFile *invalid_file;
#ifdef G_OS_WIN32
g_test_skip ("Default URI handlers are not currently supported on Windows");
#if defined(G_OS_WIN32) || defined(__APPLE__)
g_test_skip ("Default URI handlers are not currently supported on Windows or macOS");
return;
#endif