From 204754fcdd92054c509d764982161c5cfabecb25 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 21 Jul 2023 12:05:05 +0200 Subject: [PATCH] channel unit tests: Actually retrieve the object after an overflow Not only this ensures that we can actually retrieve the submitted object, it prevents memory analysis tools from reporting a leak. --- pdns/test-channel.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdns/test-channel.cc b/pdns/test-channel.cc index 6965eecdbf..9a7e4e037b 100644 --- a/pdns/test-channel.cc +++ b/pdns/test-channel.cc @@ -77,6 +77,11 @@ BOOST_AUTO_TEST_CASE(test_object_queue_full) auto obj = std::make_unique(); obj->a = 42U; BOOST_CHECK(sender.send(std::move(obj))); + /* and to get it */ + { + auto got = receiver.receive(); + BOOST_CHECK(got); + } } BOOST_AUTO_TEST_CASE(test_object_queue_throw_on_eof) -- 2.47.2