[gdk-pixbuf] tests: Allow a potential error to be shown before failing
- From: Tobias Mueller <tobiasmue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] tests: Allow a potential error to be shown before failing
- Date: Tue, 22 Aug 2017 10:15:23 +0000 (UTC)
commit 62c498a3432ef0e161dec04e8af6b398ba3bec4b
Author: Tobias Mueller <muelli cryptobitch de>
Date: Tue Aug 1 23:01:51 2017 +0100
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.
https://bugzilla.gnome.org/show_bug.cgi?id=786259
tests/pixbuf-short-gif-write.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/tests/pixbuf-short-gif-write.c b/tests/pixbuf-short-gif-write.c
index 9e7137a..82150d9 100644
--- a/tests/pixbuf-short-gif-write.c
+++ b/tests/pixbuf-short-gif-write.c
@@ -16,6 +16,8 @@ loader_write_from_channel (GdkPixbufLoader *loader,
gsize bytes_read = 0;
GIOStatus read_status;
GError* error = NULL;
+ gboolean ret;
+
if(count_bytes < G_MAXSIZE) {
//read no more than 'count_bytes' bytes
buffer = g_malloc (count_bytes);
@@ -26,8 +28,9 @@ loader_write_from_channel (GdkPixbufLoader *loader,
}
g_assert (read_status == G_IO_STATUS_NORMAL || read_status == G_IO_STATUS_EOF);
- g_assert (gdk_pixbuf_loader_write(loader, buffer, bytes_read, &error));
+ ret = gdk_pixbuf_loader_write(loader, buffer, bytes_read, &error);
g_assert_no_error (error);
+ g_assert (ret);
g_free(buffer);
return bytes_read;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]