tests: don't use DummyClientFace::sentDatas
refs #3383 Change-Id: I7cbe7d147de0b0066ee0ab4c25f2ec707a081f79
This commit is contained in:
1 parent
af909fcc13
commit
c778e814db
5 files changed
+31
-31
No files matched your search
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2014-2015, The University of Memphis,
|
||||
* Copyright (c) 2014-2016, The University of Memphis,
|
||||
* Regents of the University of California,
|
||||
* Arizona Board of Regents.
|
||||
*
|
||||
@@ -59,8 +59,8 @@ BOOST_AUTO_TEST_CASE(AdjacencyLsaPublisherBasic)
|
||||
publisher.publish(publishingPrefix);
|
||||
face->processEvents(ndn::time::milliseconds(1));
|
||||
|
||||
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
|
||||
ndn::Block parser = face->sentDatas[0].getContent();
|
||||
BOOST_REQUIRE_EQUAL(face->sentData.size(), 1);
|
||||
ndn::Block parser = face->sentData[0].getContent();
|
||||
parser.parse();
|
||||
|
||||
// Check RouterB LSA
|
||||
@@ -93,8 +93,8 @@ BOOST_AUTO_TEST_CASE(CoordinateLsaBasic)
|
||||
publisher.publish(publishingPrefix);
|
||||
face->processEvents(ndn::time::milliseconds(1));
|
||||
|
||||
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
|
||||
ndn::Block parser = face->sentDatas[0].getContent();
|
||||
BOOST_REQUIRE_EQUAL(face->sentData.size(), 1);
|
||||
ndn::Block parser = face->sentData[0].getContent();
|
||||
parser.parse();
|
||||
|
||||
// Check RouterC LSA
|
||||
@@ -136,8 +136,8 @@ BOOST_AUTO_TEST_CASE(NameLsaBasic)
|
||||
publisher.publish(publishingPrefix);
|
||||
face->processEvents(ndn::time::milliseconds(1));
|
||||
|
||||
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
|
||||
ndn::Block parser = face->sentDatas[0].getContent();
|
||||
BOOST_REQUIRE_EQUAL(face->sentData.size(), 1);
|
||||
ndn::Block parser = face->sentData[0].getContent();
|
||||
parser.parse();
|
||||
|
||||
// Check RouterB LSA
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2014-2015, The University of Memphis,
|
||||
* Copyright (c) 2014-2016, The University of Memphis,
|
||||
* Regents of the University of California,
|
||||
* Arizona Board of Regents.
|
||||
*
|
||||
@@ -36,8 +36,8 @@ processDatasetInterest(shared_ptr<ndn::util::DummyClientFace> face,
|
||||
{
|
||||
face->processEvents(ndn::time::milliseconds(1));
|
||||
|
||||
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
|
||||
ndn::Block parser(face->sentDatas[0].getContent());
|
||||
BOOST_REQUIRE_EQUAL(face->sentData.size(), 1);
|
||||
ndn::Block parser(face->sentData[0].getContent());
|
||||
parser.parse();
|
||||
|
||||
ndn::Block::element_const_iterator it = parser.elements_begin();
|
||||
@@ -46,18 +46,18 @@ processDatasetInterest(shared_ptr<ndn::util::DummyClientFace> face,
|
||||
|
||||
BOOST_CHECK(it == parser.elements_end());
|
||||
|
||||
face->sentDatas.clear();
|
||||
face->sentData.clear();
|
||||
}
|
||||
|
||||
void
|
||||
checkErrorResponse(shared_ptr<ndn::util::DummyClientFace> face, uint64_t expectedCode)
|
||||
{
|
||||
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
|
||||
BOOST_REQUIRE_EQUAL(face->sentData.size(), 1);
|
||||
|
||||
ndn::nfd::ControlResponse response(face->sentDatas[0].getContent().blockFromValue());
|
||||
ndn::nfd::ControlResponse response(face->sentData[0].getContent().blockFromValue());
|
||||
BOOST_CHECK_EQUAL(response.getCode(), expectedCode);
|
||||
|
||||
face->sentDatas.clear();
|
||||
face->sentData.clear();
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(PublisherTestLsdbDatasetInterestHandler, PublisherFixture)
|
||||
@@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE(InvalidCommand)
|
||||
face->receive(ndn::Interest(ndn::Name(thisRouter).append("malformed")));
|
||||
face->processEvents(ndn::time::milliseconds(1));
|
||||
|
||||
BOOST_CHECK_EQUAL(face->sentDatas.size(), 0);
|
||||
BOOST_CHECK_EQUAL(face->sentData.size(), 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2014-2015, The University of Memphis,
|
||||
* Copyright (c) 2014-2016, The University of Memphis,
|
||||
* Regents of the University of California,
|
||||
* Arizona Board of Regents.
|
||||
*
|
||||
@@ -90,9 +90,9 @@ BOOST_AUTO_TEST_CASE(Basic)
|
||||
publisher.publish(publishingPrefix);
|
||||
face->processEvents(ndn::time::milliseconds(1));
|
||||
|
||||
BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
|
||||
BOOST_REQUIRE_EQUAL(face->sentData.size(), 1);
|
||||
|
||||
ndn::Block parser = face->sentDatas[0].getContent();
|
||||
ndn::Block parser = face->sentData[0].getContent();
|
||||
parser.parse();
|
||||
|
||||
ndn::Block::element_const_iterator it = parser.elements_begin();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2014-2015, Regents of the University of California,
|
||||
* Copyright (c) 2014-2016, Regents of the University of California,
|
||||
* Arizona Board of Regents,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University,
|
||||
@@ -158,8 +158,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(Generate, T, DatasetSizes, SegmentPublisherFixt
|
||||
nSegments == 0)
|
||||
++nSegments;
|
||||
|
||||
BOOST_CHECK_EQUAL(this->m_face->sentDatas.size(), nSegments);
|
||||
for (const ndn::Data& data : this->m_face->sentDatas) {
|
||||
BOOST_CHECK_EQUAL(this->m_face->sentData.size(), nSegments);
|
||||
for (const ndn::Data& data : this->m_face->sentData) {
|
||||
this->validate(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2014-2015, The University of Memphis,
|
||||
* Copyright (c) 2014-2016, The University of Memphis,
|
||||
* Regents of the University of California,
|
||||
* Arizona Board of Regents.
|
||||
*
|
||||
@@ -160,23 +160,23 @@ public:
|
||||
{
|
||||
const ndn::Name& lsaPrefix = nlsr.getConfParameter().getLsaPrefix();
|
||||
|
||||
const auto& it = std::find_if(face->sentDatas.begin(), face->sentDatas.end(),
|
||||
const auto& it = std::find_if(face->sentData.begin(), face->sentData.end(),
|
||||
[lsaPrefix] (const ndn::Data& data) {
|
||||
return lsaPrefix.isPrefixOf(data.getName());
|
||||
});
|
||||
|
||||
return (it != face->sentDatas.end());
|
||||
return (it != face->sentData.end());
|
||||
}
|
||||
|
||||
void
|
||||
checkResponseCode(const Name& commandPrefix, uint64_t expectedCode)
|
||||
{
|
||||
std::vector<Data>::iterator it = std::find_if(face->sentDatas.begin(),
|
||||
face->sentDatas.end(),
|
||||
std::vector<Data>::iterator it = std::find_if(face->sentData.begin(),
|
||||
face->sentData.end(),
|
||||
[commandPrefix] (const Data& data) {
|
||||
return commandPrefix.isPrefixOf(data.getName());
|
||||
});
|
||||
BOOST_REQUIRE(it != face->sentDatas.end());
|
||||
BOOST_REQUIRE(it != face->sentData.end());
|
||||
|
||||
ndn::nfd::ControlResponse response(it->getContent().blockFromValue());
|
||||
BOOST_CHECK_EQUAL(response.getCode(), expectedCode);
|
||||
@@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE(Basic)
|
||||
BOOST_CHECK_EQUAL(namePrefixList.getNameList().front(), parameters.getName());
|
||||
|
||||
BOOST_CHECK(wasRoutingUpdatePublished());
|
||||
face->sentDatas.clear();
|
||||
face->sentData.clear();
|
||||
|
||||
// Withdraw
|
||||
ndn::Name withdrawCommand("/localhost/nlsr/prefix-update/withdraw");
|
||||
@@ -266,12 +266,12 @@ BOOST_AUTO_TEST_CASE(DisabledAndEnabled)
|
||||
face->receive(*advertiseInterest);
|
||||
face->processEvents(ndn::time::milliseconds(1));
|
||||
|
||||
BOOST_REQUIRE(!face->sentDatas.empty());
|
||||
BOOST_REQUIRE(!face->sentData.empty());
|
||||
|
||||
const ndn::MetaInfo& metaInfo = face->sentDatas.front().getMetaInfo();
|
||||
const ndn::MetaInfo& metaInfo = face->sentData.front().getMetaInfo();
|
||||
BOOST_CHECK_EQUAL(metaInfo.getType(), ndn::tlv::ContentType_Nack);
|
||||
|
||||
face->sentDatas.clear();
|
||||
face->sentData.clear();
|
||||
|
||||
// Enable PrefixUpdateProcessor so commands will be processed
|
||||
updateProcessor.enable();
|
||||
|
||||
Reference in new issue
Block a user