Commit 7eeab9fa authored by Chun-wei Fan's avatar Chun-wei Fan
Browse files

tests: Fix build on pre-C99

Ensure variables are declared at the top of the block.

https://bugzilla.gnome.org/show_bug.cgi?id=785767
parent c1a8ca5c
......@@ -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))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment