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
This commit is contained in:
Руслан Ижбулатов 2015-05-02 23:46:06 +00:00 committed by Matthias Clasen
parent b86e46e8e7
commit ce985f13f4
2 changed files with 15 additions and 2 deletions

View File

@ -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 \

View File

@ -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