Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Poll tests: verify that uv_is_active() works correctly for poll handles
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed May 3, 2012
1 parent 830d744 commit 9fa8712
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test-poll.c
Expand Up @@ -387,12 +387,20 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) {
/* Sent and received FIN. Close and destroy context. */
close_socket(context->sock);
destroy_connection_context(context);
context->events = 0;

} else if (new_events != context->events) {
/* Poll mask changed. Call uv_poll_start again. */
context->events = new_events;
uv_poll_start(handle, new_events, connection_poll_cb);
}

/* Assert that uv_is_active works correctly for poll handles. */
if (context->events != 0) {
ASSERT(uv_is_active((uv_handle_t*) handle));
} else {
ASSERT(!uv_is_active((uv_handle_t*) handle));
}
}


Expand Down

0 comments on commit 9fa8712

Please sign in to comment.