Merge branch 'wip/pwithnall/backport-2978-osx-test-fixes-glib-2-74' into 'glib-2-74'

Backport !2978 “A couple of test fixes on OS X” to glib-2-74

See merge request GNOME/glib!2989
This commit is contained in:
Marco Trevisan 2022-10-20 16:26:10 +00:00
commit f147c5eed1

View File

@ -2472,10 +2472,14 @@ get_size_from_du (const gchar *path, guint64 *size)
GError *error = NULL;
gchar *du_path = NULL;
/* If we cant find du, dont try and run the test. */
#ifndef HAVE_COCOA
du_path = g_find_program_in_path ("du");
#endif
/* If we cant find du, dont try and run the test. */
if (du_path == NULL)
return FALSE;
g_free (du_path);
du = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE,
@ -3552,7 +3556,11 @@ test_query_zero_length_content_type (void)
NULL, &error);
g_assert_no_error (error);
#ifndef HAVE_COCOA
g_assert_cmpstr (g_file_info_get_content_type (file_info), ==, "text/plain");
#else
g_assert_cmpstr (g_file_info_get_content_type (file_info), ==, "public.text");
#endif
g_clear_object (&file_info);
g_clear_object (&empty_file);