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

Commit

Permalink
test: add a 'write before connect' test
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Jun 4, 2012
1 parent cb9ca14 commit 76fa163
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test-tcp-dont-connect-after-write.c
Expand Up @@ -74,6 +74,10 @@ TEST_IMPL(tcp_dont_connect_after_write) {
r = uv_tcp_init(uv_default_loop(), &conn);
ASSERT(r == 0);

r = uv_write(&write_req, (uv_stream_t*)&conn, &buf, 1, write_cb);
ASSERT(r == -1);
ASSERT(uv_last_error(uv_default_loop()).code == UV_EBADF);

r = uv_tcp_connect(&connect_req, &conn, addr, connect_cb);
ASSERT(r == 0);

Expand Down

0 comments on commit 76fa163

Please sign in to comment.