tests: sync common testing infrastructure with ndn-cxx and NFD
And upgrade waf to version 2.0.21
Change-Id: Id713e0f3035badd97ca7fc03f76e50085b9a266c
diff --git a/tests/peek/ndnpoke.t.cpp b/tests/peek/ndnpoke.t.cpp
index 09a562c..617b516 100644
--- a/tests/peek/ndnpoke.t.cpp
+++ b/tests/peek/ndnpoke.t.cpp
@@ -26,7 +26,8 @@
#include "tools/peek/ndnpoke/ndnpoke.hpp"
#include "tests/test-common.hpp"
-#include "tests/identity-management-fixture.hpp"
+#include "tests/io-fixture.hpp"
+#include "tests/key-chain-fixture.hpp"
#include <ndn-cxx/util/dummy-client-face.hpp>
@@ -37,7 +38,7 @@
using namespace ndn::tests;
template<bool WANT_PREFIX_REG_REPLY = true>
-class NdnPokeFixture : public IdentityManagementTimeFixture
+class NdnPokeFixture : public IoFixture, public KeyChainFixture
{
protected:
NdnPokeFixture()
@@ -60,8 +61,7 @@
}
protected:
- boost::asio::io_service io;
- ndn::util::DummyClientFace face{io, m_keyChain, {true, WANT_PREFIX_REG_REPLY}};
+ ndn::util::DummyClientFace face{m_io, m_keyChain, {true, WANT_PREFIX_REG_REPLY}};
std::stringstream payload{"Hello, world!\n"};
unique_ptr<NdnPoke> poke;
};
@@ -74,14 +74,14 @@
initialize();
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
// Check for prefix registration
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register");
face.receive(*makeInterest("/poke/test"));
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
@@ -102,16 +102,16 @@
initialize();
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
face.receive(*makeInterest("/poke/test/foo"));
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::UNKNOWN);
BOOST_CHECK_EQUAL(face.sentData.size(), 0);
face.receive(*makeInterest("/poke/test"));
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
@@ -125,10 +125,10 @@
initialize(options);
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
face.receive(*makeInterest("/poke/test"));
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
@@ -146,10 +146,10 @@
initialize(options);
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
face.receive(*makeInterest(options.name));
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
@@ -167,10 +167,10 @@
initialize(options);
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
face.receive(*makeInterest("/poke/test"));
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
@@ -187,7 +187,7 @@
initialize(options);
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::DATA_SENT);
BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
@@ -204,13 +204,13 @@
initialize(options);
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
// Check for prefix registration
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register");
- this->advanceClocks(io, 1_s, 4);
+ this->advanceClocks(1_s, 4);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::TIMEOUT);
BOOST_CHECK_EQUAL(face.sentData.size(), 0);
@@ -225,13 +225,13 @@
initialize();
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
// Check for prefix registration
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
BOOST_CHECK_EQUAL(face.sentInterests.front().getName().getPrefix(4), "/localhost/nfd/rib/register");
- this->advanceClocks(io, 1_s, 10);
+ this->advanceClocks(1_s, 10);
BOOST_CHECK(poke->getResult() == NdnPoke::Result::PREFIX_REG_FAIL);
BOOST_CHECK_EQUAL(face.sentData.size(), 0);
@@ -243,7 +243,7 @@
initialize();
poke->start();
- this->advanceClocks(io, 1_ms, 10);
+ this->advanceClocks(1_ms, 10);
face.receive(*makeInterest("/poke/test"));
BOOST_CHECK_THROW(face.processEvents(), Face::OversizedPacketError);