[gdk-pixbuf] pixbuf-slow-load: Use the new helper
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] pixbuf-slow-load: Use the new helper
- Date: Tue, 13 Oct 2015 01:01:33 +0000 (UTC)
commit b491e530ba3745bcf1713799fb2b8a49572cb7c1
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 23 22:57:50 2015 -0400
pixbuf-slow-load: Use the new helper
We can use the new helper function here as well, instead
of manually listing all the tga test images.
tests/pixbuf-slow-load.c | 65 ++++-----------------------------------------
1 files changed, 6 insertions(+), 59 deletions(-)
---
diff --git a/tests/pixbuf-slow-load.c b/tests/pixbuf-slow-load.c
index 8186b51..308e503 100644
--- a/tests/pixbuf-slow-load.c
+++ b/tests/pixbuf-slow-load.c
@@ -62,7 +62,7 @@ test_slow_load (gconstpointer file)
guchar *contents;
gsize i, contents_length;
- filename = g_test_get_filename (G_TEST_DIST, file, NULL);
+ filename = file;
reference = gdk_pixbuf_new_from_file (filename, &error);
g_assert_no_error (error);
g_assert (reference != NULL);
@@ -104,69 +104,16 @@ test_slow_load (gconstpointer file)
g_object_unref (reference);
}
-static void
-test_add (const char *filename)
-{
- char *testname;
-
- testname = g_strconcat ("/pixbuf/slow-load/", filename, NULL);
-
- g_test_add_data_func (testname,
- filename,
- test_slow_load);
-
- g_free (testname);
-}
-
int
main (int argc, char **argv)
{
+ gchar *tga_test_images;
+
g_test_init (&argc, &argv, NULL);
- test_add ("test-images/tga/gtk-logo-16bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-16bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-16bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-16bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-24bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-24bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-24bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-24bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-32bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-32bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-32bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-32bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-cmap-8bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-cmap-8bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-cmap-8bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-cmap-8bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-cmap-rle-8bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-cmap-rle-8bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-cmap-rle-8bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-cmap-rle-8bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-16bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-16bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-16bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-16bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-8bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-8bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-8bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-8bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-16bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-16bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-16bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-16bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-8bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-8bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-8bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-gray-rle-8bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-rle-24bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-rle-24bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-rle-24bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-rle-24bpp-top-right.tga");
- test_add ("test-images/tga/gtk-logo-rle-32bpp-bottom-left.tga");
- test_add ("test-images/tga/gtk-logo-rle-32bpp-bottom-right.tga");
- test_add ("test-images/tga/gtk-logo-rle-32bpp-top-left.tga");
- test_add ("test-images/tga/gtk-logo-rle-32bpp-top-right.tga");
+ tga_test_images = g_build_filename (g_test_get_dir (G_TEST_DIST), "test-images/tga", NULL);
+ add_test_for_all_images ("/pixbuf/slow-load", tga_test_images, test_slow_load);
+ g_free (tga_test_images);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]