From e286cd0d7b4e12c8efe5e7ac3066a100e0ba2c0a Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 8 Apr 2021 16:37:54 +0200 Subject: net: flag relevant Sock methods with [[nodiscard]] --- src/test/fuzz/i2p.cpp | 2 +- src/test/sock_tests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/fuzz/i2p.cpp b/src/test/fuzz/i2p.cpp index 345d68502a..e0d62fb493 100644 --- a/src/test/fuzz/i2p.cpp +++ b/src/test/fuzz/i2p.cpp @@ -37,7 +37,7 @@ FUZZ_TARGET_INIT(i2p, initialize_i2p) if (sess.Listen(conn)) { if (sess.Accept(conn)) { try { - conn.sock->RecvUntilTerminator('\n', 10ms, interrupt, i2p::sam::MAX_MSG_SIZE); + (void)conn.sock->RecvUntilTerminator('\n', 10ms, interrupt, i2p::sam::MAX_MSG_SIZE); } catch (const std::runtime_error&) { } } diff --git a/src/test/sock_tests.cpp b/src/test/sock_tests.cpp index 400de875b7..9e98f4f0b1 100644 --- a/src/test/sock_tests.cpp +++ b/src/test/sock_tests.cpp @@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(wait) Sock sock0(s[0]); Sock sock1(s[1]); - std::thread waiter([&sock0]() { sock0.Wait(24h, Sock::RECV); }); + std::thread waiter([&sock0]() { (void)sock0.Wait(24h, Sock::RECV); }); BOOST_REQUIRE_EQUAL(sock1.Send("a", 1, 0), 1); @@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE(recv_until_terminator_limit) // BOOST_CHECK_EXCEPTION() writes to some variables shared with the main thread which // creates a data race. So mimic it manually. try { - sock_recv.RecvUntilTerminator('\n', timeout, interrupt, max_data); + (void)sock_recv.RecvUntilTerminator('\n', timeout, interrupt, max_data); } catch (const std::runtime_error& e) { threw_as_expected = HasReason("too many bytes without a terminator")(e); } -- cgit v1.2.3