[glib/wip/silviol/gsocket_flags: 1/2] added stream writability checks in pollable unit test
- From: Silvio Lazzeretti <silviol src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/silviol/gsocket_flags: 1/2] added stream writability checks in pollable unit test
- Date: Thu, 13 Dec 2018 09:53:32 +0000 (UTC)
commit decce52952811cb944a6f637f6fbccea82fa91b2
Author: Silvio Lazzeretti <silviola amazon com>
Date: Thu Dec 13 09:09:34 2018 +0100
added stream writability checks in pollable unit test
This checks if the stream is writable before writing
to it. If the write succeeded with no error, then the
stream has to be also writable after the write
gio/tests/pollable.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gio/tests/pollable.c b/gio/tests/pollable.c
index 826eaecad..ecbf46c5f 100644
--- a/gio/tests/pollable.c
+++ b/gio/tests/pollable.c
@@ -65,9 +65,13 @@ write_callback (gpointer user_data)
gssize nwrote;
GError *error = NULL;
+ g_assert (g_pollable_output_stream_is_writable (G_POLLABLE_OUTPUT_STREAM (out)));
+
nwrote = g_output_stream_write (out, buf, 2, NULL, &error);
g_assert_no_error (error);
g_assert_cmpint (nwrote, ==, 2);
+ g_assert (g_pollable_output_stream_is_writable (G_POLLABLE_OUTPUT_STREAM (out)));
+
/* Give the pipe a few ticks to propagate the write for sockets. On my
* iMac i7, 40 works, 30 doesn't. */
g_usleep (80L);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]