]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
channel unit tests: Actually retrieve the object after an overflow 13061/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 21 Jul 2023 10:05:05 +0000 (12:05 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 21 Jul 2023 10:05:05 +0000 (12:05 +0200)
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

index 6965eecdbf67807c82cdf2298ee625dab4adc7c5..9a7e4e037b58736052b11f71f89a003efad65a53 100644 (file)
@@ -77,6 +77,11 @@ BOOST_AUTO_TEST_CASE(test_object_queue_full)
   auto obj = std::make_unique<MyObject>();
   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)