After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786259 - tests: Allow a potential error to be shown before failing
tests: Allow a potential error to be shown before failing
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: loaders
unspecified
Other All
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2017-08-13 23:34 UTC by Tobias Mueller
Modified: 2017-08-22 10:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Allow a potential error to be shown before failing (1.08 KB, patch)
2017-08-13 23:34 UTC, Tobias Mueller
none Details | Review
tests: Allow a potential error to be shown before failing (1.40 KB, patch)
2017-08-17 11:36 UTC, Tobias Mueller
none Details | Review
tests: Allow a potential error to be shown before failing (1.37 KB, patch)
2017-08-21 18:28 UTC, Tobias Mueller
committed Details | Review

Description Tobias Mueller 2017-08-13 23:34:27 UTC
When the test fails, let's first give it the chance to print the error
message in order to help debugging failures.
Comment 1 Tobias Mueller 2017-08-13 23:34:31 UTC
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.
Comment 2 Bastien Nocera 2017-08-14 22:39:46 UTC
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.
Comment 3 Tobias Mueller 2017-08-17 11:36:12 UTC
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.
Comment 4 Bastien Nocera 2017-08-21 17:52:28 UTC
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 ;)
Comment 5 Tobias Mueller 2017-08-21 18:28:37 UTC
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.
Comment 6 Tobias Mueller 2017-08-21 18:31:28 UTC
(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.
Comment 7 Bastien Nocera 2017-08-21 18:33:19 UTC
(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 ;)
Comment 8 Bastien Nocera 2017-08-21 18:33:43 UTC
Review of attachment 358088 [details] [review]:

Looks good now.
Comment 9 Tobias Mueller 2017-08-22 10:16:03 UTC
Attachment 358088 [details] pushed as 62c498a - tests: Allow a potential error to be shown before failing