tests: refactor EthernetFixture
Also, use BOOST_TEST_INFO_SCOPE in a few places.
Change-Id: I113f326207825949ed9d3d22ade0654976d49b76
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 140b1c6..d73dc24 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -60,8 +60,9 @@
RANDOMIZE_COUNTERS = 1 << 3,
};
- /** \brief Adds a face to the FaceTable.
- * \param options bitwise OR'ed AddFaceFlags
+ /**
+ * \brief Adds a face to the FaceTable.
+ * \param flags bitwise OR'ed AddFaceFlags
*/
shared_ptr<Face>
addFace(unsigned int flags = 0)
@@ -169,6 +170,7 @@
std::set<FaceId> faceIds;
for (size_t idx = 0; idx < nEntries; ++idx) {
ndn::nfd::FaceStatus decodedStatus(content.elements()[idx]);
+ BOOST_TEST_INFO_SCOPE(decodedStatus);
BOOST_CHECK(m_faceTable.get(decodedStatus.getFaceId()) != nullptr);
faceIds.insert(decodedStatus.getFaceId());
}
@@ -330,6 +332,7 @@
for (size_t idx = 0; idx < nEntries; ++idx) {
ndn::nfd::ChannelStatus decodedStatus(content.elements()[idx]);
+ BOOST_TEST_INFO_SCOPE(decodedStatus);
BOOST_CHECK(addedChannels.find(decodedStatus.getLocalUri()) != addedChannels.end());
}
}
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 32bbec3..5da697b 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -421,6 +421,7 @@
std::vector<ndn::nfd::FibEntry> receivedRecords, expectedRecords;
for (size_t idx = 0; idx < nEntries; ++idx) {
ndn::nfd::FibEntry decodedEntry(content.elements()[idx]);
+ BOOST_TEST_INFO_SCOPE(decodedEntry);
receivedRecords.push_back(decodedEntry);
actualPrefixes.erase(decodedEntry.getPrefix());
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 6c82d4a..83a0af2 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -71,14 +71,14 @@
loadDefaultPaConfig();
}
- template<typename ...T>
+ template<typename... T>
ndn::PrefixAnnouncement
makeTrustedAnn(T&&... args)
{
return signPrefixAnn(makePrefixAnn(std::forward<T>(args)...), m_keyChain, m_trustedSigner);
}
- template<typename ...T>
+ template<typename... T>
ndn::PrefixAnnouncement
makeUntrustedAnn(T&&... args)
{
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 0b407f6..417500e 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -486,6 +486,7 @@
std::vector<ndn::nfd::RibEntry> receivedRecords, expectedRecords;
for (size_t idx = 0; idx < nEntries; ++idx) {
ndn::nfd::RibEntry decodedEntry(content.elements()[idx]);
+ BOOST_TEST_INFO_SCOPE(decodedEntry);
receivedRecords.push_back(decodedEntry);
actualPrefixes.erase(decodedEntry.getName());
diff --git a/tests/daemon/mgmt/strategy-choice-manager.t.cpp b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
index 71763bb..4a6e3df 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.t.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -218,14 +218,13 @@
for (auto i = dataset.elements_begin(); i != dataset.elements_end(); ++i) {
ndn::nfd::StrategyChoice record(*i);
+ BOOST_TEST_INFO_SCOPE(record);
auto found = expected.find(record.getName());
if (found == expected.end()) {
BOOST_ERROR("record has unexpected namespace " << record.getName());
}
else {
- BOOST_CHECK_MESSAGE(record.getStrategy() == found->second,
- "record for " << record.getName() << " has wrong strategy " << record.getStrategy() <<
- ", should be " << found->second);
+ BOOST_TEST(record.getStrategy() == found->second);
expected.erase(found);
}
}