summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2015-05-02 23:46:06 +0000
committerMatthias Clasen <mclasen@redhat.com>2015-12-16 07:47:54 -0500
commitce985f13f475fbb2b1f8c7d5a1e5ff1fa12a8e81 (patch)
tree28b66e1b6b1d6de8ca98f618cd40c5d9028884bb
parentb86e46e8e7f89f6866cb2fbb917ae00ea9431185 (diff)
downloadglib-ce985f13f475fbb2b1f8c7d5a1e5ff1fa12a8e81.tar.gz
Enable contenttype test on W32, tweak it to pass (mostly)
* On W32 use a real directory (SYSTEMROOT) instead of '/etc/' * Disable test_symbolic_icon() as it can't be passed (symbolic icons are not really supported) * PowerPoint/Gettext test still fails, presumably because msvcrt qsort() moves the entires (both have the same priority) https://bugzilla.gnome.org/show_bug.cgi?id=735696
-rw-r--r--gio/tests/Makefile.am2
-rw-r--r--gio/tests/contenttype.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
index cc7deb357..0553fdfc6 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -27,6 +27,7 @@ test_programs = \
buffered-output-stream \
cancellable \
contexts \
+ contenttype \
converter-stream \
credentials \
data-input-stream \
@@ -242,7 +243,6 @@ gdbus_daemon_SOURCES = \
if OS_UNIX
test_programs += \
- contenttype \
file \
gdbus-peer-object-manager \
gdbus-unix-addresses \
diff --git a/gio/tests/contenttype.c b/gio/tests/contenttype.c
index 52487ca96..8c08da69c 100644
--- a/gio/tests/contenttype.c
+++ b/gio/tests/contenttype.c
@@ -18,6 +18,7 @@ test_guess (void)
{
gchar *res;
gchar *expected;
+ gchar *existing_directory;
gboolean uncertain;
guchar data[] =
"[Desktop Entry]\n"
@@ -25,7 +26,17 @@ test_guess (void)
"Name=appinfo-test\n"
"Exec=./appinfo-test --option\n";
- res = g_content_type_guess ("/etc/", NULL, 0, &uncertain);
+#ifdef G_OS_WIN32
+ existing_directory = (gchar *) g_getenv ("SYSTEMROOT");
+
+ if (existing_directory)
+ existing_directory = g_strdup_printf ("%s/", existing_directory);
+#else
+ existing_directory = g_strdup ("/etc/");
+#endif
+
+ res = g_content_type_guess (existing_directory, NULL, 0, &uncertain);
+ g_free (existing_directory);
expected = g_content_type_from_mime_type ("inode/directory");
g_assert_content_type_equals (expected, res);
g_assert (uncertain);
@@ -237,6 +248,7 @@ test_icon (void)
static void
test_symbolic_icon (void)
{
+#ifndef G_OS_WIN32
gchar *type;
GIcon *icon;
@@ -271,6 +283,7 @@ test_symbolic_icon (void)
}
g_object_unref (icon);
g_free (type);
+#endif
}
static void