diff options
author | Bastien Nocera <hadess@hadess.net> | 2020-04-02 16:00:46 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2020-04-02 16:01:38 +0200 |
commit | fc0590fee0c23cee809e508f9b2847dda46f24a4 (patch) | |
tree | 3a4f12c6344285f61d72644af87d3510973ed815 /tests/pixbuf-jpeg.c | |
parent | cfdf6d3dacbc803127bcfbac6d16aa41cbfe3769 (diff) | |
download | gdk-pixbuf-fc0590fee0c23cee809e508f9b2847dda46f24a4.tar.gz |
tests: Add test for issue 70
Add test for the issue fixed by commit
35dcd72bbe7a9349861ff14389a38525fe9c949f.
Diffstat (limited to 'tests/pixbuf-jpeg.c')
-rw-r--r-- | tests/pixbuf-jpeg.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/pixbuf-jpeg.c b/tests/pixbuf-jpeg.c index d03384e42..3b1f2e4f0 100644 --- a/tests/pixbuf-jpeg.c +++ b/tests/pixbuf-jpeg.c @@ -137,6 +137,39 @@ test_at_size (void) g_object_unref (ref); } +static void +test_jpeg_markers (void) +{ + GdkPixbufLoader *loader; + GdkPixbuf *pixbuf; + GError *error = NULL; + gchar *contents; + gsize size; + + if (!format_supported ("jpeg")) + { + g_test_skip ("format not supported"); + return; + } + + g_file_get_contents (g_test_get_filename (G_TEST_DIST, "issue70.jpg", NULL), &contents, &size, &error); + g_assert_no_error (error); + + loader = gdk_pixbuf_loader_new (); + + gdk_pixbuf_loader_write (loader, (const guchar*)contents, size, &error); + g_assert_no_error (error); + + gdk_pixbuf_loader_close (loader, &error); + g_assert_no_error (error); + + pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); + g_assert_nonnull (pixbuf); + + g_object_unref (loader); + g_free (contents); +} + int main (int argc, char **argv) { @@ -147,6 +180,7 @@ main (int argc, char **argv) g_test_add_func ("/pixbuf/jpeg/bug775218", test_bug_775218); g_test_add_func ("/pixbuf/jpeg/comment", test_comment); g_test_add_func ("/pixbuf/jpeg/at_size", test_at_size); + g_test_add_func ("/pixbuf/jpeg/issue70", test_jpeg_markers); return g_test_run (); } |