[gdk-pixbuf] Test loading an ani animation too



commit 79c43a4e131046d3a718101b259b80973498e608
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 8 00:35:50 2013 -0400

    Test loading an ani animation too

 tests/Makefile.am        |    1 +
 tests/animation.c        |   19 ++++++++++++++++---
 tests/test-animation.ani |  Bin 0 -> 251168 bytes
 3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 23e4c58..4f13397 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -46,6 +46,7 @@ insttest_PROGRAMS =                   \
 insttest_DATA =                        \
        test-image.png                  \
        test-animation.gif              \
+       test-animation.ani              \
        $(NULL)
 
 testimagedir = $(insttestdir)/test-images
diff --git a/tests/animation.c b/tests/animation.c
index 5235594..455879b 100644
--- a/tests/animation.c
+++ b/tests/animation.c
@@ -2,24 +2,37 @@
 #include <stdlib.h>
 
 static void
-test_animation (void)
+test_animation (const gchar *filename)
 {
   GError *error = NULL;
   GdkPixbufAnimation* result = NULL;
 
-  result = gdk_pixbuf_animation_new_from_file (g_test_get_filename (G_TEST_DIST, "test-animation.gif", 
NULL), &error);
+  result = gdk_pixbuf_animation_new_from_file (g_test_get_filename (G_TEST_DIST, filename, NULL), &error);
   g_assert_no_error (error);
   g_assert (result != NULL);
 
   g_object_unref (result);
 }
 
+static void
+test_gif_animation (void)
+{
+  test_animation ("test-animation.gif");
+}
+
+static void
+test_ani_animation (void)
+{
+  test_animation ("test-animation.ani");
+}
+
 int
 main (int argc, char *argv[])
 {
   g_test_init (&argc, &argv, NULL);
 
-  g_test_add_func ("/animation/load", test_animation);
+  g_test_add_func ("/animation/gif", test_gif_animation);
+  g_test_add_func ("/animation/ani", test_ani_animation);
 
   return g_test_run ();
 }
diff --git a/tests/test-animation.ani b/tests/test-animation.ani
new file mode 100644
index 0000000..319a884
Binary files /dev/null and b/tests/test-animation.ani differ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]