tests: respect naming conventions and improve nesting of some test suites
Change-Id: I65af858bc6d10197c6ee11111fa9f7c1faa617ef
Refs: #2497
diff --git a/tests/daemon/face/lp-reassembler.t.cpp b/tests/daemon/face/lp-reassembler.t.cpp
index 5b62d4e..9cfa8dd 100644
--- a/tests/daemon/face/lp-reassembler.t.cpp
+++ b/tests/daemon/face/lp-reassembler.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,
@@ -33,11 +33,9 @@
using namespace nfd::tests;
-BOOST_AUTO_TEST_SUITE(Face)
-
class LpReassemblerFixture : public UnitTestTimeFixture
{
-public:
+protected:
LpReassemblerFixture()
{
reassembler.beforeTimeout.connect(
@@ -46,7 +44,7 @@
});
}
-public:
+protected:
LpReassembler reassembler;
std::vector<std::tuple<Transport::EndpointId, size_t>> timeoutHistory;
@@ -58,6 +56,7 @@
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
};
+BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestLpReassembler, LpReassemblerFixture)
BOOST_AUTO_TEST_SUITE(SingleFragment)
@@ -460,7 +459,9 @@
BOOST_AUTO_TEST_SUITE_END() // MultiFragment
-BOOST_AUTO_TEST_CASE(MultiRemoteEndpoints)
+BOOST_AUTO_TEST_SUITE(MultipleRemoteEndpoints)
+
+BOOST_AUTO_TEST_CASE(Normal)
{
ndn::Buffer data1Buffer(data, 5);
ndn::Buffer data2Buffer(data + 5, 5);
@@ -510,6 +511,8 @@
BOOST_CHECK_EQUAL(reassembler.size(), 0);
}
+BOOST_AUTO_TEST_SUITE_END() // MultipleRemoteEndpoints
+
BOOST_AUTO_TEST_SUITE_END() // TestLpReassembler
BOOST_AUTO_TEST_SUITE_END() // Face
diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp
index 75bedf8..f1171e5 100644
--- a/tests/daemon/face/transport.t.cpp
+++ b/tests/daemon/face/transport.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,
@@ -41,15 +41,11 @@
namespace tests {
using namespace nfd::tests;
-namespace ip = boost::asio::ip;
-
-BOOST_AUTO_TEST_SUITE(Face)
-
-using nfd::Face;
+namespace mpl = boost::mpl;
class DummyTransportFixture : public BaseFixture
{
-public:
+protected:
DummyTransportFixture()
: transport(nullptr)
, sentPackets(nullptr)
@@ -68,13 +64,14 @@
this->receivedPackets = &static_cast<DummyReceiveLinkService*>(face->getLinkService())->receivedPackets;
}
-public:
+protected:
unique_ptr<Face> face;
DummyTransport* transport;
std::vector<Transport::Packet>* sentPackets;
std::vector<Transport::Packet>* receivedPackets;
};
+BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestTransport, DummyTransportFixture)
BOOST_AUTO_TEST_CASE(DummyTransportStaticProperties)
@@ -83,10 +80,6 @@
checkStaticPropertiesInitialized(*transport);
}
-BOOST_AUTO_TEST_SUITE(StateTransition)
-
-namespace mpl = boost::mpl;
-
/** \brief a macro to declare a TransportState as a integral constant
*/
#define TRANSPORT_STATE_C(X) mpl::int_<static_cast<int>(TransportState::X)>
@@ -198,8 +191,6 @@
}
}
-BOOST_AUTO_TEST_SUITE_END() // StateTransition
-
BOOST_AUTO_TEST_CASE(NoExpirationTime)
{
initialize();