[glib/wip/pwithnall/converter-stream-debugging] WIP
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/pwithnall/converter-stream-debugging] WIP
- Date: Tue, 5 Apr 2022 15:32:14 +0000 (UTC)
commit 5f4797f63d4ddcfaa563a46b8bebc0ce6f066d12
Author: Philip Withnall <pwithnall endlessos org>
Date: Tue Apr 5 16:32:21 2022 +0100
WIP
Signed-off-by: Philip Withnall <pwithnall endlessos org>
gio/tests/converter-stream.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c
index 9676a2c0a4..279d71e3a4 100644
--- a/gio/tests/converter-stream.c
+++ b/gio/tests/converter-stream.c
@@ -166,6 +166,8 @@ static void g_compressor_converter_iface_init (GConverterIface *iface);
struct _GCompressorConverter
{
GObject parent_instance;
+
+ gchar *message;
};
G_DEFINE_TYPE_WITH_CODE (GCompressorConverter, g_compressor_converter, G_TYPE_OBJECT,
@@ -208,6 +210,7 @@ g_compressor_converter_convert (GConverter *converter,
gsize *bytes_written,
GError **error)
{
+ GCompressorConverter *self = (GCompressorConverter *) converter;
const guint8 *in, *in_end;
guint8 v, *out;
gsize i;
@@ -235,7 +238,8 @@ g_compressor_converter_convert (GConverter *converter,
{
if (*bytes_read > 0)
break;
-g_message ("%s: inbuf_size %lu, outbuf_size %lu, flags %d, *bytes_read %lu, *bytes_written %lu, in_end - in
%lu, block_size %lu",
+g_free (self->message);
+self->message = g_strdup_printf ("%s: inbuf_size %lu, outbuf_size %lu, flags %d, *bytes_read %lu,
*bytes_written %lu, in_end - in %lu, block_size %lu",
G_STRFUNC, inbuf_size, outbuf_size, flags, *bytes_read, *bytes_written, in_end - in, block_size);
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_PARTIAL_INPUT,
@@ -260,7 +264,8 @@ g_message ("%s: inbuf_size %lu, outbuf_size %lu, flags %d, *bytes_read %lu, *byt
{
if (*bytes_read > 0)
break;
-g_message ("%s: v %u, inbuf_size %lu, outbuf_size %lu, flags %d, *bytes_read %lu, *bytes_written %lu, in_end
- in %lu, block_size %lu",
+g_free (self->message);
+self->message = g_strdup_printf ("%s: v %u, inbuf_size %lu, outbuf_size %lu, flags %d, *bytes_read %lu,
*bytes_written %lu, in_end - in %lu, block_size %lu",
G_STRFUNC, v, inbuf_size, outbuf_size, flags, *bytes_read, *bytes_written, in_end - in,
block_size);
g_set_error_literal (error, G_IO_ERROR,
G_IO_ERROR_PARTIAL_INPUT,
@@ -275,7 +280,8 @@ g_message ("%s: v %u, inbuf_size %lu, outbuf_size %lu, flags %d, *bytes_read %lu
}
if (in == in_end && (flags & G_CONVERTER_INPUT_AT_END)) {
- g_message ("%s: converter finished", G_STRFUNC);
+ g_free (self->message);
+self->message = g_strdup_printf ("%s: converter finished", G_STRFUNC);
return G_CONVERTER_FINISHED;
}
return G_CONVERTER_CONVERTED;
@@ -1062,6 +1068,7 @@ test_converter_pollable (void)
/* After closing the write end, we can't get WOULD_BLOCK any more */
if (!socket_out)
{
+ g_test_message ("converter message: %s", ((GCompressorConverter *) compressor)->message);
g_assert_no_error (error);
g_assert_cmpint (res, !=, -1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]