mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
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
This commit is contained in:
parent
27369def50
commit
ac0706aad0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user