summaryrefslogtreecommitdiff
path: root/tests/pixbuf-scale.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-08-24 15:27:24 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-08-24 16:27:17 -0400
commit244f386bce98ca5d69d87a5b49c229a78f945c63 (patch)
tree4c9557df5b8e541e870b8cc1b6bbfade76fcfb68 /tests/pixbuf-scale.c
parent4f68cb78a5277f169b9531e6998c00c7976594e4 (diff)
downloadgdk-pixbuf-244f386bce98ca5d69d87a5b49c229a78f945c63.tar.gz
Add a test for rotating a large image
This is prone to segfaults when we are not careful.
Diffstat (limited to 'tests/pixbuf-scale.c')
-rw-r--r--tests/pixbuf-scale.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/pixbuf-scale.c b/tests/pixbuf-scale.c
index 3ea3eb216..32d9840e2 100644
--- a/tests/pixbuf-scale.c
+++ b/tests/pixbuf-scale.c
@@ -124,6 +124,32 @@ test_add_alpha (gconstpointer data)
g_object_unref (ref);
}
+static void
+test_rotate (gconstpointer data)
+{
+ const gchar *filename = data;
+ const gchar *path;
+ GError *error = NULL;
+ GdkPixbuf *ref;
+ GdkPixbuf *pixbuf;
+
+ if (!format_supported (filename))
+ {
+ g_test_skip ("format not supported");
+ return;
+ }
+
+ path = g_test_get_filename (G_TEST_DIST, filename, NULL);
+ ref = gdk_pixbuf_new_from_file (path, &error);
+ g_assert_no_error (error);
+
+ pixbuf = gdk_pixbuf_rotate_simple (ref, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
+ g_assert (pixbuf != NULL);
+ g_object_unref (pixbuf);
+
+ g_object_unref (ref);
+}
+
int
main (int argc, char **argv)
{
@@ -139,6 +165,7 @@ main (int argc, char **argv)
g_test_add_data_func ("/pixbuf/scale/xbm", "test-images/valid.xbm", test_scale);
g_test_add_data_func ("/pixbuf/scale/large", "large.png", test_scale_down);
g_test_add_data_func ("/pixbuf/add-alpha/large", "large.png", test_add_alpha);
+ g_test_add_data_func ("/pixbuf/rotate/large", "large.png", test_rotate);
return g_test_run ();
}