aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-26 17:55:39 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-02-26 17:55:39 -0800
commita28b5d53d75b428b1bee1efd39ac6d01d68d56d2 (patch)
tree62adbaee1a1228464dc883c4dc1655c70717fc15 /tests
parent0d9a247e9382081c04beaf61b5b5a07e1895d8e2 (diff)
parent8982b26cc4073a79332b0b74908bc439ed75e716 (diff)
Merge pull request #857 from caiiiycuk/writefds
draft implementation for writefds
Diffstat (limited to 'tests')
-rw-r--r--tests/websockets.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/websockets.c b/tests/websockets.c
index 34aa44b4..8e719baa 100644
--- a/tests/websockets.c
+++ b/tests/websockets.c
@@ -27,14 +27,19 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
assert(select(64, &sett, NULL, NULL, NULL) == 0); // empty set
FD_SET(sock, &sett);
assert(select(0, &sett, NULL, NULL, NULL) == 0); // max FD to check is 0
+ assert(FD_ISSET(sock, &sett) == 0);
+ FD_SET(sock, &sett);
int select_says_yes = select(64, &sett, NULL, NULL, NULL);
// ioctl check for IO
int bytes;
if (ioctl(sock, FIONREAD, &bytes) || bytes == 0) {
not_always_data = 1;
+ assert(FD_ISSET(sock, &sett) == 0);
return 0;
}
+
+ assert(FD_ISSET(sock, &sett));
assert(select_says_yes); // ioctl must agree with select
char buffer[1024];