diff options
-rw-r--r-- | tests/large.png | bin | 0 -> 2507420 bytes | |||
-rw-r--r-- | tests/pixbuf-scale.c | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/large.png b/tests/large.png Binary files differnew file mode 100644 index 000000000..310bd62cd --- /dev/null +++ b/tests/large.png diff --git a/tests/pixbuf-scale.c b/tests/pixbuf-scale.c index eeddfe689..c6f55b522 100644 --- a/tests/pixbuf-scale.c +++ b/tests/pixbuf-scale.c @@ -65,6 +65,35 @@ test_scale (gconstpointer data) g_object_unref (ref); } +static void +test_scale_down (gconstpointer data) +{ + const gchar *filename = data; + const gchar *path; + GError *error = NULL; + GdkPixbuf *ref; + GdkPixbuf *pixbuf; + gint width, height; + + 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); + + width = gdk_pixbuf_get_width (ref); + height = gdk_pixbuf_get_height (ref); + + pixbuf = gdk_pixbuf_scale_simple (ref, width / 10, height / 10, GDK_INTERP_BILINEAR); + g_assert (pixbuf != NULL); + + g_object_unref (ref); +} + int main (int argc, char **argv) { @@ -78,6 +107,7 @@ main (int argc, char **argv) g_test_add_data_func ("/pixbuf/scale/tga", "test-images/valid_tga_test", test_scale); g_test_add_data_func ("/pixbuf/scale/xpm", "test-images/valid_xpm_test", test_scale); 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); return g_test_run (); } |