[gdk-pixbuf] Add an animation loading test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] Add an animation loading test
- Date: Fri, 7 Jun 2013 18:56:29 +0000 (UTC)
commit 298eaf9ab48fc66bb3c143417cecd664ef4973fc
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 7 14:56:12 2013 -0400
Add an animation loading test
tests/Makefile.am | 7 ++++++-
tests/animation.c | 25 +++++++++++++++++++++++++
tests/test-animation.gif | Bin 0 -> 2177 bytes
3 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 196ce79..639289e 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 0000000..5235594
--- /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 0000000..26f4614
Binary files /dev/null and b/tests/test-animation.gif differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]