[glib: 3/4] tests: Re-enable contenttype tests under AddressSanitizer
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/4] tests: Re-enable contenttype tests under AddressSanitizer
- Date: Wed, 3 Nov 2021 15:42:21 +0000 (UTC)
commit f31e5e6c6648dee2e62af15cd4bd85dc393ffceb
Author: Philip Withnall <pwithnall endlessos org>
Date: Mon Sep 27 13:11:21 2021 +0100
tests: Re-enable contenttype tests under AddressSanitizer
This is a partial revert of commit
f3783520514a6ba8d15454e14175d086883cdb0f, as the previous commits have
silenced the AddressSanitizer warnings for `GContentType`.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Fixes: #2310
gio/tests/contenttype.c | 51 ++-----------------------------------------------
1 file changed, 2 insertions(+), 49 deletions(-)
---
diff --git a/gio/tests/contenttype.c b/gio/tests/contenttype.c
index db34f1da8..10b795a05 100644
--- a/gio/tests/contenttype.c
+++ b/gio/tests/contenttype.c
@@ -1,8 +1,6 @@
#include <gio/gio.h>
#include <string.h>
-#include "glib/glib-private.h"
-
#define g_assert_content_type_equals(s1, s2) \
do { \
const char *__s1 = (s1), *__s2 = (s2); \
@@ -18,9 +16,6 @@
static void
test_guess (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
gchar *res;
gchar *expected;
gchar *existing_directory;
@@ -131,15 +126,11 @@ test_guess (void)
g_assert_false (uncertain);
g_free (res);
g_free (expected);
-#endif
}
static void
test_unknown (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
gchar *unknown;
gchar *str;
@@ -149,15 +140,11 @@ test_unknown (void)
g_assert_cmpstr (str, ==, "application/octet-stream");
g_free (str);
g_free (unknown);
-#endif
}
static void
test_subtype (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
gchar *plain;
gchar *xml;
@@ -169,7 +156,6 @@ test_subtype (void)
g_free (plain);
g_free (xml);
-#endif
}
static gint
@@ -183,10 +169,6 @@ find_mime (gconstpointer a, gconstpointer b)
static void
test_list (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
- (void) find_mime;
-#else
GList *types;
gchar *plain;
gchar *xml;
@@ -211,15 +193,11 @@ test_list (void)
g_free (plain);
g_free (xml);
-#endif
}
static void
test_executable (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
gchar *type;
type = g_content_type_from_mime_type ("application/x-executable");
@@ -233,15 +211,11 @@ test_executable (void)
type = g_content_type_from_mime_type ("image/png");
g_assert_false (g_content_type_can_be_executable (type));
g_free (type);
-#endif
}
static void
test_description (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
gchar *type;
gchar *desc;
@@ -251,15 +225,11 @@ test_description (void)
g_free (desc);
g_free (type);
-#endif
}
static void
test_icon (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
gchar *type;
GIcon *icon;
@@ -296,15 +266,12 @@ test_icon (void)
}
g_object_unref (icon);
g_free (type);
-#endif
}
static void
test_symbolic_icon (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#elif !defined(G_OS_WIN32)
+#ifndef G_OS_WIN32
gchar *type;
GIcon *icon;
@@ -352,9 +319,6 @@ test_symbolic_icon (void)
static void
test_tree (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
const gchar *tests[] = {
"x-content/image-dcf",
"x-content/unix-software",
@@ -379,15 +343,11 @@ test_tree (void)
g_strfreev (types);
g_object_unref (file);
}
-#endif
}
static void
test_type_is_a_special_case (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
gboolean res;
g_test_bug ("https://bugzilla.gnome.org/show_bug.cgi?id=782311");
@@ -399,15 +359,11 @@ test_type_is_a_special_case (void)
res = g_content_type_is_a ("anything", "application/octet-stream");
g_assert_true (res);
#endif
-#endif
}
static void
test_guess_svg_from_data (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#else
const gchar svgfilecontent[] = "<svg xmlns=\"http://www.w3.org/2000/svg\"\
xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n\
<rect x=\"10\" y=\"10\" height=\"100\" width=\"100\"\n\
@@ -426,15 +382,12 @@ test_guess_svg_from_data (void)
#endif
g_assert_false (uncertain);
g_free (res);
-#endif
}
static void
test_mime_from_content (void)
{
-#ifdef _GLIB_ADDRESS_SANITIZER
- g_test_incomplete ("FIXME: Leaks xdgmime internal data, see glib#2310");
-#elif defined(__APPLE__)
+#ifdef __APPLE__
gchar *mime_type;
mime_type = g_content_type_get_mime_type ("com.microsoft.bmp");
g_assert_cmpstr (mime_type, ==, "image/bmp");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]