summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-01-22 01:32:52 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-09 11:41:30 +0400
commit452d64a03b43b11ed2a7d1b4e95b47a0bd01caad (patch)
tree24ad6a101842c961b490e110ec94fd7722347124
parentb60b0ec72de0f1d8f8fc6ecab93c78f13be96069 (diff)
downloadglib-452d64a03b43b11ed2a7d1b4e95b47a0bd01caad.tar.gz
tests: use Windows mime type for executable
According to https://stackoverflow.com/a/43916291/1277510 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r--gio/tests/contenttype.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gio/tests/contenttype.c b/gio/tests/contenttype.c
index 081a6f005..f280213b5 100644
--- a/gio/tests/contenttype.c
+++ b/gio/tests/contenttype.c
@@ -202,6 +202,13 @@ test_executable (void)
{
gchar *type;
+#ifdef G_OS_WIN32
+ type = g_content_type_from_mime_type ("application/vnd.microsoft.portable-executable");
+ /* FIXME: the MIME is not in the default `MIME\Database\Content Type` registry.
+ * g_assert_true (g_content_type_can_be_executable (type));
+ */
+ g_free (type);
+#else
type = g_content_type_from_mime_type ("application/x-executable");
g_assert_true (g_content_type_can_be_executable (type));
g_free (type);
@@ -209,7 +216,7 @@ test_executable (void)
type = g_content_type_from_mime_type ("text/plain");
g_assert_true (g_content_type_can_be_executable (type));
g_free (type);
-
+#endif
type = g_content_type_from_mime_type ("image/png");
g_assert_false (g_content_type_can_be_executable (type));
g_free (type);