diff options
-rw-r--r-- | tests/pixbuf-short-gif-write.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/pixbuf-short-gif-write.c b/tests/pixbuf-short-gif-write.c index 21bffbb1d..9e7137ab3 100644 --- a/tests/pixbuf-short-gif-write.c +++ b/tests/pixbuf-short-gif-write.c @@ -35,11 +35,13 @@ loader_write_from_channel (GdkPixbufLoader *loader, static void test_short_gif_write (void) { + GdkPixbufLoader *loader; GIOChannel* channel = g_io_channel_new_file (g_test_get_filename (G_TEST_DIST, "test-animation.gif", NULL), "r", NULL); + g_assert (channel != NULL); g_io_channel_set_encoding (channel, NULL, NULL); - GdkPixbufLoader *loader = gdk_pixbuf_loader_new_with_type ("gif", NULL); + loader = gdk_pixbuf_loader_new_with_type ("gif", NULL); g_assert (loader != NULL); loader_write_from_channel (loader, channel, 10); @@ -58,17 +60,20 @@ test_load_first_frame (void) gboolean has_frame = FALSE; GError *error = NULL; GdkPixbuf *pixbuf; + GdkPixbufLoader *loader; channel = g_io_channel_new_file (g_test_get_filename (G_TEST_DIST, "1_partyanimsm2.gif", NULL), "r", NULL); g_assert (channel != NULL); g_io_channel_set_encoding (channel, NULL, NULL); - GdkPixbufLoader *loader = gdk_pixbuf_loader_new_with_type ("gif", NULL); + loader = gdk_pixbuf_loader_new_with_type ("gif", NULL); g_assert (loader != NULL); while (!has_frame) { + GdkPixbufAnimation *animation; + loader_write_from_channel (loader, channel, 4096); - GdkPixbufAnimation *animation = gdk_pixbuf_loader_get_animation (loader); + animation = gdk_pixbuf_loader_get_animation (loader); if (animation) { GdkPixbufAnimationIter *iter = gdk_pixbuf_animation_get_iter (animation, NULL); if (!gdk_pixbuf_animation_iter_on_currently_loading_frame (iter)) |