tests: respect naming conventions and improve nesting of some test suites
Change-Id: I65af858bc6d10197c6ee11111fa9f7c1faa617ef
Refs: #2497
diff --git a/tests/rib/auto-prefix-propagator.t.cpp b/tests/rib/auto-prefix-propagator.t.cpp
index ebdf94b..5077bab 100644
--- a/tests/rib/auto-prefix-propagator.t.cpp
+++ b/tests/rib/auto-prefix-propagator.t.cpp
@@ -25,8 +25,8 @@
#include "rib/auto-prefix-propagator.hpp"
-#include "tests/test-common.hpp"
#include "tests/identity-management-fixture.hpp"
+
#include <ndn-cxx/util/dummy-client-face.hpp>
namespace nfd {
@@ -35,13 +35,10 @@
using namespace nfd::tests;
-NFD_LOG_INIT("AutoPrefixPropagatorTest");
-
const Name TEST_LINK_LOCAL_NFD_PREFIX("/localhop/nfd");
const time::milliseconds TEST_PREFIX_PROPAGATION_TIMEOUT(1000);
-class AutoPrefixPropagatorFixture : public IdentityManagementFixture
- , public UnitTestTimeFixture
+class AutoPrefixPropagatorFixture : public IdentityManagementTimeFixture
{
public:
AutoPrefixPropagatorFixture()
@@ -66,7 +63,7 @@
insertEntryToRib(const Name& name, const uint64_t& faceId = 0)
{
if (m_rib.find(name) != m_rib.end()) {
- NFD_LOG_INFO("RIB entry already exists: " << name);
+ BOOST_TEST_MESSAGE("RIB entry already exists: " + name.toUri());
return false;
}
@@ -82,7 +79,7 @@
eraseEntryFromRib(const Name& name)
{
if (m_rib.find(name) == m_rib.end()) {
- NFD_LOG_INFO("RIB entry does not exist: " << name);
+ BOOST_TEST_MESSAGE("RIB entry does not exist: " + name.toUri());
return false;
}
@@ -215,8 +212,6 @@
return os;
}
-BOOST_AUTO_TEST_SUITE(Rib)
-
BOOST_FIXTURE_TEST_SUITE(TestAutoPrefixPropagator, AutoPrefixPropagatorFixture)
BOOST_AUTO_TEST_CASE(EnableDisable)
@@ -277,8 +272,6 @@
BOOST_CHECK_EQUAL(m_propagator.m_maxRetryWait, time::seconds(55));
}
-BOOST_AUTO_TEST_SUITE(Helpers)
-
BOOST_AUTO_TEST_CASE(GetPrefixPropagationParameters)
{
BOOST_REQUIRE(addIdentity("/test/A"));
@@ -365,8 +358,6 @@
BOOST_CHECK(m_entries.find("test/B/C") == m_entries.end());
}
-BOOST_AUTO_TEST_SUITE_END() // Helpers
-
BOOST_AUTO_TEST_SUITE(PropagateRevokeSemantics)
BOOST_AUTO_TEST_CASE(Basic)
@@ -684,7 +675,6 @@
BOOST_AUTO_TEST_SUITE_END() // PropagatedEntryStateChanges
BOOST_AUTO_TEST_SUITE_END() // TestAutoPrefixPropagator
-BOOST_AUTO_TEST_SUITE_END() // Rib
} // namespace tests
} // namespace rib
diff --git a/tests/rib/fib-updates-common.hpp b/tests/rib/fib-updates-common.hpp
index 1f293c6..df41c3e 100644
--- a/tests/rib/fib-updates-common.hpp
+++ b/tests/rib/fib-updates-common.hpp
@@ -33,8 +33,6 @@
namespace rib {
namespace tests {
-using namespace nfd::tests;
-
inline bool
compareNameFaceIdCostAction(const FibUpdate& lhs, const FibUpdate& rhs)
{
@@ -58,7 +56,7 @@
return false;
}
-class FibUpdatesFixture : public IdentityManagementFixture
+class FibUpdatesFixture : public nfd::tests::IdentityManagementFixture
{
public:
FibUpdatesFixture()
@@ -168,9 +166,9 @@
public:
ndn::util::DummyClientFace face;
ndn::nfd::Controller controller;
- rib::FibUpdater fibUpdater;
- rib::Rib rib;
+ Rib rib;
+ FibUpdater fibUpdater;
FibUpdater::FibUpdateList fibUpdates;
};
diff --git a/tests/rib/propagated-entry.t.cpp b/tests/rib/propagated-entry.t.cpp
index 8c8b1d2..fe43677 100644
--- a/tests/rib/propagated-entry.t.cpp
+++ b/tests/rib/propagated-entry.t.cpp
@@ -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,
@@ -24,14 +24,13 @@
*/
#include "rib/propagated-entry.hpp"
+
#include "tests/test-common.hpp"
namespace nfd {
namespace rib {
namespace tests {
-BOOST_AUTO_TEST_SUITE(Rib)
-
BOOST_FIXTURE_TEST_SUITE(TestPropagatedEntry, nfd::tests::BaseFixture)
BOOST_AUTO_TEST_CASE(Identity)
@@ -81,7 +80,6 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestPropagatedEntry
-BOOST_AUTO_TEST_SUITE_END() // Rib
} // namespace tests
} // namespace rib
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index 450016d..dfbeb29 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -265,7 +265,6 @@
return os;
}
-BOOST_AUTO_TEST_SUITE(Rib)
BOOST_AUTO_TEST_SUITE(TestRibManager)
class AddTopPrefixFixture : public RibManagerFixture
@@ -611,7 +610,6 @@
BOOST_AUTO_TEST_SUITE_END() // FaceMonitor
BOOST_AUTO_TEST_SUITE_END() // TestRibManager
-BOOST_AUTO_TEST_SUITE_END() // Rib
} // namespace tests
} // namespace rib
diff --git a/tests/rib/rib-update.cpp b/tests/rib/rib-update.t.cpp
similarity index 93%
rename from tests/rib/rib-update.cpp
rename to tests/rib/rib-update.t.cpp
index c7b1c6c..f40730f 100644
--- a/tests/rib/rib-update.cpp
+++ b/tests/rib/rib-update.t.cpp
@@ -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,
@@ -23,17 +23,17 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "tests/test-common.hpp"
-#include "rib-test-common.hpp"
-
#include "rib/rib-update.hpp"
#include "rib/rib-update-batch.hpp"
+#include "rib-test-common.hpp"
+#include "tests/test-common.hpp"
+
namespace nfd {
namespace rib {
namespace tests {
-BOOST_FIXTURE_TEST_SUITE(RibRibUpdate, nfd::tests::BaseFixture)
+BOOST_FIXTURE_TEST_SUITE(TestRibUpdate, nfd::tests::BaseFixture)
BOOST_AUTO_TEST_CASE(BatchBasic)
{
@@ -77,8 +77,7 @@
BOOST_CHECK(it == batch.end());
}
-
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestRibUpdate
} // namespace tests
} // namespace rib
diff --git a/tests/rib/rib.t.cpp b/tests/rib/rib.t.cpp
index 91445c4..eed09f9 100644
--- a/tests/rib/rib.t.cpp
+++ b/tests/rib/rib.t.cpp
@@ -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,
@@ -24,10 +24,11 @@
*/
#include "rib/rib.hpp"
-#include <ndn-cxx/encoding/tlv-nfd.hpp>
#include "tests/test-common.hpp"
+#include <ndn-cxx/encoding/tlv-nfd.hpp>
+
namespace nfd {
namespace rib {
namespace tests {
@@ -294,7 +295,7 @@
BOOST_CHECK_EQUAL(rib.size(), 1);
}
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestRib
} // namespace tests
} // namespace rib