From 9f79f5d1fb108c8afaeac05961c0983694a415b9 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 17 Jun 2019 14:27:32 +0200 Subject: [PATCH] Add debug informations to the MPlexer unit tests, tracking a failure --- pdns/test-mplexer.cc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pdns/test-mplexer.cc b/pdns/test-mplexer.cc index 8a7412fea..f2ac639af 100644 --- a/pdns/test-mplexer.cc +++ b/pdns/test-mplexer.cc @@ -90,9 +90,9 @@ BOOST_AUTO_TEST_CASE(test_MPlexer) { *calledPtr = true; }; mplexer->addReadFD(pipes[0], - readCB, - &readCBCalled, - &ttd); + readCB, + &readCBCalled, + &ttd); /* not ready for reading yet */ readyFDs.clear(); @@ -124,6 +124,25 @@ BOOST_AUTO_TEST_CASE(test_MPlexer) { /* both should be available */ readyFDs.clear(); mplexer->getAvailableFDs(readyFDs, 0); + if (readyFDs.size() == 1) { + /* something is wrong, we need some debug infos */ + cerr<<"FDMultiPlexer implementation is "<getName()<getWatchedFDCount(false)<<" FDs for read and "<getWatchedFDCount(true)<<" for write"<