GNOME Bugzilla – Bug 786259
tests: Allow a potential error to be shown before failing
Last modified: 2017-08-22 10:16:07 UTC
When the test fails, let's first give it the chance to print the error message in order to help debugging failures.
Created attachment 357531 [details] [review] tests: Allow a potential error to be shown before failing When the test fails, let's first give it the chance to print the error message in order to help debugging failures.
Review of attachment 357531 [details] [review]: ::: tests/pixbuf-short-gif-write.c @@ +27,3 @@ g_assert (read_status == G_IO_STATUS_NORMAL || read_status == G_IO_STATUS_EOF); + gboolean success = gdk_pixbuf_loader_write(loader, buffer, bytes_read, &error); Declaration at the top of the function please, otherwise we'll have problems on Windows. Please call it "ret" as well.
Created attachment 357804 [details] [review] tests: Allow a potential error to be shown before failing When the test fails, let's first give it the chance to print the error message in order to help debugging failures.
Review of attachment 357804 [details] [review]: ::: tests/pixbuf-short-gif-write.c @@ +30,3 @@ + ret = gdk_pixbuf_loader_write(loader, buffer, bytes_read, &error); + g_assert_no_error (ret); You didn't try to compile this ;)
Created attachment 358088 [details] [review] tests: Allow a potential error to be shown before failing When the test fails, let's first give it the chance to print the error message in order to help debugging failures.
(In reply to Bastien Nocera from comment #4) > + ret = gdk_pixbuf_loader_write(loader, buffer, bytes_read, &error); > + g_assert_no_error (ret); > > You didn't try to compile this ;) heh. that's not true. It compiles for me. But I didn't see the new warning it generated. Mea culpa. Now it should be fine.
(In reply to Tobias Mueller from comment #6) > (In reply to Bastien Nocera from comment #4) > > + ret = gdk_pixbuf_loader_write(loader, buffer, bytes_read, &error); > > + g_assert_no_error (ret); > > > > You didn't try to compile this ;) > > heh. that's not true. It compiles for me. But I didn't see the new warning > it generated. Mea culpa. Now it should be fine. Right. I'm not sure it should be compiling though ;)
Review of attachment 358088 [details] [review]: Looks good now.
Attachment 358088 [details] pushed as 62c498a - tests: Allow a potential error to be shown before failing