From 4e52e9c502adf4bbcb1640fb14490d64152fbbf5 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 5 Dec 2016 17:13:21 +0100 Subject: [PATCH] test: check result of uv_loop_init and uv_write Silence coverity warnings about the return value not being checked. --- test/cctest/test_inspector_socket.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/cctest/test_inspector_socket.cc b/test/cctest/test_inspector_socket.cc index c7a282b75b4b8d..ada3df3d438ce8 100644 --- a/test/cctest/test_inspector_socket.cc +++ b/test/cctest/test_inspector_socket.cc @@ -121,8 +121,9 @@ static void do_write(const char* data, int len) { uv_buf_t buf[1]; buf[0].base = const_cast(data); buf[0].len = len; - uv_write(&req, reinterpret_cast(&client_socket), buf, 1, - write_done); + GTEST_ASSERT_EQ(0, + uv_write(&req, reinterpret_cast(&client_socket), + buf, 1, write_done)); SPIN_WHILE(req.data); } @@ -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;