summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-06-07 14:56:12 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-06-07 14:56:12 -0400
commit298eaf9ab48fc66bb3c143417cecd664ef4973fc (patch)
tree38acb38206f10179355f64b633a5750d3a753b06
parent570a8f967cb7c315c4f9746a9094b4b1fc9c8611 (diff)
downloadgdk-pixbuf-298eaf9ab48fc66bb3c143417cecd664ef4973fc.tar.gz
Add an animation loading test
-rw-r--r--tests/Makefile.am7
-rw-r--r--tests/animation.c25
-rw-r--r--tests/test-animation.gifbin0 -> 2177 bytes
3 files changed, 31 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 196ce79fb..639289e85 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -18,6 +18,7 @@ LDADDS = \
$(GDK_PIXBUF_DEP_LIBS)
noinst_PROGRAMS = \
+ animation \
pixbuf-read \
pixbuf-lowmem \
pixbuf-randomly-modified \
@@ -25,6 +26,7 @@ noinst_PROGRAMS = \
pixbuf-threads \
pixbuf-icon-serialize
+animation_LDADD = $(LDADDS)
pixbuf_read_LDADD = $(LDADDS)
pixbuf_lowmem_LDADD = $(LDADDS)
pixbuf_randomly_modified_LDADD = $(LDADDS)
@@ -40,7 +42,10 @@ insttest_PROGRAMS = \
pixbuf-threads \
$(NULL)
-insttest_DATA = test-image.png
+insttest_DATA = \
+ test-image.png \
+ test-animation.gif \
+ $(NULL)
testimagedir = $(insttestdir)/test-images
testimage_DATA = $(wildcard $(srcdir)/test-images/*)
diff --git a/tests/animation.c b/tests/animation.c
new file mode 100644
index 000000000..523559480
--- /dev/null
+++ b/tests/animation.c
@@ -0,0 +1,25 @@
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <stdlib.h>
+
+static void
+test_animation (void)
+{
+ 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);
+ g_assert_no_error (error);
+ g_assert (result != NULL);
+
+ g_object_unref (result);
+}
+
+int
+main (int argc, char *argv[])
+{
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/animation/load", test_animation);
+
+ return g_test_run ();
+}
diff --git a/tests/test-animation.gif b/tests/test-animation.gif
new file mode 100644
index 000000000..26f461484
--- /dev/null
+++ b/tests/test-animation.gif
Binary files differ