[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 10:10:45 +0000 (UTC)
commit ac0706aad0ed6799fdae264541ffdfa040c7f15a
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..75dca95ae 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_true (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_true (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]