Skip to content

Commit

Permalink
test: check result of uv_loop_init and uv_write
Browse files Browse the repository at this point in the history
Silence coverity warnings about the return value not being checked.

PR-URL: #10126
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@chromium.org>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bnoordhuis authored and addaleax committed Dec 8, 2016
1 parent 19432f0 commit 62f5a0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/cctest/test_inspector_socket.cc
Expand Up @@ -121,8 +121,9 @@ static void do_write(const char* data, int len) {
uv_buf_t buf[1];
buf[0].base = const_cast<char*>(data);
buf[0].len = len;
uv_write(&req, reinterpret_cast<uv_stream_t*>(&client_socket), buf, 1,
write_done);
GTEST_ASSERT_EQ(0,
uv_write(&req, reinterpret_cast<uv_stream_t*>(&client_socket),
buf, 1, write_done));
SPIN_WHILE(req.data);
}

Expand Down Expand Up @@ -360,7 +361,7 @@ class InspectorSocketTest : public ::testing::Test {
connected = false;
inspector_ready = false;
last_event = kInspectorHandshakeHttpGet;
uv_loop_init(&loop);
GTEST_ASSERT_EQ(0, uv_loop_init(&loop));
server = uv_tcp_t();
client_socket = uv_tcp_t();
server.data = &inspector;
Expand Down

0 comments on commit 62f5a0b

Please sign in to comment.