diff options
author | Benjamin Otte <otte@redhat.com> | 2015-10-12 08:00:51 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-10-13 02:56:48 +0200 |
commit | 3585920c5ad748baf5fa9c873644e7a4fd584ad7 (patch) | |
tree | f0a8912f9e3af08cfad96ff26f8e9978fe0e8c37 | |
parent | 12bd0e2fff525e716d7ee8c96855912fb56b25be (diff) | |
download | gdk-pixbuf-3585920c5ad748baf5fa9c873644e7a4fd584ad7.tar.gz |
tests: Skip reftests for unsupported formats
-rw-r--r-- | tests/pixbuf-reftest.c | 6 | ||||
-rw-r--r-- | tests/test-common.c | 15 | ||||
-rw-r--r-- | tests/test-common.h | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/pixbuf-reftest.c b/tests/pixbuf-reftest.c index b36837852..704f3aa20 100644 --- a/tests/pixbuf-reftest.c +++ b/tests/pixbuf-reftest.c @@ -117,6 +117,12 @@ test_reftest (gconstpointer data) gboolean success; file = G_FILE (data); + if (!file_supported (file)) + { + g_test_skip ("format not supported"); + return; + } + filename = g_file_get_path (file); ref_file = make_ref_file (file); diff --git a/tests/test-common.c b/tests/test-common.c index 611a36f05..a4ea4fa3b 100644 --- a/tests/test-common.c +++ b/tests/test-common.c @@ -59,6 +59,21 @@ format_supported (const gchar *filename) } gboolean +file_supported (GFile *file) +{ + char *uri; + gboolean result; + + uri = g_file_get_uri (file); + + result = format_supported (uri); + + g_free (uri); + + return result; +} + +gboolean skip_if_insufficient_memory (GError **err) { if (*err && g_error_matches (*err, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY)) diff --git a/tests/test-common.h b/tests/test-common.h index f0e1b1a03..8da8f9693 100644 --- a/tests/test-common.h +++ b/tests/test-common.h @@ -30,6 +30,7 @@ G_BEGIN_DECLS typedef gboolean (* AddTestFunc) (GFile *file); gboolean format_supported (const gchar *filename); +gboolean file_supported (GFile *file); gboolean skip_if_insufficient_memory (GError **err); gboolean pixdata_equal (GdkPixbuf *test, GdkPixbuf *ref, GError **error); void add_test_for_all_images (const gchar *prefix, |