From: Remi Gacogne Date: Fri, 21 Jul 2023 10:05:05 +0000 (+0200) Subject: channel unit tests: Actually retrieve the object after an overflow X-Git-Tag: rec-5.0.0-alpha1~94^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13061%2Fhead;p=thirdparty%2Fpdns.git 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. --- 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)