diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/websockets.c | 5 |
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]; |