Refactor and modernize namespace declarations
Move all unit tests to namespace nfd::tests
Delete unused header core/algorithm.hpp
Change-Id: I5591f0c5f3bb5db67f8b45fae95471f8a555ca68
diff --git a/core/algorithm.hpp b/core/algorithm.hpp
deleted file mode 100644
index 5dc9dbb..0000000
--- a/core/algorithm.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_CORE_ALGORITHM_HPP
-#define NFD_CORE_ALGORITHM_HPP
-
-#include "common.hpp"
-#include <boost/concept/requires.hpp>
-
-namespace nfd {
-
-/** \brief finds the last element satisfying a predicate
- * \tparam It BidirectionalIterator
- * \tparam Pred UnaryPredicate
- *
- * \return Iterator to the last element satisfying the condition,
- * or \p last if no such element is found.
- *
- * Complexity: at most \p last-first invocations of \p p
- */
-template<typename It, typename Pred>
-BOOST_CONCEPT_REQUIRES(
- ((boost::BidirectionalIterator<It>))
- ((boost::UnaryPredicate<Pred, typename std::iterator_traits<It>::value_type>)),
- (It)
-)
-find_last_if(It first, It last, Pred p)
-{
- std::reverse_iterator<It> firstR(first), lastR(last);
- auto found = std::find_if(lastR, firstR, p);
- return found == firstR ? last : std::prev(found.base());
-}
-
-} // namespace nfd
-
-#endif // NFD_CORE_ALGORITHM_HPP
diff --git a/daemon/face/channel.cpp b/daemon/face/channel.cpp
index dd3b118..fa25405 100644
--- a/daemon/face/channel.cpp
+++ b/daemon/face/channel.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "channel.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
Channel::~Channel() = default;
@@ -53,5 +52,4 @@
});
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/channel.hpp b/daemon/face/channel.hpp
index f486feb..8d624fb 100644
--- a/daemon/face/channel.hpp
+++ b/daemon/face/channel.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "channel-log.hpp"
#include "face-common.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Represents a channel that listens on a local endpoint.
* \sa FaceSystem
@@ -99,7 +98,6 @@
void
connectFaceClosedSignal(Face& face, std::function<void()> f);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_CHANNEL_HPP
diff --git a/daemon/face/datagram-transport.hpp b/daemon/face/datagram-transport.hpp
index 950a49f..e053af2 100644
--- a/daemon/face/datagram-transport.hpp
+++ b/daemon/face/datagram-transport.hpp
@@ -32,8 +32,7 @@
#include <array>
-namespace nfd {
-namespace face {
+namespace nfd::face {
struct Unicast {};
struct Multicast {};
@@ -262,7 +261,6 @@
return 0;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_DATAGRAM_TRANSPORT_HPP
diff --git a/daemon/face/ethernet-channel.cpp b/daemon/face/ethernet-channel.cpp
index 2509140..4d0adc3 100644
--- a/daemon/face/ethernet-channel.cpp
+++ b/daemon/face/ethernet-channel.cpp
@@ -33,8 +33,7 @@
#include <boost/range/adaptor/map.hpp>
#include <pcap/pcap.h>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetChannel);
@@ -234,5 +233,4 @@
m_pcap.setPacketFilter(filter.data());
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-channel.hpp b/daemon/face/ethernet-channel.hpp
index 510b7aa..2096585 100644
--- a/daemon/face/ethernet-channel.hpp
+++ b/daemon/face/ethernet-channel.hpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing Ethernet-based channel to create faces
@@ -137,7 +136,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 4fea598..59f0c5c 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -30,8 +30,7 @@
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetFactory);
NFD_REGISTER_PROTOCOL_FACTORY(EthernetFactory);
@@ -377,5 +376,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-factory.hpp b/daemon/face/ethernet-factory.hpp
index 578a901..1d63397 100644
--- a/daemon/face/ethernet-factory.hpp
+++ b/daemon/face/ethernet-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "ethernet-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for Ethernet
*/
@@ -128,7 +127,6 @@
signal::ScopedConnection m_netifAddConn;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
diff --git a/daemon/face/ethernet-protocol.cpp b/daemon/face/ethernet-protocol.cpp
index 0a0ebe1..24478f8 100644
--- a/daemon/face/ethernet-protocol.cpp
+++ b/daemon/face/ethernet-protocol.cpp
@@ -27,8 +27,7 @@
#include <boost/endian/conversion.hpp>
-namespace nfd {
-namespace ethernet {
+namespace nfd::ethernet {
std::tuple<const ether_header*, std::string>
checkFrameHeader(span<const uint8_t> packet, const Address& localAddr, const Address& destAddr)
@@ -57,5 +56,4 @@
return {eh, ""};
}
-} // namespace ethernet
-} // namespace nfd
+} // namespace nfd::ethernet
diff --git a/daemon/face/ethernet-protocol.hpp b/daemon/face/ethernet-protocol.hpp
index c9b9bdc..50b4ac5 100644
--- a/daemon/face/ethernet-protocol.hpp
+++ b/daemon/face/ethernet-protocol.hpp
@@ -31,15 +31,13 @@
#include <ndn-cxx/net/ethernet.hpp>
#include <net/ethernet.h>
-namespace nfd {
-namespace ethernet {
+namespace nfd::ethernet {
using namespace ndn::ethernet;
std::tuple<const ether_header*, std::string>
checkFrameHeader(span<const uint8_t> packet, const Address& localAddr, const Address& destAddr);
-} // namespace ethernet
-} // namespace nfd
+} // namespace nfd::ethernet
#endif // NFD_DAEMON_FACE_ETHERNET_PROTOCOL_HPP
diff --git a/daemon/face/ethernet-transport.cpp b/daemon/face/ethernet-transport.cpp
index 568064b..53de0b7 100644
--- a/daemon/face/ethernet-transport.cpp
+++ b/daemon/face/ethernet-transport.cpp
@@ -33,8 +33,7 @@
#include <boost/endian/conversion.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetTransport);
@@ -230,5 +229,4 @@
doClose();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-transport.hpp b/daemon/face/ethernet-transport.hpp
index 1379899..951d56a 100644
--- a/daemon/face/ethernet-transport.hpp
+++ b/daemon/face/ethernet-transport.hpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief Base class for Ethernet-based Transports
@@ -113,7 +112,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/face-counters.cpp b/daemon/face/face-counters.cpp
index 275783f..ec8572e 100644
--- a/daemon/face/face-counters.cpp
+++ b/daemon/face/face-counters.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "face-counters.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
FaceCounters::FaceCounters(const LinkService::Counters& linkServiceCounters,
const Transport::Counters& transportCounters)
@@ -46,5 +45,4 @@
{
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/face-counters.hpp b/daemon/face/face-counters.hpp
index bfe08bd..7d7cdc3 100644
--- a/daemon/face/face-counters.hpp
+++ b/daemon/face/face-counters.hpp
@@ -29,8 +29,7 @@
#include "link-service.hpp"
#include "transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief gives access to counters provided by Face
*
@@ -94,7 +93,6 @@
const Transport::Counters& m_transportCounters;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_FACE_COUNTERS_HPP
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index f86ea25..7ab9879 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -29,8 +29,7 @@
#include "common/global.hpp"
#include "fw/face-table.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(FaceSystem);
@@ -163,5 +162,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
index cc606d0..7b15dc5 100644
--- a/daemon/face/face.cpp
+++ b/daemon/face/face.cpp
@@ -25,8 +25,7 @@
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
Face::Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport)
: afterReceiveInterest(service->afterReceiveInterest)
@@ -51,5 +50,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index a21aec2..ed19eec 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -30,8 +30,7 @@
#include <cmath>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(GenericLinkService);
@@ -507,5 +506,4 @@
this->receiveNack(nack, endpointId);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index 0f589a3..be216a7 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -31,8 +31,7 @@
#include "lp-reassembler.hpp"
#include "lp-reliability.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by GenericLinkService
* \note The type name 'GenericLinkServiceCounters' is implementation detail.
@@ -325,7 +324,6 @@
return *this;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
diff --git a/daemon/face/internal-face.cpp b/daemon/face/internal-face.cpp
index a7aa7fb..e899c5a 100644
--- a/daemon/face/internal-face.cpp
+++ b/daemon/face/internal-face.cpp
@@ -28,8 +28,7 @@
#include "internal-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
makeInternalFace(ndn::KeyChain& clientKeyChain)
@@ -49,5 +48,4 @@
return {face, clientFace};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/internal-face.hpp b/daemon/face/internal-face.hpp
index 94e1960..6b27cfa 100644
--- a/daemon/face/internal-face.hpp
+++ b/daemon/face/internal-face.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,10 @@
#define NFD_DAEMON_FACE_INTERNAL_FACE_HPP
#include "face.hpp"
+
#include <ndn-cxx/face.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief make a pair of forwarder-side face and client-side face
* that are connected with each other
@@ -45,7 +45,6 @@
std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
makeInternalFace(ndn::KeyChain& clientKeyChain);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_INTERNAL_FACE_HPP
diff --git a/daemon/face/internal-transport.cpp b/daemon/face/internal-transport.cpp
index 8f9da71..2eeab51 100644
--- a/daemon/face/internal-transport.cpp
+++ b/daemon/face/internal-transport.cpp
@@ -26,8 +26,7 @@
#include "internal-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT(InternalForwarderTransport, InternalForwarderTransport);
NFD_LOG_MEMBER_INIT(InternalClientTransport, InternalClientTransport);
@@ -123,5 +122,4 @@
m_forwarder->receivePacket(wire);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/internal-transport.hpp b/daemon/face/internal-transport.hpp
index d729ecd..886af5c 100644
--- a/daemon/face/internal-transport.hpp
+++ b/daemon/face/internal-transport.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/transport/transport.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Abstracts a transport that can be paired with another.
*/
@@ -125,7 +124,6 @@
signal::ScopedConnection m_fwTransportStateConn;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
diff --git a/daemon/face/link-service.cpp b/daemon/face/link-service.cpp
index 6527dbd..d7233d0 100644
--- a/daemon/face/link-service.cpp
+++ b/daemon/face/link-service.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "link-service.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LinkService);
@@ -135,5 +134,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/link-service.hpp b/daemon/face/link-service.hpp
index e62c1a3..92645f4 100644
--- a/daemon/face/link-service.hpp
+++ b/daemon/face/link-service.hpp
@@ -30,8 +30,7 @@
#include "transport.hpp"
#include "common/counter.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by LinkService
* \note The type name 'LinkServiceCounters' is implementation detail.
@@ -258,7 +257,6 @@
return os << FaceLogHelper<LinkService>(flh.obj);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LINK_SERVICE_HPP
diff --git a/daemon/face/lp-fragmenter.cpp b/daemon/face/lp-fragmenter.cpp
index 6b1755a..0243a48 100644
--- a/daemon/face/lp-fragmenter.cpp
+++ b/daemon/face/lp-fragmenter.cpp
@@ -28,8 +28,7 @@
#include <ndn-cxx/encoding/tlv.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpFragmenter);
@@ -153,5 +152,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-fragmenter.hpp b/daemon/face/lp-fragmenter.hpp
index d98d752..8d24124 100644
--- a/daemon/face/lp-fragmenter.hpp
+++ b/daemon/face/lp-fragmenter.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/packet.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief fragments network-layer packets into NDNLPv2 link-layer packets
* \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
@@ -80,7 +79,6 @@
std::ostream&
operator<<(std::ostream& os, const FaceLogHelper<LpFragmenter>& flh);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_FRAGMENTER_HPP
diff --git a/daemon/face/lp-reassembler.cpp b/daemon/face/lp-reassembler.cpp
index a4b255b..6c27d80 100644
--- a/daemon/face/lp-reassembler.cpp
+++ b/daemon/face/lp-reassembler.cpp
@@ -29,8 +29,7 @@
#include <numeric>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpReassembler);
@@ -161,5 +160,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-reassembler.hpp b/daemon/face/lp-reassembler.hpp
index 59db89b..8009c67 100644
--- a/daemon/face/lp-reassembler.hpp
+++ b/daemon/face/lp-reassembler.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/packet.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Reassembles fragmented network-layer packets
@@ -149,7 +148,6 @@
return m_partialPackets.size();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_REASSEMBLER_HPP
diff --git a/daemon/face/lp-reliability.cpp b/daemon/face/lp-reliability.cpp
index b287bc3..a3d2596 100644
--- a/daemon/face/lp-reliability.cpp
+++ b/daemon/face/lp-reliability.cpp
@@ -28,8 +28,7 @@
#include "transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpReliability);
@@ -426,5 +425,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-reliability.hpp b/daemon/face/lp-reliability.hpp
index c83b0bc..17b2e44 100644
--- a/daemon/face/lp-reliability.hpp
+++ b/daemon/face/lp-reliability.hpp
@@ -34,8 +34,7 @@
#include <queue>
-namespace nfd {
-namespace face {
+namespace nfd::face {
class GenericLinkService;
@@ -221,7 +220,6 @@
std::ostream&
operator<<(std::ostream& os, const FaceLogHelper<LpReliability>& flh);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_RELIABILITY_HPP
diff --git a/daemon/face/multicast-ethernet-transport.cpp b/daemon/face/multicast-ethernet-transport.cpp
index 5d34846..2068012 100644
--- a/daemon/face/multicast-ethernet-transport.cpp
+++ b/daemon/face/multicast-ethernet-transport.cpp
@@ -43,8 +43,7 @@
#endif
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(MulticastEthernetTransport);
@@ -146,5 +145,4 @@
NDN_THROW(Error("Failed to join multicast group"));
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/multicast-ethernet-transport.hpp b/daemon/face/multicast-ethernet-transport.hpp
index 8c2ce91..27c195c 100644
--- a/daemon/face/multicast-ethernet-transport.hpp
+++ b/daemon/face/multicast-ethernet-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "ethernet-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief A multicast Transport that uses raw Ethernet II frames
@@ -57,7 +56,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_MULTICAST_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index ac66f36..bb373fd 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,8 +37,7 @@
#include <sys/socket.h> // for setsockopt()
#endif // __linux__
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>), MulticastUdpTransport);
@@ -207,5 +206,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/multicast-udp-transport.hpp b/daemon/face/multicast-udp-transport.hpp
index 3e17dc9..b881e81 100644
--- a/daemon/face/multicast-udp-transport.hpp
+++ b/daemon/face/multicast-udp-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>));
@@ -94,7 +93,6 @@
protocol::socket m_sendSocket;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
diff --git a/daemon/face/netdev-bound.cpp b/daemon/face/netdev-bound.cpp
index b22bf62..3decef8 100644
--- a/daemon/face/netdev-bound.cpp
+++ b/daemon/face/netdev-bound.cpp
@@ -27,8 +27,7 @@
#include "face-system.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(NetdevBound);
@@ -141,5 +140,4 @@
return rule;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/netdev-bound.hpp b/daemon/face/netdev-bound.hpp
index be4a528..7328342 100644
--- a/daemon/face/netdev-bound.hpp
+++ b/daemon/face/netdev-bound.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "protocol-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
class FaceSystem;
@@ -82,7 +81,6 @@
std::map<Key, shared_ptr<Face>> m_faces;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NETDEV_BOUND_HPP
diff --git a/daemon/face/network-predicate.cpp b/daemon/face/network-predicate.cpp
index 07de63c..a13d886 100644
--- a/daemon/face/network-predicate.cpp
+++ b/daemon/face/network-predicate.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include <fnmatch.h>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NetworkPredicateBase::NetworkPredicateBase()
{
@@ -227,5 +226,4 @@
[&address] (const auto& rule) { return doesAddressMatchRule(address, rule); });
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/network-predicate.hpp b/daemon/face/network-predicate.hpp
index 7f77486..2ea79d6 100644
--- a/daemon/face/network-predicate.hpp
+++ b/daemon/face/network-predicate.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
class NetworkPredicateBase
{
@@ -130,7 +129,6 @@
isRuleValid(const std::string& key, const std::string& value) final;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NETWORK_PREDICATE_HPP
diff --git a/daemon/face/null-face.cpp b/daemon/face/null-face.cpp
index 77178c6..b96db7c 100644
--- a/daemon/face/null-face.cpp
+++ b/daemon/face/null-face.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include "null-link-service.hpp"
#include "null-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
shared_ptr<Face>
makeNullFace(const FaceUri& uri)
@@ -39,5 +38,4 @@
make_unique<NullTransport>(uri, uri, ndn::nfd::FACE_SCOPE_LOCAL));
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/null-face.hpp b/daemon/face/null-face.hpp
index a07b26c..b19bba6 100644
--- a/daemon/face/null-face.hpp
+++ b/daemon/face/null-face.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,15 +28,14 @@
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
-/** \return a Face that has no underlying transport and drops every packet
+/**
+ * \brief Returns a Face that has no underlying transport and drops every packet.
*/
shared_ptr<Face>
makeNullFace(const FaceUri& uri = FaceUri("null://"));
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_FACE_HPP
diff --git a/daemon/face/null-link-service.hpp b/daemon/face/null-link-service.hpp
index 2ae26ab..7ef2933 100644
--- a/daemon/face/null-link-service.hpp
+++ b/daemon/face/null-link-service.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "link-service.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief A LinkService that drops every packet.
*/
@@ -57,7 +56,6 @@
}
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_LINK_SERVICE_HPP
diff --git a/daemon/face/null-transport.cpp b/daemon/face/null-transport.cpp
index 912bf25..997238f 100644
--- a/daemon/face/null-transport.cpp
+++ b/daemon/face/null-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "null-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(NullTransport);
@@ -43,5 +42,4 @@
NFD_LOG_FACE_DEBUG("Creating transport");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/null-transport.hpp b/daemon/face/null-transport.hpp
index 1c81676..eea1559 100644
--- a/daemon/face/null-transport.hpp
+++ b/daemon/face/null-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief A Transport that drops every packet.
*/
@@ -56,7 +55,6 @@
}
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_TRANSPORT_HPP
diff --git a/daemon/face/pcap-helper.cpp b/daemon/face/pcap-helper.cpp
index d481ac5..054eda2 100644
--- a/daemon/face/pcap-helper.cpp
+++ b/daemon/face/pcap-helper.cpp
@@ -35,8 +35,7 @@
#define PCAP_NETMASK_UNKNOWN 0xffffffff
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
PcapHelper::PcapHelper(const std::string& interfaceName)
: m_pcap(nullptr)
@@ -143,5 +142,4 @@
return {{packet, header->caplen}, ""};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/pcap-helper.hpp b/daemon/face/pcap-helper.hpp
index 30a8deb..41bf066 100644
--- a/daemon/face/pcap-helper.hpp
+++ b/daemon/face/pcap-helper.hpp
@@ -36,8 +36,7 @@
struct pcap;
typedef pcap pcap_t;
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief Helper class for dealing with libpcap handles.
@@ -139,7 +138,6 @@
pcap_t* m_pcap;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_PCAP_HELPER_HPP
diff --git a/daemon/face/protocol-factory.cpp b/daemon/face/protocol-factory.cpp
index 5acb18f..1d70fda 100644
--- a/daemon/face/protocol-factory.cpp
+++ b/daemon/face/protocol-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
ProtocolFactory::Registry&
ProtocolFactory::getRegistry()
@@ -129,5 +128,4 @@
return {};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/protocol-factory.hpp b/daemon/face/protocol-factory.hpp
index fcc0418..4d02d15 100644
--- a/daemon/face/protocol-factory.hpp
+++ b/daemon/face/protocol-factory.hpp
@@ -33,8 +33,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Parameters to ProtocolFactory constructor
*
@@ -248,8 +247,7 @@
shared_ptr<ndn::net::NetworkMonitor> netmon;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
/** \brief Registers a protocol factory
*
diff --git a/daemon/face/socket-utils.cpp b/daemon/face/socket-utils.cpp
index 5b38e40..8e3c5f1 100644
--- a/daemon/face/socket-utils.cpp
+++ b/daemon/face/socket-utils.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <sys/socket.h>
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
ssize_t
getTxQueueLength(int fd)
@@ -53,5 +52,4 @@
return queueLength;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/socket-utils.hpp b/daemon/face/socket-utils.hpp
index 3929d8a..9efb389 100644
--- a/daemon/face/socket-utils.hpp
+++ b/daemon/face/socket-utils.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief obtain send queue length from a specified system socket
* \param fd file descriptor of the socket
@@ -42,7 +41,6 @@
ssize_t
getTxQueueLength(int fd);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_SOCKET_UTILS_HPP
diff --git a/daemon/face/stream-transport.hpp b/daemon/face/stream-transport.hpp
index c4ae849..ec33b26 100644
--- a/daemon/face/stream-transport.hpp
+++ b/daemon/face/stream-transport.hpp
@@ -32,8 +32,7 @@
#include <queue>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Implements Transport for stream-based protocols.
*
@@ -333,7 +332,6 @@
return m_sendQueueBytes;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_STREAM_TRANSPORT_HPP
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 2dd454d..be029d0 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -29,8 +29,7 @@
#include "tcp-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(TcpChannel);
@@ -228,5 +227,4 @@
onConnectFailed(504, "Connection timed out");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp
index 19c714c..7193851 100644
--- a/daemon/face/tcp-channel.hpp
+++ b/daemon/face/tcp-channel.hpp
@@ -28,13 +28,11 @@
#include "channel.hpp"
-namespace nfd {
-
-namespace tcp {
+namespace nfd::tcp {
using Endpoint = boost::asio::ip::tcp::endpoint;
-} // namespace tcp
+} // namespace nfd::tcp
-namespace face {
+namespace nfd::face {
using DetermineFaceScopeFromAddress = std::function<ndn::nfd::FaceScope(const boost::asio::ip::address& local,
const boost::asio::ip::address& remote)>;
@@ -133,7 +131,6 @@
DetermineFaceScopeFromAddress m_determineFaceScope;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_CHANNEL_HPP
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 89e34d5..8ff04cc 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "tcp-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
@@ -223,5 +222,4 @@
return ndn::nfd::FACE_SCOPE_NON_LOCAL;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 212acbb..87ffae8 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "tcp-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for TCP over IPv4 and IPv6
*/
@@ -83,7 +82,6 @@
IpAddressPredicate m_local;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
diff --git a/daemon/face/tcp-transport.cpp b/daemon/face/tcp-transport.cpp
index 466e2c6..0332c2f 100644
--- a/daemon/face/tcp-transport.cpp
+++ b/daemon/face/tcp-transport.cpp
@@ -31,8 +31,7 @@
#include <sys/ioctl.h>
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>, TcpTransport);
@@ -192,5 +191,4 @@
StreamTransport::doClose();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-transport.hpp b/daemon/face/tcp-transport.hpp
index 950d850..595e574 100644
--- a/daemon/face/tcp-transport.hpp
+++ b/daemon/face/tcp-transport.hpp
@@ -28,8 +28,7 @@
#include "stream-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>);
@@ -99,7 +98,6 @@
time::milliseconds m_nextReconnectWait;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
diff --git a/daemon/face/transport.cpp b/daemon/face/transport.cpp
index 467843e..44babbb 100644
--- a/daemon/face/transport.cpp
+++ b/daemon/face/transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "transport.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(Transport);
@@ -235,5 +234,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/transport.hpp b/daemon/face/transport.hpp
index 2725596..ed91cbc 100644
--- a/daemon/face/transport.hpp
+++ b/daemon/face/transport.hpp
@@ -29,8 +29,7 @@
#include "face-common.hpp"
#include "common/counter.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Indicates the state of a transport.
*/
@@ -481,7 +480,6 @@
return os << FaceLogHelper<Transport>(flh.obj);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TRANSPORT_HPP
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
index 8804f06..4e91045 100644
--- a/daemon/face/udp-channel.cpp
+++ b/daemon/face/udp-channel.cpp
@@ -29,8 +29,7 @@
#include "unicast-udp-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UdpChannel);
@@ -197,5 +196,4 @@
return {true, face};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/udp-channel.hpp b/daemon/face/udp-channel.hpp
index 25e735a..f4f53da 100644
--- a/daemon/face/udp-channel.hpp
+++ b/daemon/face/udp-channel.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include <array>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing UDP-based channel to create faces
@@ -117,7 +116,6 @@
bool m_wantCongestionMarking;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 9f43ad1..4feec76 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -31,8 +31,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
namespace net = ndn::net;
@@ -477,5 +476,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/udp-factory.hpp b/daemon/face/udp-factory.hpp
index 28dbfaa..475621d 100644
--- a/daemon/face/udp-factory.hpp
+++ b/daemon/face/udp-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "udp-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for UDP over IPv4 and IPv6
*/
@@ -145,7 +144,6 @@
std::map<int, NetifConns> m_netifConns; // ifindex => signal connections
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UDP_FACTORY_HPP
diff --git a/daemon/face/udp-protocol.cpp b/daemon/face/udp-protocol.cpp
index 0d842bc..bfddd43 100644
--- a/daemon/face/udp-protocol.cpp
+++ b/daemon/face/udp-protocol.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "udp-protocol.hpp"
-namespace nfd {
-namespace udp {
+namespace nfd::udp {
ssize_t
computeMtu(const Endpoint& localEndpoint)
@@ -43,5 +42,4 @@
return mtu;
}
-} // namespace udp
-} // namespace nfd
+} // namespace nfd::udp
diff --git a/daemon/face/udp-protocol.hpp b/daemon/face/udp-protocol.hpp
index 85a6a5f..ebd3dad 100644
--- a/daemon/face/udp-protocol.hpp
+++ b/daemon/face/udp-protocol.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace udp {
+namespace nfd::udp {
typedef boost::asio::ip::udp::endpoint Endpoint;
@@ -54,7 +53,6 @@
return {boost::asio::ip::address_v6::from_string("FF02::1234"), 56363};
}
-} // namespace udp
-} // namespace nfd
+} // namespace nfd::udp
#endif // NFD_DAEMON_FACE_UDP_PROTOCOL_HPP
diff --git a/daemon/face/unicast-ethernet-transport.cpp b/daemon/face/unicast-ethernet-transport.cpp
index 853ca55..3da0681 100644
--- a/daemon/face/unicast-ethernet-transport.cpp
+++ b/daemon/face/unicast-ethernet-transport.cpp
@@ -28,8 +28,7 @@
#include <cstdio> // for snprintf()
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnicastEthernetTransport);
@@ -100,5 +99,4 @@
setExpirationTime(time::steady_clock::now() + m_idleTimeout);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unicast-ethernet-transport.hpp b/daemon/face/unicast-ethernet-transport.hpp
index 49c9d48..8078d44 100644
--- a/daemon/face/unicast-ethernet-transport.hpp
+++ b/daemon/face/unicast-ethernet-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "ethernet-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief A unicast Transport that uses raw Ethernet II frames
@@ -61,7 +60,6 @@
scheduler::ScopedEventId m_closeIfIdleEvent;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNICAST_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/unicast-udp-transport.cpp b/daemon/face/unicast-udp-transport.cpp
index 140f691..e0a0526 100644
--- a/daemon/face/unicast-udp-transport.cpp
+++ b/daemon/face/unicast-udp-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,8 +34,7 @@
#include <sys/socket.h> // for setsockopt()
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>), UnicastUdpTransport);
@@ -115,5 +114,4 @@
setExpirationTime(time::steady_clock::now() + m_idleTimeout);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unicast-udp-transport.hpp b/daemon/face/unicast-udp-transport.hpp
index 991d561..7c96fef 100644
--- a/daemon/face/unicast-udp-transport.hpp
+++ b/daemon/face/unicast-udp-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "datagram-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>));
@@ -59,7 +58,6 @@
scheduler::ScopedEventId m_closeIfIdleEvent;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNICAST_UDP_TRANSPORT_HPP
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index 7fb828b..2526d45 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -32,8 +32,7 @@
#include <boost/filesystem.hpp>
#include <sys/stat.h> // for chmod()
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnixStreamChannel);
@@ -148,5 +147,4 @@
accept(onFaceCreated, onAcceptFailed);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-channel.hpp b/daemon/face/unix-stream-channel.hpp
index c65f784..0c2eb2e 100644
--- a/daemon/face/unix-stream-channel.hpp
+++ b/daemon/face/unix-stream-channel.hpp
@@ -28,13 +28,11 @@
#include "channel.hpp"
-namespace nfd {
-
-namespace unix_stream {
+namespace nfd::unix_stream {
using Endpoint = boost::asio::local::stream_protocol::endpoint;
-} // namespace unix_stream
+} // namespace nfd::unix_stream
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing a local channel to create faces
@@ -114,7 +112,6 @@
bool m_wantCongestionMarking;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index f024dc6..a275fde 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnixStreamFactory);
NFD_REGISTER_PROTOCOL_FACTORY(UnixStreamFactory);
@@ -109,5 +108,4 @@
return getChannelsFromMap(m_channels);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-factory.hpp b/daemon/face/unix-stream-factory.hpp
index 45be220..96ea3b1 100644
--- a/daemon/face/unix-stream-factory.hpp
+++ b/daemon/face/unix-stream-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "unix-stream-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for stream-oriented Unix sockets
*/
@@ -70,7 +69,6 @@
std::map<unix_stream::Endpoint, shared_ptr<UnixStreamChannel>> m_channels;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
diff --git a/daemon/face/unix-stream-transport.cpp b/daemon/face/unix-stream-transport.cpp
index a051ca9..76652f3 100644
--- a/daemon/face/unix-stream-transport.cpp
+++ b/daemon/face/unix-stream-transport.cpp
@@ -25,8 +25,7 @@
#include "unix-stream-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>, UnixStreamTransport);
@@ -48,5 +47,4 @@
NFD_LOG_FACE_DEBUG("Creating transport");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-transport.hpp b/daemon/face/unix-stream-transport.hpp
index 1993143..8ad8a46 100644
--- a/daemon/face/unix-stream-transport.hpp
+++ b/daemon/face/unix-stream-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#error "Cannot include this file when UNIX sockets are not available"
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>);
@@ -47,7 +46,6 @@
UnixStreamTransport(protocol::socket&& socket);
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_TRANSPORT_HPP
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index 2ee41cd..acc029e 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -29,8 +29,7 @@
#include "websocket-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(WebSocketChannel);
@@ -162,5 +161,4 @@
NFD_LOG_CHAN_DEBUG("Started listening");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index 52bf20f..d40bc70 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -29,13 +29,11 @@
#include "channel.hpp"
#include "websocketpp.hpp"
-namespace nfd {
-
-namespace websocket {
+namespace nfd::websocket {
using Endpoint = boost::asio::ip::tcp::endpoint;
-} // namespace websocket
+} // namespace nfd::websocket
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing WebSocket-based channel to create faces
@@ -111,7 +109,6 @@
time::milliseconds m_pingInterval;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index 49e5740..069f137 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "websocket-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
@@ -132,5 +131,4 @@
return getChannelsFromMap(m_channels);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-factory.hpp b/daemon/face/websocket-factory.hpp
index 721a1eb..1da0f98 100644
--- a/daemon/face/websocket-factory.hpp
+++ b/daemon/face/websocket-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "websocket-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for WebSocket
*/
@@ -71,7 +70,6 @@
std::map<websocket::Endpoint, shared_ptr<WebSocketChannel>> m_channels;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
diff --git a/daemon/face/websocket-transport.cpp b/daemon/face/websocket-transport.cpp
index 2d118ec..df7b36b 100644
--- a/daemon/face/websocket-transport.cpp
+++ b/daemon/face/websocket-transport.cpp
@@ -26,8 +26,7 @@
#include "websocket-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(WebSocketTransport);
@@ -174,5 +173,4 @@
this->setState(TransportState::CLOSED);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-transport.hpp b/daemon/face/websocket-transport.hpp
index b71206a..4148872 100644
--- a/daemon/face/websocket-transport.hpp
+++ b/daemon/face/websocket-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "transport.hpp"
#include "websocketpp.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by WebSocketTransport
* \note The type name 'WebSocketTransportCounters' is implementation detail.
@@ -107,7 +106,6 @@
return *this;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_TRANSPORT_HPP
diff --git a/daemon/face/websocketpp.hpp b/daemon/face/websocketpp.hpp
index 4815ed1..539d320 100644
--- a/daemon/face/websocketpp.hpp
+++ b/daemon/face/websocketpp.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,13 +41,11 @@
#include "websocketpp/config/asio_no_tls.hpp"
#include "websocketpp/server.hpp"
-namespace nfd {
-namespace websocket {
+namespace nfd::websocket {
-typedef websocketpp::client<websocketpp::config::asio_client> Client;
-typedef websocketpp::server<websocketpp::config::asio> Server;
+using Client = websocketpp::client<websocketpp::config::asio_client>;
+using Server = websocketpp::server<websocketpp::config::asio>;
-} // namespace websocket
-} // namespace nfd
+} // namespace nfd::websocket
#endif // NFD_DAEMON_FACE_WEBSOCKETPP_HPP
diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index e80c581..c2b6504 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -28,8 +28,7 @@
#include "common/global.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(AccessStrategy);
NFD_REGISTER_STRATEGY(AccessStrategy);
@@ -278,5 +277,4 @@
return me->insertStrategyInfo<MtInfo>(m_rttEstimatorOpts).first;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/access-strategy.hpp b/daemon/fw/access-strategy.hpp
index 1aaa5ed..c33ad5c 100644
--- a/daemon/fw/access-strategy.hpp
+++ b/daemon/fw/access-strategy.hpp
@@ -33,8 +33,7 @@
#include <unordered_map>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Access Router strategy
*
@@ -173,7 +172,6 @@
signal::ScopedConnection m_removeFaceConn;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_ACCESS_STRATEGY_HPP
diff --git a/daemon/fw/algorithm.cpp b/daemon/fw/algorithm.cpp
index a4d864b..a16ccc3 100644
--- a/daemon/fw/algorithm.cpp
+++ b/daemon/fw/algorithm.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "algorithm.hpp"
#include "scope-prefix.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
bool
wouldViolateScope(const Face& inFace, const Interest& interest, const Face& outFace)
@@ -151,5 +150,4 @@
return true;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/algorithm.hpp b/daemon/fw/algorithm.hpp
index b37d540..2ff4c2c 100644
--- a/daemon/fw/algorithm.hpp
+++ b/daemon/fw/algorithm.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
* This file contains common algorithms used by forwarding strategies.
*/
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief determine whether forwarding the Interest in \p pitEntry to \p outFace would violate scope
* \sa https://redmine.named-data.net/projects/nfd/wiki/ScopeControl
@@ -93,7 +92,6 @@
bool wantUnused = false,
time::steady_clock::TimePoint now = time::steady_clock::TimePoint::min());
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_ALGORITHM_HPP
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index c49f5d5..df1f4ff 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -26,9 +26,7 @@
#include "asf-measurements.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
time::nanoseconds
FaceInfo::scheduleTimeout(const Name& interestName, scheduler::EventCallback cb)
@@ -142,6 +140,4 @@
m_measurements.extendLifetime(me, MEASUREMENTS_LIFETIME);
}
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
diff --git a/daemon/fw/asf-measurements.hpp b/daemon/fw/asf-measurements.hpp
index 1d2b90f..bfed7ca 100644
--- a/daemon/fw/asf-measurements.hpp
+++ b/daemon/fw/asf-measurements.hpp
@@ -33,9 +33,7 @@
#include <unordered_map>
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
/** \brief Strategy information for each face in a namespace
*/
@@ -217,8 +215,6 @@
shared_ptr<const ndn::util::RttEstimator::Options> m_rttEstimatorOpts;
};
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
#endif // NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index 0df1712..25e0ac3 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -29,9 +29,7 @@
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
static_assert(ProbingModule::DEFAULT_PROBING_INTERVAL < AsfMeasurements::MEASUREMENTS_LIFETIME);
@@ -178,6 +176,4 @@
}
}
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
diff --git a/daemon/fw/asf-probing-module.hpp b/daemon/fw/asf-probing-module.hpp
index 654b569..0d6b212 100644
--- a/daemon/fw/asf-probing-module.hpp
+++ b/daemon/fw/asf-probing-module.hpp
@@ -28,9 +28,7 @@
#include "asf-measurements.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
/** \brief ASF Probing Module
*/
@@ -97,8 +95,6 @@
AsfMeasurements& m_measurements;
};
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
#endif // NFD_DAEMON_FW_ASF_PROBING_MODULE_HPP
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index 79181a2..d4ea944 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -28,9 +28,7 @@
#include "common/global.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
NFD_LOG_INIT(AsfStrategy);
NFD_REGISTER_STRATEGY(AsfStrategy);
@@ -326,6 +324,4 @@
this->rejectPendingInterest(pitEntry);
}
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
diff --git a/daemon/fw/asf-strategy.hpp b/daemon/fw/asf-strategy.hpp
index 95d1d71..0e6f3a2 100644
--- a/daemon/fw/asf-strategy.hpp
+++ b/daemon/fw/asf-strategy.hpp
@@ -31,8 +31,7 @@
#include "asf-probing-module.hpp"
#include "retx-suppression-exponential.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
namespace asf {
/** \brief Adaptive SRTT-based Forwarding Strategy
@@ -97,7 +96,6 @@
using asf::AsfStrategy;
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_ASF_STRATEGY_HPP
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
index 94f2e29..0de6265 100644
--- a/daemon/fw/best-route-strategy.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -27,8 +27,7 @@
#include "algorithm.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(BestRouteStrategy);
NFD_REGISTER_STRATEGY(BestRouteStrategy);
@@ -126,5 +125,4 @@
this->processNack(nack, ingress.face, pitEntry);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/best-route-strategy.hpp b/daemon/fw/best-route-strategy.hpp
index 5b4e27d..484ac51 100644
--- a/daemon/fw/best-route-strategy.hpp
+++ b/daemon/fw/best-route-strategy.hpp
@@ -30,8 +30,7 @@
#include "process-nack-traits.hpp"
#include "retx-suppression-exponential.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Best Route strategy
*
@@ -75,7 +74,6 @@
friend ProcessNackTraits<BestRouteStrategy>;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index f49f60a..ab8e12a 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -27,8 +27,7 @@
#include "algorithm.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_REGISTER_STRATEGY(MulticastStrategy);
@@ -111,5 +110,4 @@
// if nothing found, the interest will not be forwarded
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/multicast-strategy.hpp b/daemon/fw/multicast-strategy.hpp
index 6ff301d..6abbb38 100644
--- a/daemon/fw/multicast-strategy.hpp
+++ b/daemon/fw/multicast-strategy.hpp
@@ -29,8 +29,7 @@
#include "strategy.hpp"
#include "retx-suppression-exponential.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief A forwarding strategy that forwards Interests to all FIB nexthops
*/
@@ -55,7 +54,6 @@
std::unique_ptr<RetxSuppressionExponential> m_retxSuppression;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_MULTICAST_STRATEGY_HPP
diff --git a/daemon/fw/process-nack-traits.cpp b/daemon/fw/process-nack-traits.cpp
index 80e5c40..4b4fbbc 100644
--- a/daemon/fw/process-nack-traits.cpp
+++ b/daemon/fw/process-nack-traits.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "process-nack-traits.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(ProcessNackTraits);
@@ -82,5 +81,4 @@
this->sendNacksForProcessNackTraits(pitEntry, outNack);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/process-nack-traits.hpp b/daemon/fw/process-nack-traits.hpp
index c07537b..6a98da4 100644
--- a/daemon/fw/process-nack-traits.hpp
+++ b/daemon/fw/process-nack-traits.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "strategy.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Provides a common procedure for processing Nacks
*
@@ -95,7 +94,6 @@
S* m_strategy;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_PROCESS_NACK_TRAITS_HPP
diff --git a/daemon/fw/random-strategy.cpp b/daemon/fw/random-strategy.cpp
index 2ab24c9..b4950e7 100644
--- a/daemon/fw/random-strategy.cpp
+++ b/daemon/fw/random-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_REGISTER_STRATEGY(RandomStrategy);
NFD_LOG_INIT(RandomStrategy);
@@ -87,5 +86,4 @@
this->processNack(nack, ingress.face, pitEntry);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/random-strategy.hpp b/daemon/fw/random-strategy.hpp
index 27b2041..31b1e26 100644
--- a/daemon/fw/random-strategy.hpp
+++ b/daemon/fw/random-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "strategy.hpp"
#include "process-nack-traits.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief A forwarding strategy that randomly chooses a nexthop
*
@@ -59,7 +58,6 @@
friend ProcessNackTraits<RandomStrategy>;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RANDOM_STRATEGY_HPP
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index 6158120..6d8cdcb 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.cpp
@@ -26,8 +26,7 @@
#include "retx-suppression-exponential.hpp"
#include "algorithm.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
namespace {
@@ -143,5 +142,4 @@
return make_unique<RetxSuppressionExponential>(Duration(init), Duration(max), mult);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/retx-suppression-exponential.hpp b/daemon/fw/retx-suppression-exponential.hpp
index 41d5bdb..fd8e2c6 100644
--- a/daemon/fw/retx-suppression-exponential.hpp
+++ b/daemon/fw/retx-suppression-exponential.hpp
@@ -29,8 +29,7 @@
#include "retx-suppression.hpp"
#include "strategy.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/**
* \brief A retransmission suppression decision algorithm that suppresses
@@ -92,7 +91,6 @@
const float m_multiplier;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RETX_SUPPRESSION_EXPONENTIAL_HPP
diff --git a/daemon/fw/retx-suppression-fixed.cpp b/daemon/fw/retx-suppression-fixed.cpp
index 790ce45..c2f190b 100644
--- a/daemon/fw/retx-suppression-fixed.cpp
+++ b/daemon/fw/retx-suppression-fixed.cpp
@@ -26,8 +26,7 @@
#include "retx-suppression-fixed.hpp"
#include "algorithm.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
RetxSuppressionFixed::RetxSuppressionFixed(const time::milliseconds& minRetxInterval)
: m_minRetxInterval(minRetxInterval)
@@ -50,5 +49,4 @@
return shouldSuppress ? RetxSuppressionResult::SUPPRESS : RetxSuppressionResult::FORWARD;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/retx-suppression-fixed.hpp b/daemon/fw/retx-suppression-fixed.hpp
index e8af73b..fdd1114 100644
--- a/daemon/fw/retx-suppression-fixed.hpp
+++ b/daemon/fw/retx-suppression-fixed.hpp
@@ -29,8 +29,7 @@
#include "retx-suppression.hpp"
#include "table/pit-entry.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief a retransmission suppression decision algorithm that
* suppresses retransmissions within a fixed duration
@@ -54,7 +53,6 @@
const time::milliseconds m_minRetxInterval;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RETX_SUPPRESSION_FIXED_HPP
diff --git a/daemon/fw/retx-suppression.hpp b/daemon/fw/retx-suppression.hpp
index ad983e7..7cf6893 100644
--- a/daemon/fw/retx-suppression.hpp
+++ b/daemon/fw/retx-suppression.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
enum class RetxSuppressionResult {
/** \brief Interest is new (not a retransmission)
@@ -45,7 +44,6 @@
SUPPRESS
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RETX_SUPPRESSION_HPP
diff --git a/daemon/fw/scope-prefix.cpp b/daemon/fw/scope-prefix.cpp
index 984d19c..7f6043b 100644
--- a/daemon/fw/scope-prefix.cpp
+++ b/daemon/fw/scope-prefix.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,11 +25,9 @@
#include "scope-prefix.hpp"
-namespace nfd {
-namespace scope_prefix {
+namespace nfd::scope_prefix {
const Name LOCALHOST("ndn:/localhost");
const Name LOCALHOP("ndn:/localhop");
-} // namespace scope_prefix
-} // namespace nfd
+} // namespace nfd::scope_prefix
diff --git a/daemon/fw/scope-prefix.hpp b/daemon/fw/scope-prefix.hpp
index 265959d..fd8796c 100644
--- a/daemon/fw/scope-prefix.hpp
+++ b/daemon/fw/scope-prefix.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
/** \brief contain name prefixes that affect namespace-based scope control
* \sa https://redmine.named-data.net/projects/nfd/wiki/ScopeControl
*/
-namespace nfd {
-namespace scope_prefix {
+namespace nfd::scope_prefix {
/** \brief ndn:/localhost
*
@@ -58,7 +57,6 @@
*/
extern const Name LOCALHOP;
-} // namespace scope_prefix
-} // namespace nfd
+} // namespace nfd::scope_prefix
#endif // NFD_DAEMON_FW_SCOPE_PREFIX_HPP
diff --git a/daemon/fw/self-learning-strategy.cpp b/daemon/fw/self-learning-strategy.cpp
index db58050..399b970 100644
--- a/daemon/fw/self-learning-strategy.cpp
+++ b/daemon/fw/self-learning-strategy.cpp
@@ -36,8 +36,7 @@
#include <boost/range/adaptor/reversed.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(SelfLearningStrategy);
NFD_REGISTER_STRATEGY(SelfLearningStrategy);
@@ -258,5 +257,4 @@
});
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/self-learning-strategy.hpp b/daemon/fw/self-learning-strategy.hpp
index 47e59af..118fe3d 100644
--- a/daemon/fw/self-learning-strategy.hpp
+++ b/daemon/fw/self-learning-strategy.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/prefix-announcement-header.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Self-learning forwarding strategy
*
@@ -138,7 +137,6 @@
renewRoute(const Name& name, FaceId inFaceId, time::milliseconds maxLifetime);
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_SELF_LEARNING_STRATEGY_HPP
diff --git a/daemon/fw/strategy-info.hpp b/daemon/fw/strategy-info.hpp
index 49b5b95..db6e9e6 100644
--- a/daemon/fw/strategy-info.hpp
+++ b/daemon/fw/strategy-info.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Contains arbitrary information placed by the forwarding strategy on table entries
*/
@@ -51,7 +50,6 @@
StrategyInfo() = default;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_STRATEGY_INFO_HPP
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 1f7babc..d47df3a 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -33,8 +33,7 @@
#include <boost/range/algorithm/copy.hpp>
#include <unordered_set>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(Strategy);
@@ -339,5 +338,4 @@
return *fibEntry; // only occurs if no delegation finds a FIB nexthop
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 570f219..4c9a2e5 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -29,8 +29,7 @@
#include "forwarder.hpp"
#include "table/measurements-accessor.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
class StrategyParameters;
@@ -480,8 +479,7 @@
}
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
/** \brief Registers a strategy
*
diff --git a/daemon/fw/unsolicited-data-policy.cpp b/daemon/fw/unsolicited-data-policy.cpp
index b29b827..8ad0f66 100644
--- a/daemon/fw/unsolicited-data-policy.cpp
+++ b/daemon/fw/unsolicited-data-policy.cpp
@@ -28,8 +28,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
std::ostream&
operator<<(std::ostream& os, UnsolicitedDataDecision d)
@@ -109,5 +108,4 @@
return UnsolicitedDataDecision::CACHE;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/unsolicited-data-policy.hpp b/daemon/fw/unsolicited-data-policy.hpp
index 486903a..d49d40a 100644
--- a/daemon/fw/unsolicited-data-policy.hpp
+++ b/daemon/fw/unsolicited-data-policy.hpp
@@ -28,8 +28,7 @@
#include "face/face.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/**
* \brief Decision made by UnsolicitedDataPolicy
@@ -144,8 +143,7 @@
*/
using DefaultUnsolicitedDataPolicy = DropAllUnsolicitedDataPolicy;
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
/**
* \brief Registers an unsolicited data policy
diff --git a/daemon/mgmt/general-config-section.cpp b/daemon/mgmt/general-config-section.cpp
index de9c611..daaa103 100644
--- a/daemon/mgmt/general-config-section.cpp
+++ b/daemon/mgmt/general-config-section.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "general-config-section.hpp"
#include "common/privilege-helper.hpp"
-namespace nfd {
-namespace general {
+namespace nfd::general {
static void
onConfig(const ConfigSection& section, bool isDryRun, const std::string&)
@@ -75,5 +74,4 @@
config.addSectionHandler("general", &onConfig);
}
-} // namespace general
-} // namespace nfd
+} // namespace nfd::general
diff --git a/daemon/mgmt/general-config-section.hpp b/daemon/mgmt/general-config-section.hpp
index cd9089d..6c822d9 100644
--- a/daemon/mgmt/general-config-section.hpp
+++ b/daemon/mgmt/general-config-section.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,13 +28,11 @@
#include "common/config-file.hpp"
-namespace nfd {
-namespace general {
+namespace nfd::general {
void
setConfigFile(ConfigFile& config);
-} // namespace general
-} // namespace nfd
+} // namespace nfd::general
#endif // NFD_DAEMON_MGMT_GENERAL_CONFIG_SECTION_HPP
diff --git a/daemon/mgmt/log-config-section.cpp b/daemon/mgmt/log-config-section.cpp
index 9d8168c..9408812 100644
--- a/daemon/mgmt/log-config-section.cpp
+++ b/daemon/mgmt/log-config-section.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <ndn-cxx/util/logger.hpp>
#include <ndn-cxx/util/logging.hpp>
-namespace nfd {
-namespace log {
+namespace nfd::log {
static ndn::util::LogLevel
parseLogLevel(const ConfigSection& item, const std::string& key)
@@ -92,5 +91,4 @@
config.addSectionHandler("log", &onConfig);
}
-} // namespace log
-} // namespace nfd
+} // namespace nfd::log
diff --git a/daemon/mgmt/log-config-section.hpp b/daemon/mgmt/log-config-section.hpp
index e7e4022..526b66d 100644
--- a/daemon/mgmt/log-config-section.hpp
+++ b/daemon/mgmt/log-config-section.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,13 +28,11 @@
#include "common/config-file.hpp"
-namespace nfd {
-namespace log {
+namespace nfd::log {
void
setConfigFile(ConfigFile& config);
-} // namespace log
-} // namespace nfd
+} // namespace nfd::log
#endif // NFD_DAEMON_MGMT_LOG_CONFIG_SECTION_HPP
diff --git a/daemon/rib/fib-update.cpp b/daemon/rib/fib-update.cpp
index 25e2a62..ca53565 100644
--- a/daemon/rib/fib-update.cpp
+++ b/daemon/rib/fib-update.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "fib-update.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
FibUpdate
FibUpdate::createAddUpdate(const Name& name, const uint64_t faceId, const uint64_t cost)
@@ -53,5 +52,4 @@
return update;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/fib-update.hpp b/daemon/rib/fib-update.hpp
index 5339a37..6eead74 100644
--- a/daemon/rib/fib-update.hpp
+++ b/daemon/rib/fib-update.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \class FibUpdate
* \brief represents a FIB update
@@ -90,7 +89,6 @@
return os;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_FIB_UPDATE_HPP
diff --git a/daemon/rib/fib-updater.cpp b/daemon/rib/fib-updater.cpp
index 5208e61..6f82b17 100644
--- a/daemon/rib/fib-updater.cpp
+++ b/daemon/rib/fib-updater.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(FibUpdater);
@@ -708,5 +707,4 @@
m_inheritedRoutes.push_back(update);
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/fib-updater.hpp b/daemon/rib/fib-updater.hpp
index d43f50a..e231341 100644
--- a/daemon/rib/fib-updater.hpp
+++ b/daemon/rib/fib-updater.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <ndn-cxx/mgmt/nfd/controller.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief computes FibUpdates based on updates to the RIB and sends them to NFD
*/
@@ -267,7 +266,6 @@
RibUpdateList m_inheritedRoutes;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_FIB_UPDATER_HPP
diff --git a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
index 7aff618..dcce60a 100644
--- a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
+++ b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
@@ -25,8 +25,7 @@
#include "client-to-nlsr-readvertise-policy.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
std::optional<ReadvertiseAction>
ClientToNlsrReadvertisePolicy::handleNewRoute(const RibRouteRef& ribRoute) const
@@ -45,5 +44,4 @@
return 1_h;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
index c0d5837..be76597 100644
--- a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
+++ b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
@@ -28,8 +28,7 @@
#include "readvertise-policy.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a policy to readvertise routes registered by end hosts into NLSR
*/
@@ -48,7 +47,6 @@
getRefreshInterval() const override;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_CLIENT_TO_NLSR_READVERTISE_POLICY_HPP
diff --git a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp
index 5aa6e3b..2d8d3a5 100644
--- a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp
+++ b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/security/pib/identity.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
const name::Component IGNORE_COMPONENT("nrd");
const time::seconds DEFAULT_REFRESH_INTERVAL = 25_s;
@@ -85,5 +84,4 @@
return m_refreshInterval;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp
index ac2491d..63b4fc8 100644
--- a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp
+++ b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp
@@ -31,8 +31,7 @@
#include <ndn-cxx/security/key-chain.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a policy to readvertise routes registered by local applications into remote gateway
*/
@@ -54,7 +53,6 @@
time::seconds m_refreshInterval;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_HOST_TO_GATEWAY_READVERTISE_POLICY_HPP
diff --git a/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp b/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
index 0592040..413320e 100644
--- a/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
+++ b/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include <ndn-cxx/mgmt/nfd/control-command.hpp>
#include <ndn-cxx/mgmt/nfd/control-response.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(NfdRibReadvertiseDestination);
@@ -85,5 +84,4 @@
getCommandOptions().setSigningInfo(rr.signer));
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp b/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
index 0f61669..ab2f710 100644
--- a/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
+++ b/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a readvertise destination using NFD RIB management protocol
*/
@@ -84,7 +83,6 @@
ndn::nfd::ControlParameters m_controlParameters;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_NFD_RIB_READVERTISE_DESTINATION_HPP
diff --git a/daemon/rib/readvertise/readvertise-destination.cpp b/daemon/rib/readvertise/readvertise-destination.cpp
index 972c1dc..53f82ab 100644
--- a/daemon/rib/readvertise/readvertise-destination.cpp
+++ b/daemon/rib/readvertise/readvertise-destination.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "readvertise-destination.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(ReadvertiseDestination);
@@ -46,5 +45,4 @@
}
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/readvertise-destination.hpp b/daemon/rib/readvertise/readvertise-destination.hpp
index 1c4fb76..045483a 100644
--- a/daemon/rib/readvertise/readvertise-destination.hpp
+++ b/daemon/rib/readvertise/readvertise-destination.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "readvertised-route.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a destination to readvertise into
*/
@@ -68,7 +67,6 @@
bool m_isAvailable = false;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISE_DESTINATION_HPP
diff --git a/daemon/rib/readvertise/readvertise-policy.hpp b/daemon/rib/readvertise/readvertise-policy.hpp
index da22139..3e4456e 100644
--- a/daemon/rib/readvertise/readvertise-policy.hpp
+++ b/daemon/rib/readvertise/readvertise-policy.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/security/signing-info.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a decision made by readvertise policy
*/
@@ -60,7 +59,6 @@
getRefreshInterval() const = 0;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISE_POLICY_HPP
diff --git a/daemon/rib/readvertise/readvertise.cpp b/daemon/rib/readvertise/readvertise.cpp
index ded568d..f7eb4cd 100644
--- a/daemon/rib/readvertise/readvertise.cpp
+++ b/daemon/rib/readvertise/readvertise.cpp
@@ -29,8 +29,7 @@
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(Readvertise);
@@ -193,5 +192,4 @@
});
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/readvertise.hpp b/daemon/rib/readvertise/readvertise.hpp
index aeaa823..88b11aa 100644
--- a/daemon/rib/readvertise/readvertise.hpp
+++ b/daemon/rib/readvertise/readvertise.hpp
@@ -31,8 +31,7 @@
#include "readvertised-route.hpp"
#include "rib/rib.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief readvertise a subset of routes to a destination according to a policy
*
@@ -81,7 +80,6 @@
signal::ScopedConnection m_removeRouteConn;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISE_HPP
diff --git a/daemon/rib/readvertise/readvertised-route.hpp b/daemon/rib/readvertise/readvertised-route.hpp
index 3749336..e4be12c 100644
--- a/daemon/rib/readvertise/readvertised-route.hpp
+++ b/daemon/rib/readvertise/readvertised-route.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/util/scheduler.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief state of a readvertised route
*/
@@ -63,7 +62,6 @@
using ReadvertisedRouteContainer = std::set<ReadvertisedRoute>;
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISED_ROUTE_HPP
diff --git a/daemon/rib/rib-entry.cpp b/daemon/rib/rib-entry.cpp
index 1710aff..1df227e 100644
--- a/daemon/rib/rib-entry.cpp
+++ b/daemon/rib/rib-entry.cpp
@@ -28,8 +28,7 @@
#include <ndn-cxx/mgmt/nfd/control-command.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(RibEntry);
@@ -288,5 +287,4 @@
return os << "}";
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib-entry.hpp b/daemon/rib/rib-entry.hpp
index 79f1627..d98d72a 100644
--- a/daemon/rib/rib-entry.hpp
+++ b/daemon/rib/rib-entry.hpp
@@ -30,8 +30,7 @@
#include <list>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/**
* \brief Represents a RIB entry, which contains one or more Routes with the same prefix.
@@ -278,7 +277,6 @@
std::ostream&
operator<<(std::ostream& os, const RibEntry& entry);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_ENTRY_HPP
diff --git a/daemon/rib/rib-update-batch.cpp b/daemon/rib/rib-update-batch.cpp
index e639ae3..12284f7 100644
--- a/daemon/rib/rib-update-batch.cpp
+++ b/daemon/rib/rib-update-batch.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "rib-update-batch.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
RibUpdateBatch::RibUpdateBatch(uint64_t faceId)
: m_faceId(faceId)
@@ -59,5 +58,4 @@
return m_updates.size();
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib-update-batch.hpp b/daemon/rib/rib-update-batch.hpp
index f3facb3..a91cad3 100644
--- a/daemon/rib/rib-update-batch.hpp
+++ b/daemon/rib/rib-update-batch.hpp
@@ -30,8 +30,7 @@
#include <list>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
using RibUpdateList = std::list<RibUpdate>;
@@ -69,7 +68,6 @@
RibUpdateList m_updates;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_UPDATE_BATCH_HPP
diff --git a/daemon/rib/rib-update.cpp b/daemon/rib/rib-update.cpp
index be2636d..343d39e 100644
--- a/daemon/rib/rib-update.cpp
+++ b/daemon/rib/rib-update.cpp
@@ -25,8 +25,7 @@
#include "rib-update.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
std::ostream&
operator<<(std::ostream& os, RibUpdate::Action action)
@@ -55,5 +54,4 @@
<< "}";
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib-update.hpp b/daemon/rib/rib-update.hpp
index bcdb342..70bbe1e 100644
--- a/daemon/rib/rib-update.hpp
+++ b/daemon/rib/rib-update.hpp
@@ -29,8 +29,7 @@
#include "core/common.hpp"
#include "route.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/**
* \brief Represents a route that will be added to or removed from a namespace
@@ -118,7 +117,6 @@
std::ostream&
operator<<(std::ostream& os, const RibUpdate& update);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_UPDATE_HPP
diff --git a/daemon/rib/rib.cpp b/daemon/rib/rib.cpp
index fe4db0b..1d002a1 100644
--- a/daemon/rib/rib.cpp
+++ b/daemon/rib/rib.cpp
@@ -27,8 +27,7 @@
#include "fib-updater.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(Rib);
@@ -496,5 +495,4 @@
return os;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib.hpp b/daemon/rib/rib.hpp
index f6912c3..36d5e41 100644
--- a/daemon/rib/rib.hpp
+++ b/daemon/rib/rib.hpp
@@ -31,8 +31,7 @@
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
using ndn::nfd::ControlParameters;
@@ -254,7 +253,6 @@
std::ostream&
operator<<(std::ostream& os, const Rib& rib);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_HPP
diff --git a/daemon/rib/route.cpp b/daemon/rib/route.cpp
index 99d80e5..78ccdad 100644
--- a/daemon/rib/route.cpp
+++ b/daemon/rib/route.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "route.hpp"
#include <ndn-cxx/util/string-helper.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
const uint64_t PA_ROUTE_COST = 2048; ///< cost of route created by prefix announcement
@@ -92,5 +91,4 @@
return os;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/route.hpp b/daemon/rib/route.hpp
index 9b0bead..eea42ee 100644
--- a/daemon/rib/route.hpp
+++ b/daemon/rib/route.hpp
@@ -35,8 +35,7 @@
#include <type_traits>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief represents a route for a name prefix
*/
@@ -116,7 +115,6 @@
std::ostream&
operator<<(std::ostream& os, const Route& route);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_ROUTE_HPP
diff --git a/daemon/rib/service.cpp b/daemon/rib/service.cpp
index d850ed2..1634ef9 100644
--- a/daemon/rib/service.cpp
+++ b/daemon/rib/service.cpp
@@ -38,8 +38,7 @@
#include <ndn-cxx/transport/tcp-transport.hpp>
#include <ndn-cxx/transport/unix-transport.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(RibService);
@@ -262,5 +261,4 @@
}
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/service.hpp b/daemon/rib/service.hpp
index 8928011..02e1914 100644
--- a/daemon/rib/service.hpp
+++ b/daemon/rib/service.hpp
@@ -38,8 +38,7 @@
#include <ndn-cxx/transport/transport.hpp>
#include <ndn-cxx/util/scheduler.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
class Readvertise;
@@ -121,7 +120,6 @@
RibManager m_ribManager;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_SERVICE_HPP
diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
index 470e850..e02caa1 100644
--- a/daemon/table/cs-entry.cpp
+++ b/daemon/table/cs-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "cs-entry.hpp"
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
Entry::Entry(shared_ptr<const Data> data, bool isUnsolicited)
: m_data(std::move(data))
@@ -111,5 +110,4 @@
return compareDataWithData(lhs.getData(), rhs.getData()) < 0;
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
index 5dd931d..a04f9f7 100644
--- a/daemon/table/cs-entry.hpp
+++ b/daemon/table/cs-entry.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
/** \brief a ContentStore entry
*/
@@ -121,7 +120,6 @@
return *lhs < *rhs;
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
#endif // NFD_DAEMON_TABLE_CS_ENTRY_HPP
diff --git a/daemon/table/cs-policy-lru.cpp b/daemon/table/cs-policy-lru.cpp
index 1b477aa..80b5994 100644
--- a/daemon/table/cs-policy-lru.cpp
+++ b/daemon/table/cs-policy-lru.cpp
@@ -26,9 +26,7 @@
#include "cs-policy-lru.hpp"
#include "cs.hpp"
-namespace nfd {
-namespace cs {
-namespace lru {
+namespace nfd::cs::lru {
const std::string LruPolicy::POLICY_NAME = "lru";
NFD_REGISTER_CS_POLICY(LruPolicy);
@@ -87,6 +85,4 @@
}
}
-} // namespace lru
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs::lru
diff --git a/daemon/table/cs-policy-lru.hpp b/daemon/table/cs-policy-lru.hpp
index 5d61e47..8d7c814 100644
--- a/daemon/table/cs-policy-lru.hpp
+++ b/daemon/table/cs-policy-lru.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
namespace lru {
using Queue = boost::multi_index_container<
@@ -84,7 +83,6 @@
using lru::LruPolicy;
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
#endif // NFD_DAEMON_TABLE_CS_POLICY_LRU_HPP
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp
index d037175..4405e66 100644
--- a/daemon/table/cs-policy-priority-fifo.cpp
+++ b/daemon/table/cs-policy-priority-fifo.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,9 +27,7 @@
#include "cs.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace cs {
-namespace priority_fifo {
+namespace nfd::cs::priority_fifo {
const std::string PriorityFifoPolicy::POLICY_NAME = "priority_fifo";
NFD_REGISTER_CS_POLICY(PriorityFifoPolicy);
@@ -158,6 +156,4 @@
m_entryInfoMap[i] = entryInfo;
}
-} // namespace priority_fifo
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs::priority_fifo
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp
index 757b0c5..48d1d66 100644
--- a/daemon/table/cs-policy-priority-fifo.hpp
+++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <list>
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
namespace priority_fifo {
using Queue = std::list<Policy::EntryRef>;
@@ -121,7 +120,6 @@
using priority_fifo::PriorityFifoPolicy;
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
#endif // NFD_DAEMON_TABLE_CS_POLICY_PRIORITY_FIFO_HPP
diff --git a/daemon/table/cs-policy.cpp b/daemon/table/cs-policy.cpp
index 6b24eb3..3e3fc53 100644
--- a/daemon/table/cs-policy.cpp
+++ b/daemon/table/cs-policy.cpp
@@ -32,8 +32,7 @@
NFD_LOG_INIT(CsPolicy);
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
Policy::Registry&
Policy::getRegistry()
@@ -100,5 +99,4 @@
this->doBeforeUse(i);
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/cs-policy.hpp b/daemon/table/cs-policy.hpp
index 9a4c6ed..de4c89c 100644
--- a/daemon/table/cs-policy.hpp
+++ b/daemon/table/cs-policy.hpp
@@ -28,8 +28,7 @@
#include "cs-entry.hpp"
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
class Cs;
@@ -206,8 +205,7 @@
Cs* m_cs;
};
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
/** \brief registers a CS policy
* \param P a subclass of nfd::cs::Policy
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index 5fc8301..18d8fe2 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -25,13 +25,11 @@
#include "cs.hpp"
#include "common/logger.hpp"
-#include "core/algorithm.hpp"
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
NFD_LOG_INIT(ContentStore);
@@ -178,5 +176,4 @@
NFD_LOG_INFO((shouldServe ? "Enabling" : "Disabling") << " Data serving");
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/fib-entry.cpp b/daemon/table/fib-entry.cpp
index 71c2516..cb97ea2 100644
--- a/daemon/table/fib-entry.cpp
+++ b/daemon/table/fib-entry.cpp
@@ -25,8 +25,7 @@
#include "fib-entry.hpp"
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
Entry::Entry(const Name& prefix)
: m_prefix(prefix)
@@ -83,5 +82,4 @@
[] (const NextHop& a, const NextHop& b) { return a.getCost() < b.getCost(); });
}
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
diff --git a/daemon/table/fib-entry.hpp b/daemon/table/fib-entry.hpp
index facf248..13825b7 100644
--- a/daemon/table/fib-entry.hpp
+++ b/daemon/table/fib-entry.hpp
@@ -28,13 +28,11 @@
#include "fib-nexthop.hpp"
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace fib {
+namespace nfd::fib {
class Fib;
@@ -121,7 +119,6 @@
friend Fib;
};
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
#endif // NFD_DAEMON_TABLE_FIB_ENTRY_HPP
diff --git a/daemon/table/fib-nexthop.hpp b/daemon/table/fib-nexthop.hpp
index e03efda..b696cea 100644
--- a/daemon/table/fib-nexthop.hpp
+++ b/daemon/table/fib-nexthop.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "core/common.hpp"
#include "face/face.hpp"
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
/** \brief Represents a nexthop record in a FIB entry
*/
@@ -66,7 +65,6 @@
uint64_t m_cost = 0;
};
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
#endif // NFD_DAEMON_TABLE_FIB_NEXTHOP_HPP
diff --git a/daemon/table/fib.cpp b/daemon/table/fib.cpp
index c6c8f2c..f30b976 100644
--- a/daemon/table/fib.cpp
+++ b/daemon/table/fib.cpp
@@ -29,8 +29,7 @@
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
NDN_CXX_ASSERT_FORWARD_ITERATOR(Fib::const_iterator);
@@ -165,5 +164,4 @@
boost::adaptors::transformed(name_tree::GetTableEntry<Entry>(&name_tree::Entry::getFibEntry));
}
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
diff --git a/daemon/table/measurements-accessor.cpp b/daemon/table/measurements-accessor.cpp
index 68cf784..3206c2e 100644
--- a/daemon/table/measurements-accessor.cpp
+++ b/daemon/table/measurements-accessor.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,14 +25,11 @@
#include "measurements-accessor.hpp"
-namespace nfd {
-namespace measurements {
-
-using fw::Strategy;
+namespace nfd::measurements {
MeasurementsAccessor::MeasurementsAccessor(Measurements& measurements,
const StrategyChoice& strategyChoice,
- const Strategy& strategy)
+ const fw::Strategy& strategy)
: m_measurements(measurements)
, m_strategyChoice(strategyChoice)
, m_strategy(&strategy)
@@ -50,12 +47,11 @@
return entry;
}
- Strategy& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
+ auto& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
if (&effectiveStrategy == m_strategy) {
return entry;
}
return nullptr;
}
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
diff --git a/daemon/table/measurements-entry.hpp b/daemon/table/measurements-entry.hpp
index a70f6e0..56825b6 100644
--- a/daemon/table/measurements-entry.hpp
+++ b/daemon/table/measurements-entry.hpp
@@ -28,13 +28,11 @@
#include "strategy-info-host.hpp"
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace measurements {
+namespace nfd::measurements {
class Measurements;
@@ -68,7 +66,6 @@
friend name_tree::Entry;
};
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
#endif // NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP
diff --git a/daemon/table/measurements.cpp b/daemon/table/measurements.cpp
index af3cc1e..7a5f9b7 100644
--- a/daemon/table/measurements.cpp
+++ b/daemon/table/measurements.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "fib-entry.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace measurements {
+namespace nfd::measurements {
Measurements::Measurements(NameTree& nameTree)
: m_nameTree(nameTree)
@@ -150,5 +149,4 @@
--m_nItems;
}
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
diff --git a/daemon/table/name-tree-entry.cpp b/daemon/table/name-tree-entry.cpp
index c145129..a4f898b 100644
--- a/daemon/table/name-tree-entry.cpp
+++ b/daemon/table/name-tree-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "name-tree-entry.hpp"
#include "name-tree.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
Entry::Entry(const Name& name, Node* node)
: m_name(name)
@@ -139,5 +138,4 @@
}
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-entry.hpp b/daemon/table/name-tree-entry.hpp
index 9c101ff..644d86b 100644
--- a/daemon/table/name-tree-entry.hpp
+++ b/daemon/table/name-tree-entry.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include "table/measurements-entry.hpp"
#include "table/strategy-choice-entry.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
class Node;
@@ -207,7 +206,6 @@
Getter m_getter;
};
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
#endif // NFD_DAEMON_TABLE_NAME_TREE_ENTRY_HPP
diff --git a/daemon/table/name-tree-hashtable.cpp b/daemon/table/name-tree-hashtable.cpp
index fc17523..390507d 100644
--- a/daemon/table/name-tree-hashtable.cpp
+++ b/daemon/table/name-tree-hashtable.cpp
@@ -27,8 +27,7 @@
#include "common/city-hash.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
NFD_LOG_INIT(NameTreeHashtable);
@@ -278,5 +277,4 @@
this->computeThresholds();
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-hashtable.hpp b/daemon/table/name-tree-hashtable.hpp
index 2880984..de96d0a 100644
--- a/daemon/table/name-tree-hashtable.hpp
+++ b/daemon/table/name-tree-hashtable.hpp
@@ -28,8 +28,7 @@
#include "name-tree-entry.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
@@ -246,7 +245,6 @@
size_t m_shrinkThreshold;
};
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
#endif // NFD_DAEMON_TABLE_NAME_TREE_HASHTABLE_HPP
diff --git a/daemon/table/name-tree-iterator.cpp b/daemon/table/name-tree-iterator.cpp
index 33b5382..001bb06 100644
--- a/daemon/table/name-tree-iterator.cpp
+++ b/daemon/table/name-tree-iterator.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <boost/range/concepts.hpp>
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
NDN_CXX_ASSERT_FORWARD_ITERATOR(Iterator);
BOOST_CONCEPT_ASSERT((boost::ForwardRangeConcept<Range>));
@@ -257,5 +256,4 @@
i = Iterator();
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-iterator.hpp b/daemon/table/name-tree-iterator.hpp
index d99e5f9..fc04fb6 100644
--- a/daemon/table/name-tree-iterator.hpp
+++ b/daemon/table/name-tree-iterator.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "name-tree-hashtable.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
class NameTree;
@@ -211,7 +210,6 @@
*/
using Range = boost::iterator_range<Iterator>;
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
#endif // NFD_DAEMON_TABLE_NAME_TREE_ITERATOR_HPP
diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp
index aac885c..1758532 100644
--- a/daemon/table/name-tree.cpp
+++ b/daemon/table/name-tree.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <boost/concept_check.hpp>
#include <type_traits>
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
NFD_LOG_INIT(NameTree);
@@ -236,5 +235,4 @@
return {Iterator(make_shared<PartialEnumerationImpl>(*this, entrySubTreeSelector), entry), end()};
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index e2e194f..b302c28 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include <algorithm>
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
Entry::Entry(const Interest& interest)
: m_interest(interest.shared_from_this())
@@ -120,5 +119,4 @@
}
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
index e088e70..6287e44 100644
--- a/daemon/table/pit-entry.hpp
+++ b/daemon/table/pit-entry.hpp
@@ -31,13 +31,11 @@
#include <list>
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace pit {
+namespace nfd::pit {
/**
* \brief An unordered collection of in-records
@@ -246,7 +244,6 @@
friend name_tree::Entry;
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
diff --git a/daemon/table/pit-face-record.cpp b/daemon/table/pit-face-record.cpp
index 4674b8e..c0f43bc 100644
--- a/daemon/table/pit-face-record.cpp
+++ b/daemon/table/pit-face-record.cpp
@@ -25,8 +25,7 @@
#include "pit-face-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
// Impose a maximum lifetime to prevent integer overflow when calculating m_expiry.
const time::milliseconds MAX_LIFETIME = 10_days;
@@ -42,5 +41,4 @@
m_expiry = m_lastRenewed + lifetime;
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
index 1a68a51..edb0783 100644
--- a/daemon/table/pit-face-record.hpp
+++ b/daemon/table/pit-face-record.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "face/face.hpp"
#include "strategy-info-host.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief Contains information about an Interest on an incoming or outgoing face
* \note This is an implementation detail to extract common functionality
@@ -84,7 +83,6 @@
time::steady_clock::TimePoint m_expiry = time::steady_clock::TimePoint::min();
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_FACE_RECORD_HPP
diff --git a/daemon/table/pit-in-record.cpp b/daemon/table/pit-in-record.cpp
index 15131da..6982780 100644
--- a/daemon/table/pit-in-record.cpp
+++ b/daemon/table/pit-in-record.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "pit-in-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
void
InRecord::update(const Interest& interest)
@@ -35,5 +34,4 @@
m_interest = interest.shared_from_this();
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-in-record.hpp b/daemon/table/pit-in-record.hpp
index 002537b..c61f61d 100644
--- a/daemon/table/pit-in-record.hpp
+++ b/daemon/table/pit-in-record.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "pit-face-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief Contains information about an Interest from an incoming face
*/
@@ -52,7 +51,6 @@
shared_ptr<const Interest> m_interest;
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
diff --git a/daemon/table/pit-iterator.cpp b/daemon/table/pit-iterator.cpp
index 58777a7..f0d0c8a 100644
--- a/daemon/table/pit-iterator.cpp
+++ b/daemon/table/pit-iterator.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
NDN_CXX_ASSERT_FORWARD_ITERATOR(Iterator);
@@ -61,5 +60,4 @@
return copy;
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-iterator.hpp b/daemon/table/pit-iterator.hpp
index b788e3c..014ddc1 100644
--- a/daemon/table/pit-iterator.hpp
+++ b/daemon/table/pit-iterator.hpp
@@ -29,8 +29,7 @@
#include "name-tree.hpp"
#include "pit-entry.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief PIT iterator
*/
@@ -87,7 +86,6 @@
size_t m_iPitEntry; ///< current PIT entry within m_ntIt->getPitEntries()
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_ITERATOR_HPP
diff --git a/daemon/table/pit-out-record.cpp b/daemon/table/pit-out-record.cpp
index e86f440..1f3e899 100644
--- a/daemon/table/pit-out-record.cpp
+++ b/daemon/table/pit-out-record.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "pit-out-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
bool
OutRecord::setIncomingNack(const lp::Nack& nack)
@@ -39,5 +38,4 @@
return true;
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-out-record.hpp b/daemon/table/pit-out-record.hpp
index 383e0c8..aeb7523 100644
--- a/daemon/table/pit-out-record.hpp
+++ b/daemon/table/pit-out-record.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "pit-face-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief Contains information about an Interest toward an outgoing face
*/
@@ -75,7 +74,6 @@
unique_ptr<lp::NackHeader> m_incomingNack;
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_OUT_RECORD_HPP
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index cc447f2..4ebdefb 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "pit.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
static inline bool
nteHasPitEntries(const name_tree::Entry& nte)
@@ -128,5 +127,4 @@
return const_iterator(m_nameTree.fullEnumerate(&nteHasPitEntries).begin());
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/strategy-choice-entry.cpp b/daemon/table/strategy-choice-entry.cpp
index 1a1ea8e..a752e45 100644
--- a/daemon/table/strategy-choice-entry.cpp
+++ b/daemon/table/strategy-choice-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "strategy-choice-entry.hpp"
#include "fw/strategy.hpp"
-namespace nfd {
-namespace strategy_choice {
+namespace nfd::strategy_choice {
Entry::Entry(const Name& prefix)
: m_prefix(prefix)
@@ -48,5 +47,4 @@
m_strategy = std::move(strategy);
}
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice
diff --git a/daemon/table/strategy-choice-entry.hpp b/daemon/table/strategy-choice-entry.hpp
index ac59234..a47337f 100644
--- a/daemon/table/strategy-choice-entry.hpp
+++ b/daemon/table/strategy-choice-entry.hpp
@@ -28,17 +28,15 @@
#include "core/common.hpp"
-namespace nfd {
-
-namespace fw {
+namespace nfd::fw {
class Strategy;
-} // namespace fw
+} // namespace nfd::fw
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace strategy_choice {
+namespace nfd::strategy_choice {
/**
* \brief Represents an entry in the %Strategy %Choice table.
@@ -85,7 +83,6 @@
friend name_tree::Entry;
};
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice
#endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index e03306c..cefb245 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace strategy_choice {
+namespace nfd::strategy_choice {
NDN_CXX_ASSERT_FORWARD_ITERATOR(StrategyChoice::const_iterator);
@@ -266,5 +265,4 @@
&name_tree::Entry::getStrategyChoiceEntry));
}
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice
diff --git a/tests/clock-fixture.cpp b/tests/clock-fixture.cpp
index 1691f89..8858919 100644
--- a/tests/clock-fixture.cpp
+++ b/tests/clock-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "tests/clock-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
ClockFixture::ClockFixture()
: m_steadyClock(make_shared<time::UnitTestSteadyClock>())
@@ -56,5 +55,4 @@
}
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/clock-fixture.hpp b/tests/clock-fixture.hpp
index 4243b62..05efe09 100644
--- a/tests/clock-fixture.hpp
+++ b/tests/clock-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/util/time-unit-test-clock.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief A test fixture that overrides steady clock and system clock.
*/
@@ -85,7 +84,6 @@
shared_ptr<time::UnitTestSystemClock> m_systemClock;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_CLOCK_FIXTURE_HPP
diff --git a/tests/core/algorithm.t.cpp b/tests/core/algorithm.t.cpp
deleted file mode 100644
index 89a60ba..0000000
--- a/tests/core/algorithm.t.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2022, Regents of the University of California,
- * Arizona Board of Regents,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University,
- * Washington University in St. Louis,
- * Beijing Institute of Technology,
- * The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "core/algorithm.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(TestAlgorithm)
-
-BOOST_AUTO_TEST_CASE(FindLastIf)
-{
- const std::vector<int> vec{1, 2, 3, 4, 5, 6, 7, 8, 9};
-
- int hit1 = 0;
- auto found1 = find_last_if(vec.begin(), vec.end(), [&hit1] (int n) -> bool {
- ++hit1;
- return n % 2 == 0;
- });
- BOOST_REQUIRE(found1 != vec.end());
- BOOST_CHECK_EQUAL(*found1, 8);
- BOOST_CHECK_LE(hit1, vec.size());
-
- int hit2 = 0;
- auto found2 = find_last_if(vec.begin(), vec.end(), [&hit2] (int n) -> bool {
- ++hit2;
- return n < 0;
- });
- BOOST_CHECK(found2 == vec.end());
- BOOST_CHECK_LE(hit2, vec.size());
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestAlgorithm
-
-} // namespace tests
-} // namespace nfd
diff --git a/tests/core/ndebug.t.cpp b/tests/core/ndebug.t.cpp
index 8465b06..99e8938 100644
--- a/tests/core/ndebug.t.cpp
+++ b/tests/core/ndebug.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestNdebug)
@@ -55,5 +54,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNdebug
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/core/network.t.cpp b/tests/core/network.t.cpp
index 4ab71b5..1dfd084 100644
--- a/tests/core/network.t.cpp
+++ b/tests/core/network.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestNetwork)
@@ -181,5 +180,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNetwork
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/core/version.t.cpp b/tests/core/version.t.cpp
index 349dfff..2a0e09e 100644
--- a/tests/core/version.t.cpp
+++ b/tests/core/version.t.cpp
@@ -30,8 +30,7 @@
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestVersion)
@@ -67,5 +66,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestVersion
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/common/config-file.t.cpp b/tests/daemon/common/config-file.t.cpp
index e1c7333..79c8e08 100644
--- a/tests/daemon/common/config-file.t.cpp
+++ b/tests/daemon/common/config-file.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include <fstream>
#include <sstream>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestConfigFile)
@@ -429,5 +428,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestConfigFile
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/common/counter.t.cpp b/tests/daemon/common/counter.t.cpp
index 60de483..5cffcdb 100644
--- a/tests/daemon/common/counter.t.cpp
+++ b/tests/daemon/common/counter.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestCounter)
@@ -89,5 +88,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCounter
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/common/global.t.cpp b/tests/daemon/common/global.t.cpp
index dced382..b738d32 100644
--- a/tests/daemon/common/global.t.cpp
+++ b/tests/daemon/common/global.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include <thread>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestGlobal, GlobalIoFixture)
@@ -140,5 +139,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestGlobal
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/common/privilege-helper.t.cpp b/tests/daemon/common/privilege-helper.t.cpp
index c670a5f..d519805 100644
--- a/tests/daemon/common/privilege-helper.t.cpp
+++ b/tests/daemon/common/privilege-helper.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(TestPrivilegeHelper)
@@ -69,5 +68,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPrivilegeHelper
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/channel-fixture.hpp b/tests/daemon/face/channel-fixture.hpp
index c3d07c6..f612f6d 100644
--- a/tests/daemon/face/channel-fixture.hpp
+++ b/tests/daemon/face/channel-fixture.hpp
@@ -34,16 +34,12 @@
#include <type_traits>
-namespace nfd {
-namespace face {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
template<class ChannelT, class EndpointT>
class ChannelFixture : public GlobalIoFixture
{
- static_assert(std::is_base_of_v<Channel, ChannelT>);
+ static_assert(std::is_base_of_v<face::Channel, ChannelT>);
public:
virtual
@@ -108,8 +104,6 @@
uint16_t m_nextPort = 7050;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/datagram-transport.t.cpp b/tests/daemon/face/datagram-transport.t.cpp
index 631e394..055584c 100644
--- a/tests/daemon/face/datagram-transport.t.cpp
+++ b/tests/daemon/face/datagram-transport.t.cpp
@@ -30,9 +30,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestDatagramTransport)
@@ -174,6 +174,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestDatagramTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/dummy-face.cpp b/tests/daemon/face/dummy-face.cpp
index b7e74ca..246f9cc 100644
--- a/tests/daemon/face/dummy-face.cpp
+++ b/tests/daemon/face/dummy-face.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,9 +27,7 @@
#include "dummy-link-service.hpp"
#include "dummy-transport.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
DummyFace::DummyFace(const std::string& localUri, const std::string& remoteUri,
ndn::nfd::FaceScope scope, ndn::nfd::FacePersistency persistency,
@@ -45,7 +43,7 @@
}
void
-DummyFace::setState(FaceState state)
+DummyFace::setState(face::FaceState state)
{
static_cast<DummyTransport*>(getTransport())->setState(state);
}
@@ -74,6 +72,4 @@
return static_cast<DummyLinkService*>(getLinkService());
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/dummy-face.hpp b/tests/daemon/face/dummy-face.hpp
index 94b5363..8374430 100644
--- a/tests/daemon/face/dummy-face.hpp
+++ b/tests/daemon/face/dummy-face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "face/face.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
class DummyLinkService;
@@ -57,7 +55,7 @@
* \throw std::runtime_error state transition is invalid
*/
void
- setState(FaceState state);
+ setState(face::FaceState state);
/** \brief causes the face to receive an Interest
*/
@@ -92,13 +90,6 @@
std::vector<lp::Nack>& sentNacks;
};
-} // namespace tests
-} // namespace face
-
-namespace tests {
-using nfd::face::tests::DummyFace;
-} // namespace tests
-
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_DUMMY_FACE_HPP
diff --git a/tests/daemon/face/dummy-link-service.cpp b/tests/daemon/face/dummy-link-service.cpp
index 820d05b..5b33784 100644
--- a/tests/daemon/face/dummy-link-service.cpp
+++ b/tests/daemon/face/dummy-link-service.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,9 +25,7 @@
#include "dummy-link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
void
DummyLinkService::doSendInterest(const Interest& interest)
@@ -63,6 +61,4 @@
receivedPackets.push_back({packet, endpoint});
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/dummy-link-service.hpp b/tests/daemon/face/dummy-link-service.hpp
index 3d77968..6661f0c 100644
--- a/tests/daemon/face/dummy-link-service.hpp
+++ b/tests/daemon/face/dummy-link-service.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "face/link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
enum PacketLoggingFlags : unsigned {
LogNothing = 0, ///< disable packet logging
@@ -50,7 +48,7 @@
/** \brief A dummy LinkService that logs all sent and received packets.
*/
-class DummyLinkService final : public LinkService
+class DummyLinkService final : public face::LinkService
{
public:
/** \brief Emitted after a network-layer packet is sent through this link service.
@@ -94,8 +92,6 @@
PacketLoggingFlags m_loggingFlags = LogAllPackets;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_DUMMY_LINK_SERVICE_HPP
diff --git a/tests/daemon/face/dummy-transport.hpp b/tests/daemon/face/dummy-transport.hpp
index 8ebb582..2eb21fe 100644
--- a/tests/daemon/face/dummy-transport.hpp
+++ b/tests/daemon/face/dummy-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,9 +30,7 @@
#include "face/null-transport.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
/** \brief Dummy Transport type used in unit tests.
*
@@ -41,7 +39,7 @@
* All persistency changes are recorded in `persistencyHistory`.
*/
template<bool CAN_CHANGE_PERSISTENCY>
-class DummyTransportBase : public NullTransport
+class DummyTransportBase : public face::NullTransport
{
public:
explicit
@@ -50,8 +48,8 @@
ndn::nfd::FaceScope scope = ndn::nfd::FACE_SCOPE_NON_LOCAL,
ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
ndn::nfd::LinkType linkType = ndn::nfd::LINK_TYPE_POINT_TO_POINT,
- ssize_t mtu = MTU_UNLIMITED,
- ssize_t sendQueueCapacity = QUEUE_UNSUPPORTED)
+ ssize_t mtu = face::MTU_UNLIMITED,
+ ssize_t sendQueueCapacity = face::QUEUE_UNSUPPORTED)
: NullTransport(FaceUri(localUri), FaceUri(remoteUri), scope, persistency)
{
this->setLinkType(linkType);
@@ -110,8 +108,6 @@
using DummyTransport = DummyTransportBase<true>;
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_DUMMY_TRANSPORT_HPP
diff --git a/tests/daemon/face/ethernet-channel.t.cpp b/tests/daemon/face/ethernet-channel.t.cpp
index 753f36a..95bf034 100644
--- a/tests/daemon/face/ethernet-channel.t.cpp
+++ b/tests/daemon/face/ethernet-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,9 @@
#include "tests/test-common.hpp"
#include "ethernet-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::EthernetChannel;
class EthernetChannelFixture : public EthernetFixture
{
@@ -99,6 +99,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestEthernetChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/ethernet-factory.t.cpp b/tests/daemon/face/ethernet-factory.t.cpp
index 269c79f..b6d2516 100644
--- a/tests/daemon/face/ethernet-factory.t.cpp
+++ b/tests/daemon/face/ethernet-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,9 +31,9 @@
#include <boost/algorithm/string/replace.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::EthernetFactory;
class EthernetFactoryFixture : public EthernetFixture
, public FaceSystemFactoryFixture<EthernetFactory>
@@ -548,6 +548,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestEthernetFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/ethernet-fixture.hpp b/tests/daemon/face/ethernet-fixture.hpp
index 0c98c72..915b2c0 100644
--- a/tests/daemon/face/ethernet-fixture.hpp
+++ b/tests/daemon/face/ethernet-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,13 +32,14 @@
#include "tests/daemon/limited-io.hpp"
#include "test-netif.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using face::EthernetTransport;
+using face::MulticastEthernetTransport;
+using face::UnicastEthernetTransport;
-/** \brief Fixture providing a list of EthernetTransport-capable network interfaces.
+/**
+ * \brief Fixture providing a list of EthernetTransport-capable network interfaces.
*/
class EthernetFixture : public virtual GlobalIoFixture
{
@@ -48,8 +49,8 @@
for (const auto& netif : collectNetworkInterfaces()) {
if (!netif->isLoopback() && netif->isUp()) {
try {
- MulticastEthernetTransport transport(*netif, ethernet::getBroadcastAddress(),
- ndn::nfd::LINK_TYPE_MULTI_ACCESS);
+ MulticastEthernetTransport t(*netif, ethernet::getBroadcastAddress(),
+ ndn::nfd::LINK_TYPE_MULTI_ACCESS);
netifs.push_back(netif);
}
catch (const EthernetTransport::Error&) {
@@ -121,6 +122,8 @@
ethernet::Address remoteEp;
};
+} // namespace nfd::tests
+
#define SKIP_IF_ETHERNET_NETIF_COUNT_LT(n) \
do { \
if (this->netifs.size() < (n)) { \
@@ -139,8 +142,4 @@
} \
} while (false)
-} // namespace tests
-} // namespace face
-} // namespace nfd
-
#endif // NFD_TESTS_DAEMON_FACE_ETHERNET_FIXTURE_HPP
diff --git a/tests/daemon/face/face-system-fixture.hpp b/tests/daemon/face/face-system-fixture.hpp
index de3aca8..1891a97 100644
--- a/tests/daemon/face/face-system-fixture.hpp
+++ b/tests/daemon/face/face-system-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,11 +37,7 @@
#include <ndn-cxx/net/network-monitor-stub.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
class FaceSystemFixture : public virtual GlobalIoFixture
{
@@ -140,10 +136,11 @@
FaceTable faceTable;
shared_ptr<ndn::net::NetworkMonitorStub> netmon;
FaceSystem faceSystem;
- NetdevBound& netdevBound;
+ face::NetdevBound& netdevBound;
};
-/** \brief FaceSystemFixture with a ProtocolFactory reference
+/**
+ * \brief FaceSystemFixture with a ProtocolFactory reference
*/
template<typename FactoryType>
class FaceSystemFactoryFixture : public FaceSystemFixture
@@ -158,9 +155,10 @@
FactoryType& factory;
};
-/** \brief A dummy ProtocolFactory for testing FaceSystem configuration parsing.
+/**
+ * \brief A dummy ProtocolFactory for testing FaceSystem configuration parsing.
*/
-class DummyProtocolFactory : public ProtocolFactory
+class DummyProtocolFactory : public face::ProtocolFactory
{
public:
using ProtocolFactory::ProtocolFactory;
@@ -188,8 +186,6 @@
std::set<std::string> newProvidedSchemes;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_FACE_SYSTEM_FIXTURE_HPP
diff --git a/tests/daemon/face/face-system.t.cpp b/tests/daemon/face/face-system.t.cpp
index a7be4c8..336aa11 100644
--- a/tests/daemon/face/face-system.t.cpp
+++ b/tests/daemon/face/face-system.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,9 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestFaceSystem, FaceSystemFixture)
@@ -164,6 +164,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceSystem
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/face.t.cpp b/tests/daemon/face/face.t.cpp
index bcaa90a..34a19a7 100644
--- a/tests/daemon/face/face.t.cpp
+++ b/tests/daemon/face/face.t.cpp
@@ -31,11 +31,9 @@
#include "dummy-face.hpp"
#include "dummy-transport.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestFace, GlobalIoFixture)
@@ -149,6 +147,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFace
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/factory-test-common.hpp b/tests/daemon/face/factory-test-common.hpp
index 4e65d34..1c7252e 100644
--- a/tests/daemon/face/factory-test-common.hpp
+++ b/tests/daemon/face/factory-test-common.hpp
@@ -30,9 +30,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
struct CreateFaceExpectedResult
{
@@ -42,46 +40,44 @@
};
inline void
-createFace(ProtocolFactory& factory,
+createFace(face::ProtocolFactory& factory,
const FaceUri& remoteUri,
const std::optional<FaceUri>& localUri,
- const FaceParams& params,
+ const face::FaceParams& params,
const CreateFaceExpectedResult& expected,
const std::function<void(const Face&)>& extraChecks = nullptr)
{
factory.createFace({remoteUri, localUri, params},
- [expected, extraChecks] (const shared_ptr<Face>& face) {
- BOOST_CHECK_EQUAL(CreateFaceExpectedResult::SUCCESS, expected.result);
+ [result = expected.result, extraChecks] (const auto& face) {
+ BOOST_CHECK_EQUAL(CreateFaceExpectedResult::SUCCESS, result);
if (extraChecks) {
extraChecks(*face);
}
},
- [expected] (uint32_t actualStatus, const std::string& actualReason) {
+ [expected] (uint32_t actualStatus, const auto& actualReason) {
BOOST_CHECK_EQUAL(CreateFaceExpectedResult::FAILURE, expected.result);
BOOST_CHECK_EQUAL(actualStatus, expected.status);
BOOST_CHECK_EQUAL(actualReason, expected.reason);
});
}
-/** \brief check that channels in a factory equal given channel URIs
+/**
+ * \brief Check that channels in a factory equal given channel URIs
*/
inline void
-checkChannelListEqual(const ProtocolFactory& factory, const std::set<std::string>& channelUris)
+checkChannelListEqual(const face::ProtocolFactory& factory, std::set<std::string> expectedUris)
{
- std::set<std::string> expected(channelUris); // make a copy so we can erase as we go
for (const auto& channel : factory.getChannels()) {
- std::string uri = channel->getUri().toString();
- if (expected.erase(uri) == 0) {
+ auto uri = channel->getUri().toString();
+ if (expectedUris.erase(uri) == 0) {
BOOST_ERROR("Unexpected channel " << uri);
}
}
- for (const auto& uri : expected) {
+ for (const auto& uri : expectedUris) {
BOOST_ERROR("Missing channel " << uri);
}
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_FACTORY_TEST_COMMON_HPP
diff --git a/tests/daemon/face/generic-link-service.t.cpp b/tests/daemon/face/generic-link-service.t.cpp
index e4f0425..06d9417 100644
--- a/tests/daemon/face/generic-link-service.t.cpp
+++ b/tests/daemon/face/generic-link-service.t.cpp
@@ -35,11 +35,9 @@
#include <ndn-cxx/lp/prefix-announcement-header.hpp>
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
@@ -1470,6 +1468,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestGenericLinkService
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/internal-face.t.cpp b/tests/daemon/face/internal-face.t.cpp
index 1f2b82a..5c57341 100644
--- a/tests/daemon/face/internal-face.t.cpp
+++ b/tests/daemon/face/internal-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,11 +29,9 @@
#include "tests/key-chain-fixture.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
@@ -218,6 +216,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestInternalFace
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/lp-fragmenter.t.cpp b/tests/daemon/face/lp-fragmenter.t.cpp
index 8bd48c2..065fc6d 100644
--- a/tests/daemon/face/lp-fragmenter.t.cpp
+++ b/tests/daemon/face/lp-fragmenter.t.cpp
@@ -27,11 +27,9 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
class LpFragmenterFixture
{
@@ -174,6 +172,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestLpFragmentation
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/lp-reassembler.t.cpp b/tests/daemon/face/lp-reassembler.t.cpp
index 8e8bbce..16a3592 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-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,11 +28,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
class LpReassemblerFixture : public GlobalIoTimeFixture
{
@@ -41,7 +39,7 @@
{
reassembler.beforeTimeout.connect(
[this] (EndpointId remoteEp, size_t nDroppedFragments) {
- timeoutHistory.push_back({remoteEp, nDroppedFragments});
+ timeoutHistory.emplace_back(remoteEp, nDroppedFragments);
});
}
@@ -49,12 +47,10 @@
LpReassembler reassembler{{}};
std::vector<std::pair<EndpointId, size_t>> timeoutHistory;
- static const uint8_t data[10];
-};
-
-const uint8_t LpReassemblerFixture::data[10] = {
- 0x06, 0x08, // Data
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ static constexpr uint8_t data[] = {
+ 0x06, 0x08, // Data
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ };
};
BOOST_AUTO_TEST_SUITE(Face)
@@ -517,6 +513,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestLpReassembler
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index 0d891e0..81c28e0 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -35,11 +35,9 @@
#include <cstring>
#include <unordered_set>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
class DummyLpReliabilityLinkService : public GenericLinkService
{
@@ -1043,6 +1041,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestLpReliability
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/multicast-ethernet-transport.t.cpp b/tests/daemon/face/multicast-ethernet-transport.t.cpp
index 84dead4..bff61c7 100644
--- a/tests/daemon/face/multicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/multicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,9 @@
#include "common/global.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestMulticastEthernetTransport, EthernetFixture)
@@ -140,6 +140,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMulticastEthernetTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/multicast-udp-transport-fixture.hpp b/tests/daemon/face/multicast-udp-transport-fixture.hpp
index 99d039c..959ca9c 100644
--- a/tests/daemon/face/multicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/multicast-udp-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,26 +33,15 @@
#include "tests/daemon/limited-io.hpp"
#include "tests/daemon/face/dummy-link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
namespace ip = boost::asio::ip;
using ip::udp;
+using face::MulticastUdpTransport;
class MulticastUdpTransportFixture : public GlobalIoFixture
{
protected:
- MulticastUdpTransportFixture()
- : transport(nullptr)
- , txPort(7001)
- , receivedPackets(nullptr)
- , remoteSockRx(g_io)
- , remoteSockTx(g_io)
- {
- }
-
void
initialize(ip::address address)
{
@@ -84,7 +73,7 @@
transport = static_cast<MulticastUdpTransport*>(face->getTransport());
receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
- BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+ BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
void
@@ -120,20 +109,18 @@
protected:
LimitedIo limitedIo;
- MulticastUdpTransport* transport;
+ MulticastUdpTransport* transport = nullptr;
udp::endpoint mcastEp;
- uint16_t txPort;
- std::vector<RxPacket>* receivedPackets;
+ uint16_t txPort = 7001;
+ std::vector<RxPacket>* receivedPackets = nullptr;
private:
unique_ptr<Face> face;
udp::endpoint remoteMcastEp;
- udp::socket remoteSockRx;
- udp::socket remoteSockTx;
+ udp::socket remoteSockRx{g_io};
+ udp::socket remoteSockTx{g_io};
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/multicast-udp-transport.t.cpp b/tests/daemon/face/multicast-udp-transport.t.cpp
index 636bdc5..f32d30f 100644
--- a/tests/daemon/face/multicast-udp-transport.t.cpp
+++ b/tests/daemon/face/multicast-udp-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
@@ -114,6 +114,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMulticastUdpTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/netdev-bound.t.cpp b/tests/daemon/face/netdev-bound.t.cpp
index 9f71fc1..ede55c3 100644
--- a/tests/daemon/face/netdev-bound.t.cpp
+++ b/tests/daemon/face/netdev-bound.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,9 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestNetdevBound, FaceSystemFixture)
@@ -111,6 +111,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNetdevBound
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/network-predicate.t.cpp b/tests/daemon/face/network-predicate.t.cpp
index 73e29c6..05094fc 100644
--- a/tests/daemon/face/network-predicate.t.cpp
+++ b/tests/daemon/face/network-predicate.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,9 +34,7 @@
#include <boost/property_tree/info_parser.hpp>
#include <sstream>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestNetworkPredicate)
@@ -66,7 +64,7 @@
T predicate;
};
-class NetworkInterfacePredicateFixture : public NetworkPredicateBaseFixture<NetworkInterfacePredicate>
+class NetworkInterfacePredicateFixture : public NetworkPredicateBaseFixture<face::NetworkInterfacePredicate>
{
protected:
NetworkInterfacePredicateFixture()
@@ -377,7 +375,7 @@
BOOST_AUTO_TEST_SUITE_END() // NetworkInterface
-class IpAddressPredicateFixture : public NetworkPredicateBaseFixture<IpAddressPredicate>
+class IpAddressPredicateFixture : public NetworkPredicateBaseFixture<face::IpAddressPredicate>
{
protected:
IpAddressPredicateFixture()
@@ -512,6 +510,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNetworkPredicate
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/null-face.t.cpp b/tests/daemon/face/null-face.t.cpp
index 4a5f539..ad5e4cf 100644
--- a/tests/daemon/face/null-face.t.cpp
+++ b/tests/daemon/face/null-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,11 +29,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "transport-test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestNullFace, GlobalIoFixture)
@@ -102,6 +100,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNullFace
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/stream-transport.t.cpp b/tests/daemon/face/stream-transport.t.cpp
index c8fa82b..80524b5 100644
--- a/tests/daemon/face/stream-transport.t.cpp
+++ b/tests/daemon/face/stream-transport.t.cpp
@@ -30,9 +30,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestStreamTransport)
@@ -236,6 +236,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStreamTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-channel-fixture.hpp b/tests/daemon/face/tcp-channel-fixture.hpp
index ab8d431..b6eb99c 100644
--- a/tests/daemon/face/tcp-channel-fixture.hpp
+++ b/tests/daemon/face/tcp-channel-fixture.hpp
@@ -31,9 +31,9 @@
#include "channel-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::TcpChannel;
class TcpChannelFixture : public ChannelFixture<TcpChannel, tcp::Endpoint>
{
@@ -83,11 +83,9 @@
protected:
std::vector<shared_ptr<Face>> clientFaces;
- IpAddressPredicate local;
+ face::IpAddressPredicate local;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_TCP_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/tcp-channel.t.cpp b/tests/daemon/face/tcp-channel.t.cpp
index 6789966..9f838c4 100644
--- a/tests/daemon/face/tcp-channel.t.cpp
+++ b/tests/daemon/face/tcp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,11 +26,10 @@
#include "tcp-channel-fixture.hpp"
#include "test-ip.hpp"
+
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestTcpChannel, TcpChannelFixture)
@@ -64,6 +63,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-factory.t.cpp b/tests/daemon/face/tcp-factory.t.cpp
index a6335f9..2547e30 100644
--- a/tests/daemon/face/tcp-factory.t.cpp
+++ b/tests/daemon/face/tcp-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,10 @@
#include "factory-test-common.hpp"
#include "tests/daemon/limited-io.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::TcpChannel;
+using face::TcpFactory;
class TcpFactoryFixture : public FaceSystemFactoryFixture<TcpFactory>
{
@@ -175,7 +176,7 @@
BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_LOCAL);
});
- limitedIo.run(1, 100_ms);
+ limitedIo.defer(100_ms);
}
BOOST_AUTO_TEST_CASE(ConfigureNonLocal)
@@ -217,7 +218,7 @@
BOOST_CHECK_EQUAL(face.getScope(), ndn::nfd::FACE_SCOPE_NON_LOCAL);
});
- limitedIo.run(1, 100_ms);
+ limitedIo.defer(100_ms);
}
BOOST_AUTO_TEST_CASE(Omitted)
@@ -468,6 +469,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-transport-fixture.hpp b/tests/daemon/face/tcp-transport-fixture.hpp
index 4b382a8..2ea4a2b 100644
--- a/tests/daemon/face/tcp-transport-fixture.hpp
+++ b/tests/daemon/face/tcp-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,25 +33,15 @@
#include "tests/daemon/limited-io.hpp"
#include "tests/daemon/face/dummy-link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
namespace ip = boost::asio::ip;
using ip::tcp;
+using face::TcpTransport;
class TcpTransportFixture : public GlobalIoFixture
{
protected:
- TcpTransportFixture()
- : transport(nullptr)
- , remoteSocket(g_io)
- , receivedPackets(nullptr)
- , acceptor(g_io)
- {
- }
-
void
startAccept(const tcp::endpoint& remoteEp)
{
@@ -103,7 +93,7 @@
transport = static_cast<TcpTransport*>(face->getTransport());
receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
- BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+ BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
void
@@ -120,18 +110,16 @@
protected:
LimitedIo limitedIo;
- TcpTransport* transport;
+ TcpTransport* transport = nullptr;
tcp::endpoint localEp;
- tcp::socket remoteSocket;
- std::vector<RxPacket>* receivedPackets;
+ tcp::socket remoteSocket{g_io};
+ std::vector<RxPacket>* receivedPackets = nullptr;
private:
- tcp::acceptor acceptor;
+ tcp::acceptor acceptor{g_io};
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_TCP_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/tcp-transport.t.cpp b/tests/daemon/face/tcp-transport.t.cpp
index c01aaef..3d86064 100644
--- a/tests/daemon/face/tcp-transport.t.cpp
+++ b/tests/daemon/face/tcp-transport.t.cpp
@@ -29,9 +29,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestTcpTransport, IpTransportFixture<TcpTransportFixture>)
@@ -234,6 +234,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/tcp-udp-channel.t.cpp b/tests/daemon/face/tcp-udp-channel.t.cpp
index 020c954..6a29660 100644
--- a/tests/daemon/face/tcp-udp-channel.t.cpp
+++ b/tests/daemon/face/tcp-udp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,11 +27,10 @@
#include "udp-channel-fixture.hpp"
#include "test-ip.hpp"
+
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestTcpUdpChannel)
@@ -150,6 +149,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTcpUdpChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/test-ip.cpp b/tests/daemon/face/test-ip.cpp
index 3e75d8c..593797e 100644
--- a/tests/daemon/face/test-ip.cpp
+++ b/tests/daemon/face/test-ip.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,7 @@
#include "test-ip.hpp"
#include "test-netif.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
std::ostream&
operator<<(std::ostream& os, AddressFamily family)
@@ -106,6 +104,4 @@
return {};
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/test-ip.hpp b/tests/daemon/face/test-ip.hpp
index 1b8604e..c2bb8ca 100644
--- a/tests/daemon/face/test-ip.hpp
+++ b/tests/daemon/face/test-ip.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,9 +31,7 @@
#include <boost/asio/ip/address.hpp>
#include <ndn-cxx/net/network-address.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
enum class AddressFamily {
V4 = static_cast<int>(ndn::net::AddressFamily::V4),
@@ -92,9 +90,11 @@
AddressScope scope = AddressScope::Any,
MulticastInterface mcast = MulticastInterface::Any);
+} // namespace nfd::tests
+
/** \brief Skip the rest of the test case if \p address is unavailable
*
- * This macro can be used in conjunction with nfd::tests::getTestIp in a test case. Example:
+ * This macro can be used in conjunction with nfd::tests::getTestIp() in a test case. Example:
* \code
* BOOST_AUTO_TEST_CASE(TestCase)
* {
@@ -112,8 +112,4 @@
} \
} while (false)
-} // namespace tests
-} // namespace face
-} // namespace nfd
-
#endif // NFD_TESTS_DAEMON_FACE_TEST_IP_HPP
diff --git a/tests/daemon/face/test-netif.cpp b/tests/daemon/face/test-netif.cpp
index 36719ad..1a2752b 100644
--- a/tests/daemon/face/test-netif.cpp
+++ b/tests/daemon/face/test-netif.cpp
@@ -26,9 +26,7 @@
#include "test-netif.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
std::vector<shared_ptr<const NetworkInterface>>
enumerateNetworkInterfaces(NetworkMonitor& netmon)
@@ -52,6 +50,4 @@
return *cached;
}
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/test-netif.hpp b/tests/daemon/face/test-netif.hpp
index 42820dd..a1e354e 100644
--- a/tests/daemon/face/test-netif.hpp
+++ b/tests/daemon/face/test-netif.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,9 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
#include <ndn-cxx/net/network-monitor.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
using ndn::net::NetworkAddress;
using ndn::net::NetworkInterface;
@@ -56,8 +54,6 @@
std::vector<shared_ptr<const NetworkInterface>>
collectNetworkInterfaces(bool allowCached = true);
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_TEST_NETIF_HPP
diff --git a/tests/daemon/face/transport-test-common.hpp b/tests/daemon/face/transport-test-common.hpp
index fa3e4bd..34133a1 100644
--- a/tests/daemon/face/transport-test-common.hpp
+++ b/tests/daemon/face/transport-test-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,9 +30,7 @@
#include "tests/test-common.hpp"
#include "test-ip.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
/** \brief Check that a transport has all its static properties set after initialization
*
@@ -42,14 +40,14 @@
* Thus, if a transport forgets to set a static property, this check would fail.
*/
inline void
-checkStaticPropertiesInitialized(const Transport& transport)
+checkStaticPropertiesInitialized(const face::Transport& transport)
{
BOOST_CHECK(!transport.getLocalUri().getScheme().empty());
BOOST_CHECK(!transport.getRemoteUri().getScheme().empty());
BOOST_CHECK_NE(transport.getScope(), ndn::nfd::FACE_SCOPE_NONE);
BOOST_CHECK_NE(transport.getPersistency(), ndn::nfd::FACE_PERSISTENCY_NONE);
BOOST_CHECK_NE(transport.getLinkType(), ndn::nfd::LINK_TYPE_NONE);
- BOOST_CHECK_NE(transport.getMtu(), MTU_INVALID);
+ BOOST_CHECK_NE(transport.getMtu(), face::MTU_INVALID);
}
/** \brief Generic wrapper for transport fixtures that require an IP address
@@ -69,7 +67,7 @@
" TestIp=" << address);
}
- std::pair<bool, std::string>
+ [[nodiscard]] std::pair<bool, std::string>
checkPreconditions() const
{
return {!address.is_unspecified(), "no appropriate IP address available"};
@@ -88,9 +86,7 @@
const boost::asio::ip::address address = getTestIp(AF, AS, MC);
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#define GENERATE_IP_TRANSPORT_FIXTURE_INSTANTIATIONS(F) \
IpTransportFixture<F, AddressFamily::V4, AddressScope::Loopback>, \
@@ -101,9 +97,9 @@
#define TRANSPORT_TEST_CHECK_PRECONDITIONS() \
do { \
- auto result = this->checkPreconditions(); \
- if (!result.first) { \
- BOOST_WARN_MESSAGE(false, "skipping test case: " << result.second); \
+ auto [ok, reason] = this->checkPreconditions(); \
+ if (!ok) { \
+ BOOST_WARN_MESSAGE(false, "skipping test case: " << reason); \
return; \
} \
} while (false)
diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp
index 7e650dd..9545b83 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-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -40,12 +40,10 @@
#include <boost/mpl/set.hpp>
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
namespace mpl = boost::mpl;
-using namespace nfd::tests;
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_AUTO_TEST_SUITE(TestTransport)
@@ -145,8 +143,8 @@
{
auto transport = make_unique<DummyTransport>();
- TransportState from = static_cast<TransportState>(T::first::value);
- TransportState to = static_cast<TransportState>(T::second::value);
+ auto from = static_cast<TransportState>(T::first::value);
+ auto to = static_cast<TransportState>(T::second::value);
BOOST_TEST_MESSAGE("SetState " << from << " -> " << to);
// enter from state
@@ -248,6 +246,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/udp-channel-fixture.hpp b/tests/daemon/face/udp-channel-fixture.hpp
index ac30738..a314a8c 100644
--- a/tests/daemon/face/udp-channel-fixture.hpp
+++ b/tests/daemon/face/udp-channel-fixture.hpp
@@ -31,9 +31,9 @@
#include "channel-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::UdpChannel;
class UdpChannelFixture : public ChannelFixture<UdpChannel, udp::Endpoint>
{
@@ -69,8 +69,6 @@
std::vector<shared_ptr<Face>> clientFaces;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_UDP_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/udp-channel.t.cpp b/tests/daemon/face/udp-channel.t.cpp
index b61e5af..d36e2f5 100644
--- a/tests/daemon/face/udp-channel.t.cpp
+++ b/tests/daemon/face/udp-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,11 +26,10 @@
#include "udp-channel-fixture.hpp"
#include "test-ip.hpp"
+
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUdpChannel, UdpChannelFixture)
@@ -64,6 +63,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUdpChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/udp-factory.t.cpp b/tests/daemon/face/udp-factory.t.cpp
index e2788f5..c243ddc 100644
--- a/tests/daemon/face/udp-factory.t.cpp
+++ b/tests/daemon/face/udp-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,9 +30,10 @@
#include <boost/algorithm/string/replace.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::UdpChannel;
+using face::UdpFactory;
class UdpFactoryFixture : public FaceSystemFactoryFixture<UdpFactory>
{
@@ -1114,6 +1115,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUdpFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unicast-ethernet-transport.t.cpp b/tests/daemon/face/unicast-ethernet-transport.t.cpp
index 79a0f38..54c262d 100644
--- a/tests/daemon/face/unicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/unicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,9 @@
#include "common/global.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnicastEthernetTransport, EthernetFixture)
@@ -180,6 +180,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnicastEthernetTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unicast-udp-transport-fixture.hpp b/tests/daemon/face/unicast-udp-transport-fixture.hpp
index ce9006d..e7fb76d 100644
--- a/tests/daemon/face/unicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/unicast-udp-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,24 +33,15 @@
#include "tests/daemon/limited-io.hpp"
#include "tests/daemon/face/dummy-link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
namespace ip = boost::asio::ip;
using ip::udp;
+using face::UnicastUdpTransport;
class UnicastUdpTransportFixture : public GlobalIoFixture
{
protected:
- UnicastUdpTransportFixture()
- : transport(nullptr)
- , remoteSocket(g_io)
- , receivedPackets(nullptr)
- {
- }
-
void
initialize(ip::address address,
ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT)
@@ -66,7 +57,7 @@
transport = static_cast<UnicastUdpTransport*>(face->getTransport());
receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
- BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+ BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
void
@@ -106,17 +97,15 @@
protected:
LimitedIo limitedIo;
- UnicastUdpTransport* transport;
+ UnicastUdpTransport* transport = nullptr;
udp::endpoint localEp;
- udp::socket remoteSocket;
- std::vector<RxPacket>* receivedPackets;
+ udp::socket remoteSocket{g_io};
+ std::vector<RxPacket>* receivedPackets = nullptr;
private:
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_UNICAST_UDP_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/unicast-udp-transport.t.cpp b/tests/daemon/face/unicast-udp-transport.t.cpp
index 24d47fd..bb5605e 100644
--- a/tests/daemon/face/unicast-udp-transport.t.cpp
+++ b/tests/daemon/face/unicast-udp-transport.t.cpp
@@ -30,9 +30,9 @@
#include <boost/mpl/vector.hpp>
#include <boost/mpl/vector_c.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnicastUdpTransport, IpTransportFixture<UnicastUdpTransportFixture>)
@@ -177,6 +177,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnicastUdpTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unix-stream-channel.t.cpp b/tests/daemon/face/unix-stream-channel.t.cpp
index fa9e480..e4ce0cf 100644
--- a/tests/daemon/face/unix-stream-channel.t.cpp
+++ b/tests/daemon/face/unix-stream-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,12 +30,11 @@
#include <boost/filesystem.hpp>
#include <fstream>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
namespace fs = boost::filesystem;
namespace local = boost::asio::local;
+using face::UnixStreamChannel;
class UnixStreamChannelFixture : public ChannelFixture<UnixStreamChannel, unix_stream::Endpoint>
{
@@ -176,6 +175,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnixStreamChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unix-stream-factory.t.cpp b/tests/daemon/face/unix-stream-factory.t.cpp
index dd6f5cf..2554b25 100644
--- a/tests/daemon/face/unix-stream-factory.t.cpp
+++ b/tests/daemon/face/unix-stream-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,17 +28,17 @@
#include "face-system-fixture.hpp"
#include "factory-test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::UnixStreamFactory;
using UnixStreamFactoryFixture = FaceSystemFactoryFixture<UnixStreamFactory>;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnixStreamFactory, UnixStreamFactoryFixture)
-static const std::string CHANNEL_PATH1("unix-stream-test.1.sock");
-static const std::string CHANNEL_PATH2("unix-stream-test.2.sock");
+const std::string CHANNEL_PATH1("unix-stream-test.1.sock");
+const std::string CHANNEL_PATH2("unix-stream-test.2.sock");
BOOST_AUTO_TEST_SUITE(ProcessConfig)
@@ -145,6 +145,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnixStreamFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/unix-stream-transport-fixture.hpp b/tests/daemon/face/unix-stream-transport-fixture.hpp
index 6724085..9603247 100644
--- a/tests/daemon/face/unix-stream-transport-fixture.hpp
+++ b/tests/daemon/face/unix-stream-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -35,14 +35,13 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
-typedef boost::asio::local::stream_protocol unix_stream;
+using unix_stream = boost::asio::local::stream_protocol;
+using face::UnixStreamTransport;
-/** \brief automatically unlinks the socket file of a Unix stream acceptor
+/**
+ * \brief Automatically unlinks the socket file of a Unix stream acceptor
*/
class AcceptorWithCleanup : public unix_stream::acceptor
{
@@ -117,7 +116,7 @@
transport = static_cast<UnixStreamTransport*>(face->getTransport());
receivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
- BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+ BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
void
@@ -144,8 +143,6 @@
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_UNIX_STREAM_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/unix-stream-transport.t.cpp b/tests/daemon/face/unix-stream-transport.t.cpp
index 8eebb60..41acb0b 100644
--- a/tests/daemon/face/unix-stream-transport.t.cpp
+++ b/tests/daemon/face/unix-stream-transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,9 +27,9 @@
#include "unix-stream-transport-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestUnixStreamTransport, UnixStreamTransportFixture)
@@ -63,6 +63,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnixStreamTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/websocket-channel-fixture.hpp b/tests/daemon/face/websocket-channel-fixture.hpp
index 62c717b..dc9a232 100644
--- a/tests/daemon/face/websocket-channel-fixture.hpp
+++ b/tests/daemon/face/websocket-channel-fixture.hpp
@@ -30,9 +30,9 @@
#include "channel-fixture.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::WebSocketChannel;
class WebSocketChannelFixture : public ChannelFixture<WebSocketChannel, websocket::Endpoint>
{
@@ -153,8 +153,6 @@
time::steady_clock::time_point m_prevPingRecvTime;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_WEBSOCKET_CHANNEL_FIXTURE_HPP
diff --git a/tests/daemon/face/websocket-channel.t.cpp b/tests/daemon/face/websocket-channel.t.cpp
index 5772daa..a396530 100644
--- a/tests/daemon/face/websocket-channel.t.cpp
+++ b/tests/daemon/face/websocket-channel.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,9 +30,7 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestWebSocketChannel, WebSocketChannelFixture)
@@ -199,9 +197,9 @@
2_s), LimitedIo::EXCEED_OPS);
BOOST_CHECK_EQUAL(listenerChannel->size(), 0);
- auto transport = static_cast<WebSocketTransport*>(listenerFaces.at(0)->getTransport());
- BOOST_CHECK(transport->getState() == TransportState::FAILED ||
- transport->getState() == TransportState::CLOSED);
+ auto transport = static_cast<face::WebSocketTransport*>(listenerFaces.at(0)->getTransport());
+ BOOST_CHECK(transport->getState() == face::TransportState::FAILED ||
+ transport->getState() == face::TransportState::CLOSED);
BOOST_CHECK_GE(transport->getCounters().nOutPings, 1);
BOOST_CHECK_LE(transport->getCounters().nOutPings, 2);
BOOST_CHECK_EQUAL(transport->getCounters().nInPongs, 0);
@@ -210,6 +208,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestWebSocketChannel
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/websocket-factory.t.cpp b/tests/daemon/face/websocket-factory.t.cpp
index b684cee..5043d87 100644
--- a/tests/daemon/face/websocket-factory.t.cpp
+++ b/tests/daemon/face/websocket-factory.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,10 @@
#include "face-system-fixture.hpp"
#include "factory-test-common.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using face::WebSocketChannel;
+using face::WebSocketFactory;
class WebSocketFactoryFixture : public FaceSystemFactoryFixture<WebSocketFactory>
{
@@ -316,6 +317,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestWebSocketFactory
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/face/websocket-transport-fixture.hpp b/tests/daemon/face/websocket-transport-fixture.hpp
index b1700ed..2e1e61e 100644
--- a/tests/daemon/face/websocket-transport-fixture.hpp
+++ b/tests/daemon/face/websocket-transport-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,25 +33,16 @@
#include "tests/daemon/limited-io.hpp"
#include "tests/daemon/face/dummy-link-service.hpp"
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
namespace ip = boost::asio::ip;
+using face::WebSocketTransport;
/** \brief a fixture that accepts a single WebSocket connection from a client
*/
class WebSocketTransportFixture : public GlobalIoFixture
{
protected:
- WebSocketTransportFixture()
- : transport(nullptr)
- , serverReceivedPackets(nullptr)
- , clientShouldPong(true)
- {
- }
-
/** \brief initialize server and start listening
*/
void
@@ -114,7 +105,7 @@
transport = static_cast<WebSocketTransport*>(face->getTransport());
serverReceivedPackets = &static_cast<DummyLinkService*>(face->getLinkService())->receivedPackets;
- BOOST_REQUIRE_EQUAL(transport->getState(), TransportState::UP);
+ BOOST_REQUIRE_EQUAL(transport->getState(), face::TransportState::UP);
}
private:
@@ -202,20 +193,18 @@
websocket::Server server;
websocketpp::connection_hdl serverHdl;
ip::tcp::endpoint remoteEp;
- WebSocketTransport* transport;
- std::vector<RxPacket>* serverReceivedPackets;
+ WebSocketTransport* transport = nullptr;
+ std::vector<RxPacket>* serverReceivedPackets = nullptr;
websocket::Client client;
websocketpp::connection_hdl clientHdl;
- bool clientShouldPong;
+ bool clientShouldPong = true;
std::vector<std::string> clientReceivedMessages;
private:
unique_ptr<Face> face;
};
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FACE_WEBSOCKET_TRANSPORT_FIXTURE_HPP
diff --git a/tests/daemon/face/websocket-transport.t.cpp b/tests/daemon/face/websocket-transport.t.cpp
index 008a41f..fe79de9 100644
--- a/tests/daemon/face/websocket-transport.t.cpp
+++ b/tests/daemon/face/websocket-transport.t.cpp
@@ -29,9 +29,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace face {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::face;
BOOST_AUTO_TEST_SUITE(Face)
BOOST_FIXTURE_TEST_SUITE(TestWebSocketTransport, IpTransportFixture<WebSocketTransportFixture>)
@@ -260,6 +260,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestWebSocketTransport
BOOST_AUTO_TEST_SUITE_END() // Face
-} // namespace tests
-} // namespace face
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/access-strategy.t.cpp b/tests/daemon/fw/access-strategy.t.cpp
index cb55cca..6664a16 100644
--- a/tests/daemon/fw/access-strategy.t.cpp
+++ b/tests/daemon/fw/access-strategy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,12 +28,10 @@
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
// The tester is unused in this file, but it's used in various templated test suites.
-using AccessStrategyTester = StrategyTester<AccessStrategy>;
+using AccessStrategyTester = StrategyTester<fw::AccessStrategy>;
NFD_REGISTER_STRATEGY(AccessStrategyTester);
// This test suite tests AccessStrategy's behavior as a black box,
@@ -371,6 +369,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestAccessStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index d0bd2f0..ab00f2b 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -29,11 +29,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestAlgorithm, GlobalIoFixture)
@@ -205,6 +203,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitAlgorithm
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/asf-measurements.t.cpp b/tests/daemon/fw/asf-measurements.t.cpp
index 92f1884..4de0493 100644
--- a/tests/daemon/fw/asf-measurements.t.cpp
+++ b/tests/daemon/fw/asf-measurements.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,19 +29,14 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestAsfMeasurements)
BOOST_FIXTURE_TEST_CASE(FaceInfo, GlobalIoTimeFixture)
{
- using asf::FaceInfo;
+ using fw::asf::FaceInfo;
FaceInfo info(nullptr);
BOOST_CHECK_EQUAL(info.getLastRtt(), FaceInfo::RTT_NO_MEASUREMENT);
@@ -79,7 +74,7 @@
BOOST_FIXTURE_TEST_CASE(NamespaceInfo, GlobalIoTimeFixture)
{
- using asf::NamespaceInfo;
+ using fw::asf::NamespaceInfo;
NamespaceInfo info(nullptr);
BOOST_CHECK(info.getFaceInfo(1234) == nullptr);
@@ -87,14 +82,11 @@
auto& faceInfo = info.getOrCreateFaceInfo(1234);
BOOST_CHECK(info.getFaceInfo(1234) == &faceInfo);
- this->advanceClocks(AsfMeasurements::MEASUREMENTS_LIFETIME + 1_s);
+ this->advanceClocks(fw::asf::AsfMeasurements::MEASUREMENTS_LIFETIME + 1_s);
BOOST_CHECK(info.getFaceInfo(1234) == nullptr); // expired
}
BOOST_AUTO_TEST_SUITE_END() // TestAsfStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index e80a287..a853c79 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -28,12 +28,9 @@
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::fw::tests;
+using fw::AsfStrategy;
// The tester is unused in this file, but it's used in various templated test suites.
using AsfStrategyTester = StrategyTester<AsfStrategy>;
@@ -574,9 +571,9 @@
strategy = checkValidity("/max-timeouts~0", true);
BOOST_TEST(strategy->m_probing.getProbingInterval() == 60_s);
BOOST_TEST(strategy->m_nMaxTimeouts == 0);
- BOOST_TEST(strategy->m_retxSuppression->m_initialInterval == RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL);
- BOOST_TEST(strategy->m_retxSuppression->m_maxInterval == RetxSuppressionExponential::DEFAULT_MAX_INTERVAL);
- BOOST_TEST(strategy->m_retxSuppression->m_multiplier == RetxSuppressionExponential::DEFAULT_MULTIPLIER);
+ BOOST_TEST(strategy->m_retxSuppression->m_initialInterval == fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL);
+ BOOST_TEST(strategy->m_retxSuppression->m_maxInterval == fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL);
+ BOOST_TEST(strategy->m_retxSuppression->m_multiplier == fw::RetxSuppressionExponential::DEFAULT_MULTIPLIER);
checkValidity("/probing-interval~500", false); // minimum is 1 second
checkValidity("/probing-interval~-5000", false);
@@ -591,7 +588,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestAsfStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/best-route-strategy.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
index d829e98..efaf90c 100644
--- a/tests/daemon/fw/best-route-strategy.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.t.cpp
@@ -30,11 +30,9 @@
#include "tests/daemon/face/dummy-face.hpp"
#include "strategy-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using BestRouteStrategyTester = StrategyTester<BestRouteStrategy>;
+using BestRouteStrategyTester = StrategyTester<fw::BestRouteStrategy>;
NFD_REGISTER_STRATEGY(BestRouteStrategyTester);
BOOST_AUTO_TEST_SUITE(Fw)
@@ -83,7 +81,7 @@
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
const auto TICK = time::duration_cast<time::nanoseconds>(
- RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL * 0.1);
+ fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL * 0.1);
// first Interest goes to nexthop with lowest FIB cost,
// however face1 is downstream so it cannot be used
@@ -114,7 +112,7 @@
retxFrom4Evt = getScheduler().schedule(TICK * 5, periodicalRetxFrom4);
};
periodicalRetxFrom4();
- this->advanceClocks(TICK, RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
+ this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
retxFrom4Evt.cancel();
// nexthops for accepted retransmissions: follow FIB cost,
@@ -130,7 +128,7 @@
strategy.sendInterestHistory.clear();
for (int i = 0; i < 3; ++i) {
- this->advanceClocks(TICK, RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 2);
+ this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 2);
pitEntry->insertOrUpdateInRecord(*face5, *interest);
strategy.afterReceiveInterest(*interest, FaceEndpoint(*face5, 0), pitEntry);
}
@@ -144,6 +142,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestBestRouteStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/choose-strategy.hpp b/tests/daemon/fw/choose-strategy.hpp
index cfb5ee6..5416384 100644
--- a/tests/daemon/fw/choose-strategy.hpp
+++ b/tests/daemon/fw/choose-strategy.hpp
@@ -31,12 +31,11 @@
#include <boost/lexical_cast.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
class Strategy;
-} // namespace fw
+} // namespace nfd::fw
-namespace tests {
+namespace nfd::tests {
/** \brief choose the strategy for a namespace
* \tparam S strategy type, must be a complete type
@@ -60,7 +59,6 @@
return dynamic_cast<S&>(sc.findEffectiveStrategy(prefix));
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_CHOOSE_STRATEGY_HPP
diff --git a/tests/daemon/fw/dummy-strategy.cpp b/tests/daemon/fw/dummy-strategy.cpp
index 439efd1..a76b5e9 100644
--- a/tests/daemon/fw/dummy-strategy.cpp
+++ b/tests/daemon/fw/dummy-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "dummy-strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
NFD_REGISTER_STRATEGY(DummyStrategy);
@@ -106,5 +105,4 @@
Strategy::afterNewNextHop(nextHop, pitEntry);
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/dummy-strategy.hpp b/tests/daemon/fw/dummy-strategy.hpp
index f24d990..6785cc6 100644
--- a/tests/daemon/fw/dummy-strategy.hpp
+++ b/tests/daemon/fw/dummy-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,15 +28,15 @@
#include "fw/strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
-/** \brief Forwarding strategy for unit testing
+/**
+ * \brief Forwarding strategy for unit testing
*
- * Triggers are recorded but do nothing.
+ * Triggers are recorded but do nothing.
*
- * DummyStrategy registers itself as /dummy-strategy/<max-version>, so that it can be instantiated
- * with any version number. Aliases can be created with the registerAs() function.
+ * DummyStrategy registers itself as `/dummy-strategy/<max-version>`, so that it can be instantiated
+ * with any version number. Aliases can be created with the registerAs() function.
*/
class DummyStrategy : public fw::Strategy
{
@@ -111,7 +111,8 @@
shared_ptr<Face> interestOutFace;
};
-/** \brief DummyStrategy with specific version
+/**
+ * \brief DummyStrategy with specific version
*/
template<uint64_t VERSION>
class VersionedDummyStrategy : public DummyStrategy
@@ -141,7 +142,6 @@
}
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_DUMMY_STRATEGY_HPP
diff --git a/tests/daemon/fw/face-table.t.cpp b/tests/daemon/fw/face-table.t.cpp
index fc2e7ee..a76ceed 100644
--- a/tests/daemon/fw/face-table.t.cpp
+++ b/tests/daemon/fw/face-table.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestFaceTable, GlobalIoFixture)
@@ -140,5 +139,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceTable
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index eef2cea..98f767f 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -34,8 +34,7 @@
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class ForwarderFixture : public GlobalIoTimeFixture
{
@@ -881,5 +880,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestForwarder
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/forwarding-hint.t.cpp b/tests/daemon/fw/forwarding-hint.t.cpp
index d330395..ce7c414 100644
--- a/tests/daemon/fw/forwarding-hint.t.cpp
+++ b/tests/daemon/fw/forwarding-hint.t.cpp
@@ -28,11 +28,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
#define CHECK_FH_EQUAL(actual, ...) \
do { \
@@ -76,7 +72,7 @@
nodeS = topo.addForwarder("spurs");
nodeQ = topo.addForwarder("serverQ");
for (auto node : {nodeA, nodeH, nodeT, nodeP, nodeC, nodeS, nodeQ}) {
- topo.setStrategy<BestRouteStrategy>(node);
+ topo.setStrategy<fw::BestRouteStrategy>(node);
}
topo.getForwarder(nodeH).getNetworkRegionTable().insert("/arizona/cs/hobo");
@@ -192,6 +188,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestForwardingHint
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index dbb8e52..3b91c63 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -32,11 +32,9 @@
#include "strategy-tester.hpp"
#include "topology-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using MulticastStrategyTester = StrategyTester<MulticastStrategy>;
+using MulticastStrategyTester = StrategyTester<fw::MulticastStrategy>;
NFD_REGISTER_STRATEGY(MulticastStrategyTester);
class MulticastStrategyFixture : public GlobalIoTimeFixture
@@ -117,7 +115,7 @@
nodeC = topo.addForwarder("C");
for (TopologyNode node : {nodeA, nodeB, nodeC}) {
- topo.setStrategy<MulticastStrategy>(node);
+ topo.setStrategy<fw::MulticastStrategy>(node);
}
shared_ptr<TopologyLink> linkAB = topo.addLink("AB", 10_ms, {nodeA, nodeB}),
@@ -171,7 +169,7 @@
BOOST_TEST(didSendInterestTo(*face2));
const auto TICK = time::duration_cast<time::nanoseconds>(
- RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL) / 10;
+ fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL) / 10;
// downstream retransmits frequently, but the strategy should not send Interests
// more often than DEFAULT_MIN_RETX_INTERVAL
@@ -196,7 +194,7 @@
retxFrom4Evt = getScheduler().schedule(TICK * 5, periodicalRetxFrom4);
};
periodicalRetxFrom4();
- this->advanceClocks(TICK, RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
+ this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
retxFrom4Evt.cancel();
}
@@ -216,7 +214,7 @@
BOOST_AUTO_TEST_CASE(RetxSuppression)
{
- const auto suppressPeriod = RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL;
+ const auto suppressPeriod = fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL;
BOOST_ASSERT(suppressPeriod >= 8_ms);
// Set up the FIB
@@ -510,6 +508,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMulticastStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/pit-expiry.t.cpp b/tests/daemon/fw/pit-expiry.t.cpp
index 099d031..c2b6c41 100644
--- a/tests/daemon/fw/pit-expiry.t.cpp
+++ b/tests/daemon/fw/pit-expiry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,11 +31,7 @@
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestPitExpiry, GlobalIoTimeFixture)
@@ -415,6 +411,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitExpiry
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/pit-token.t.cpp b/tests/daemon/fw/pit-token.t.cpp
index f595ee7..1bf6968 100644
--- a/tests/daemon/fw/pit-token.t.cpp
+++ b/tests/daemon/fw/pit-token.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,11 +29,7 @@
#include <ndn-cxx/lp/packet.hpp>
#include <ndn-cxx/lp/pit-token.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestPitToken)
@@ -89,6 +85,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitToken
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/random-strategy.t.cpp b/tests/daemon/fw/random-strategy.t.cpp
index d2291c5..b89d48c 100644
--- a/tests/daemon/fw/random-strategy.t.cpp
+++ b/tests/daemon/fw/random-strategy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,11 +30,9 @@
#include "tests/daemon/face/dummy-face.hpp"
#include "strategy-tester.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using RandomStrategyTester = StrategyTester<RandomStrategy>;
+using RandomStrategyTester = StrategyTester<fw::RandomStrategy>;
NFD_REGISTER_STRATEGY(RandomStrategyTester);
BOOST_AUTO_TEST_SUITE(Fw)
@@ -100,6 +98,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRandomStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/retx-suppression.t.cpp b/tests/daemon/fw/retx-suppression.t.cpp
index 3a2cf06..d662251 100644
--- a/tests/daemon/fw/retx-suppression.t.cpp
+++ b/tests/daemon/fw/retx-suppression.t.cpp
@@ -23,7 +23,6 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "fw/strategy.hpp"
#include "fw/retx-suppression-fixed.hpp"
#include "fw/retx-suppression-exponential.hpp"
@@ -31,11 +30,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestRetxSuppression, GlobalIoTimeFixture)
@@ -203,6 +200,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRetxSuppression
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-ad-hoc-face.t.cpp b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
index bdf0cb6..cd46054 100644
--- a/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
+++ b/tests/daemon/fw/strategy-ad-hoc-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -39,9 +39,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class AdHocTopologyFixture : public GlobalIoTimeFixture
@@ -151,6 +151,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyAdHocFace
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-broadcast-medium.t.cpp b/tests/daemon/fw/strategy-broadcast-medium.t.cpp
index 6a45b2e..113faf5 100644
--- a/tests/daemon/fw/strategy-broadcast-medium.t.cpp
+++ b/tests/daemon/fw/strategy-broadcast-medium.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -40,9 +40,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class BroadcastMediumFixture : public GlobalIoTimeFixture
@@ -125,6 +125,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyBroadcastMedium
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-instantiation.t.cpp b/tests/daemon/fw/strategy-instantiation.t.cpp
index 3ce458a..12c13a1 100644
--- a/tests/daemon/fw/strategy-instantiation.t.cpp
+++ b/tests/daemon/fw/strategy-instantiation.t.cpp
@@ -39,9 +39,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_AUTO_TEST_SUITE(TestStrategyInstantiation)
@@ -202,6 +202,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyInstantiation
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index b928c92..9dcd0c9 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -37,9 +37,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class StrategyNackReturnFixture : public GlobalIoTimeFixture
@@ -337,6 +337,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyNackReturn
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index cec64c4..4fab4e5 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,9 +41,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class StrategyNoRouteFixture : public GlobalIoTimeFixture
@@ -183,6 +183,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyNoRoute
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 86e9540..d44460f 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -41,9 +41,9 @@
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::fw;
template<typename S>
class StrategyScopeControlFixture : public GlobalIoTimeFixture
@@ -275,6 +275,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyScopeControl
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index 5391dde..e8e795a 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -30,11 +30,7 @@
#include "tests/daemon/limited-io.hpp"
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
/** \brief Extends strategy S for unit testing.
*
@@ -154,8 +150,6 @@
std::vector<SendNackArgs> sendNackHistory;
};
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_STRATEGY_TESTER_HPP
diff --git a/tests/daemon/fw/strategy.t.cpp b/tests/daemon/fw/strategy.t.cpp
index 82191f7..c1fdabd 100644
--- a/tests/daemon/fw/strategy.t.cpp
+++ b/tests/daemon/fw/strategy.t.cpp
@@ -34,11 +34,9 @@
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
BOOST_AUTO_TEST_SUITE(Fw)
BOOST_FIXTURE_TEST_SUITE(TestStrategy, GlobalIoFixture)
@@ -126,6 +124,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/topology-tester.cpp b/tests/daemon/fw/topology-tester.cpp
index c44d61d..a758ee2 100644
--- a/tests/daemon/fw/topology-tester.cpp
+++ b/tests/daemon/fw/topology-tester.cpp
@@ -30,9 +30,7 @@
#include <ndn-cxx/encoding/encoding-buffer-fwd.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
using face::GenericLinkService;
using face::InternalClientTransport;
@@ -324,6 +322,4 @@
}
}
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/fw/topology-tester.hpp b/tests/daemon/fw/topology-tester.hpp
index 842e810..5d97392 100644
--- a/tests/daemon/fw/topology-tester.hpp
+++ b/tests/daemon/fw/topology-tester.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -38,11 +38,7 @@
#include <ndn-cxx/face.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
/** \brief identifies a node (forwarder) in the topology
*/
@@ -367,8 +363,6 @@
bool m_wantPcap = false;
};
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_FW_TOPOLOGY_TESTER_HPP
diff --git a/tests/daemon/fw/unsolicited-data-policy.t.cpp b/tests/daemon/fw/unsolicited-data-policy.t.cpp
index 77722c7..ee5ae77 100644
--- a/tests/daemon/fw/unsolicited-data-policy.t.cpp
+++ b/tests/daemon/fw/unsolicited-data-policy.t.cpp
@@ -33,11 +33,9 @@
#include <boost/logic/tribool.hpp>
#include <boost/mpl/vector.hpp>
-namespace nfd {
-namespace fw {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fw;
class UnsolicitedDataPolicyFixture : public GlobalIoTimeFixture
{
@@ -131,6 +129,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestUnsolicitedDataPolicy
BOOST_AUTO_TEST_SUITE_END() // Fw
-} // namespace tests
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/global-io-fixture.cpp b/tests/daemon/global-io-fixture.cpp
index 3a85e29..05aa8a1 100644
--- a/tests/daemon/global-io-fixture.cpp
+++ b/tests/daemon/global-io-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
GlobalIoFixture::GlobalIoFixture()
: g_io(getGlobalIoService())
@@ -58,5 +57,4 @@
pollIo();
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/global-io-fixture.hpp b/tests/daemon/global-io-fixture.hpp
index 7ac4f74..e374ec0 100644
--- a/tests/daemon/global-io-fixture.hpp
+++ b/tests/daemon/global-io-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "tests/clock-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief A fixture providing proper setup and teardown of the global io_service.
*
@@ -63,7 +62,6 @@
afterTick() final;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_GLOBAL_IO_FIXTURE_HPP
diff --git a/tests/daemon/limited-io.cpp b/tests/daemon/limited-io.cpp
index c7e9b1b..9f10f99 100644
--- a/tests/daemon/limited-io.cpp
+++ b/tests/daemon/limited-io.cpp
@@ -29,8 +29,7 @@
#include <boost/exception/diagnostic_information.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
LimitedIo::LimitedIo(GlobalIoTimeFixture* fixture)
: m_fixture(fixture)
@@ -107,5 +106,4 @@
}
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/limited-io.hpp b/tests/daemon/limited-io.hpp
index efa35c9..68d85e2 100644
--- a/tests/daemon/limited-io.hpp
+++ b/tests/daemon/limited-io.hpp
@@ -30,8 +30,7 @@
#include <exception>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief Provides IO operations limit and/or time limit for unit testing.
*
@@ -61,21 +60,22 @@
* \param tick if this LimitedIo is constructed with GlobalIoTimeFixture,
* this is passed to .advanceClocks(), otherwise ignored
*/
- StopReason
+ [[nodiscard]] StopReason
run(int nOpsLimit, time::nanoseconds timeLimit, time::nanoseconds tick = 1_ms);
- /// count an operation
+ /// Count an operation
void
afterOp();
- /** \brief defer for specified duration
+ /**
+ * \brief Defer for the specified duration
*
- * equivalent to .run(UNLIMITED_OPS, d)
+ * Equivalent to run(UNLIMITED_OPS, d)
*/
void
defer(time::nanoseconds d)
{
- this->run(UNLIMITED_OPS, d);
+ std::ignore = run(UNLIMITED_OPS, d);
}
std::exception_ptr
@@ -107,7 +107,6 @@
bool m_isRunning = false;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_LIMITED_IO_HPP
diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index 7db02ca..051d7c9 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.cpp
@@ -29,8 +29,7 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class CommandAuthenticatorFixture : public CommandInterestSignerFixture
{
@@ -468,5 +467,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCommandAuthenticator
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/cs-manager.t.cpp b/tests/daemon/mgmt/cs-manager.t.cpp
index 3f6b3aa..4f7b51b 100644
--- a/tests/daemon/mgmt/cs-manager.t.cpp
+++ b/tests/daemon/mgmt/cs-manager.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include <ndn-cxx/mgmt/nfd/cs-info.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class CsManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -226,5 +225,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCsManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.cpp b/tests/daemon/mgmt/face-manager-command-fixture.cpp
index ed90d0a..694870e 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.cpp
+++ b/tests/daemon/mgmt/face-manager-command-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <ndn-cxx/net/network-monitor-stub.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
FaceManagerCommandNode::FaceManagerCommandNode(ndn::KeyChain& keyChain, uint16_t port)
: face(getGlobalIoService(), keyChain, {true, true})
@@ -118,5 +117,4 @@
advanceClocks(1_ms, 5);
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.hpp b/tests/daemon/mgmt/face-manager-command-fixture.hpp
index 5864ad2..de28f3b 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.hpp
+++ b/tests/daemon/mgmt/face-manager-command-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include "manager-common-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class FaceManagerCommandNode
{
@@ -70,7 +69,6 @@
FaceManagerCommandNode node2; // acts as a remote endpoint
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_MGMT_FACE_MANAGER_COMMAND_FIXTURE_HPP
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index 7c0fe6f..45ddc1f 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include "face/generic-link-service.hpp"
#include "face-manager-command-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(TestFaceManager)
@@ -477,5 +476,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager-update-face.t.cpp b/tests/daemon/mgmt/face-manager-update-face.t.cpp
index 89031fd..6000380 100644
--- a/tests/daemon/mgmt/face-manager-update-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-update-face.t.cpp
@@ -35,8 +35,7 @@
#include <boost/logic/tribool.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Mgmt)
BOOST_AUTO_TEST_SUITE(TestFaceManager)
@@ -203,7 +202,6 @@
});
}
-using nfd::face::tests::DummyTransportBase;
using UpdatePersistencyTests = mpl::vector<
mpl::pair<DummyTransportBase<true>, CommandSuccess>,
mpl::pair<DummyTransportBase<false>, CommandFailure<409>>
@@ -737,5 +735,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 828325f..794c363 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -39,8 +39,7 @@
#include <ndn-cxx/net/network-monitor-stub.hpp>
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class FaceManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -369,7 +368,7 @@
FaceId faceId = face->getId();
// trigger FACE_EVENT_DOWN notification
- dynamic_cast<face::tests::DummyTransport*>(face->getTransport())->setState(face::FaceState::DOWN);
+ dynamic_cast<DummyTransport*>(face->getTransport())->setState(face::FaceState::DOWN);
advanceClocks(1_ms, 10);
BOOST_CHECK_EQUAL(face->getState(), face::FaceState::DOWN);
@@ -390,7 +389,7 @@
}
// trigger FACE_EVENT_UP notification
- dynamic_cast<face::tests::DummyTransport*>(face->getTransport())->setState(face::FaceState::UP);
+ dynamic_cast<DummyTransport*>(face->getTransport())->setState(face::FaceState::UP);
advanceClocks(1_ms, 10);
BOOST_CHECK_EQUAL(face->getState(), face::FaceState::UP);
@@ -445,5 +444,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 544eda5..5ab310d 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/mgmt/nfd/fib-entry.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class FibManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -446,5 +445,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFibManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/forwarder-status-manager.t.cpp b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
index 132375a..e40a0ce 100644
--- a/tests/daemon/mgmt/forwarder-status-manager.t.cpp
+++ b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "manager-common-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class ForwarderStatusManagerFixture : public ManagerCommonFixture
{
@@ -111,5 +110,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestForwarderStatusManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/general-config-section.t.cpp b/tests/daemon/mgmt/general-config-section.t.cpp
index cad7834..d06d698 100644
--- a/tests/daemon/mgmt/general-config-section.t.cpp
+++ b/tests/daemon/mgmt/general-config-section.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,18 +32,14 @@
#include <cstring>
-namespace nfd {
-namespace general {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
class GeneralConfigSectionFixture : public GlobalIoFixture
{
public:
GeneralConfigSectionFixture()
{
- setConfigFile(configFile);
+ general::setConfigFile(configFile);
}
#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
@@ -163,6 +159,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestGeneralConfigSection
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace general
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/manager-base.t.cpp b/tests/daemon/mgmt/manager-base.t.cpp
index a70784c..dba2dd8 100644
--- a/tests/daemon/mgmt/manager-base.t.cpp
+++ b/tests/daemon/mgmt/manager-base.t.cpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/security/pib/key.hpp>
#include <ndn-cxx/security/pib/pib.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class TestCommandVoidParameters : public ControlCommand
{
@@ -168,5 +167,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestManagerBase
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/manager-common-fixture.cpp b/tests/daemon/mgmt/manager-common-fixture.cpp
index 3188ee4..8be600c 100644
--- a/tests/daemon/mgmt/manager-common-fixture.cpp
+++ b/tests/daemon/mgmt/manager-common-fixture.cpp
@@ -25,8 +25,7 @@
#include "manager-common-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
CommandInterestSignerFixture::CommandInterestSignerFixture()
: m_signer(m_keyChain)
@@ -212,5 +211,4 @@
cf.parse(config, false, "ManagerCommonFixture.authenticator.conf");
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/manager-common-fixture.hpp b/tests/daemon/mgmt/manager-common-fixture.hpp
index 005d456..79923a0 100644
--- a/tests/daemon/mgmt/manager-common-fixture.hpp
+++ b/tests/daemon/mgmt/manager-common-fixture.hpp
@@ -36,8 +36,7 @@
#include <ndn-cxx/security/interest-signer.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief A fixture that wraps an InterestSigner.
*/
@@ -201,7 +200,6 @@
}
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_MGMT_MANAGER_COMMON_FIXTURE_HPP
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index ebfe7d0..b085657 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -37,8 +37,7 @@
#include <boost/property_tree/info_parser.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
using rib::Route;
@@ -182,7 +181,7 @@
ndn::util::DummyClientFace m_face;
ndn::nfd::Controller m_nfdController;
Dispatcher m_dispatcher;
- rib::tests::MockFibUpdater m_fibUpdater;
+ MockFibUpdater m_fibUpdater;
ndn::security::SigningInfo m_trustedSigner;
ndn::security::SigningInfo m_untrustedSigner;
@@ -376,5 +375,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index be4638f..9a06393 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -34,8 +34,7 @@
#include <boost/property_tree/info_parser.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
struct ConfigurationStatus
{
@@ -237,7 +236,7 @@
ndn::nfd::Controller m_nfdController;
rib::Rib m_rib;
- rib::tests::MockFibUpdater m_fibUpdater;
+ MockFibUpdater m_fibUpdater;
RibManager m_manager;
};
@@ -561,5 +560,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/strategy-choice-manager.t.cpp b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
index 3e42d1c..71763bb 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.t.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
@@ -31,8 +31,7 @@
#include <ndn-cxx/mgmt/nfd/strategy-choice.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class StrategyChoiceManagerFixture : public ManagerFixtureWithAuthenticator
{
@@ -239,5 +238,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyChoiceManager
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/mgmt/tables-config-section.t.cpp b/tests/daemon/mgmt/tables-config-section.t.cpp
index 4f07f78..dd0133f 100644
--- a/tests/daemon/mgmt/tables-config-section.t.cpp
+++ b/tests/daemon/mgmt/tables-config-section.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -35,8 +35,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/fw/dummy-strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class TablesConfigSectionFixture : public GlobalIoFixture
{
@@ -485,5 +484,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestTablesConfigSection
BOOST_AUTO_TEST_SUITE_END() // Mgmt
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib-io-fixture.cpp b/tests/daemon/rib-io-fixture.cpp
index 66b347b..d8931df 100644
--- a/tests/daemon/rib-io-fixture.cpp
+++ b/tests/daemon/rib-io-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include <boost/exception/diagnostic_information.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
RibIoFixture::RibIoFixture()
{
@@ -128,5 +127,4 @@
poll();
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib-io-fixture.hpp b/tests/daemon/rib-io-fixture.hpp
index f8660fd..73a43bc 100644
--- a/tests/daemon/rib-io-fixture.hpp
+++ b/tests/daemon/rib-io-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#include <mutex>
#include <thread>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/** \brief A base test fixture that provides both main and RIB io_service.
*/
@@ -86,7 +85,6 @@
afterTick() final;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_RIB_IO_FIXTURE_HPP
diff --git a/tests/daemon/rib/create-route.hpp b/tests/daemon/rib/create-route.hpp
index b248575..4e3fd57 100644
--- a/tests/daemon/rib/create-route.hpp
+++ b/tests/daemon/rib/create-route.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,17 +28,15 @@
#include "rib/route.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-inline Route
+inline rib::Route
createRoute(uint64_t faceId,
std::underlying_type_t<ndn::nfd::RouteOrigin> origin,
uint64_t cost = 0,
std::underlying_type_t<ndn::nfd::RouteFlags> flags = ndn::nfd::ROUTE_FLAGS_NONE)
{
- Route r;
+ rib::Route r;
r.faceId = faceId;
r.origin = static_cast<ndn::nfd::RouteOrigin>(origin);
r.cost = cost;
@@ -46,8 +44,6 @@
return r;
}
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_RIB_CREATE_ROUTE_HPP
diff --git a/tests/daemon/rib/fib-updates-common.hpp b/tests/daemon/rib/fib-updates-common.hpp
index 1930d14..9ceaeab 100644
--- a/tests/daemon/rib/fib-updates-common.hpp
+++ b/tests/daemon/rib/fib-updates-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -35,11 +35,10 @@
#include <ndn-cxx/util/dummy-client-face.hpp>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::FibUpdate;
+using rib::FibUpdater;
class MockFibUpdater : public FibUpdater
{
@@ -113,10 +112,10 @@
uint64_t cost,
std::underlying_type_t<ndn::nfd::RouteFlags> flags)
{
- Route route = createRoute(faceId, origin, cost, flags);
+ auto route = createRoute(faceId, origin, cost, flags);
- RibUpdate update;
- update.setAction(RibUpdate::REGISTER)
+ rib::RibUpdate update;
+ update.setAction(rib::RibUpdate::REGISTER)
.setName(name)
.setRoute(route);
@@ -128,10 +127,10 @@
eraseRoute(const Name& name, uint64_t faceId,
std::underlying_type_t<ndn::nfd::RouteOrigin> origin)
{
- Route route = createRoute(faceId, origin, 0, 0);
+ auto route = createRoute(faceId, origin, 0, 0);
- RibUpdate update;
- update.setAction(RibUpdate::UNREGISTER)
+ rib::RibUpdate update;
+ update.setAction(rib::RibUpdate::UNREGISTER)
.setName(name)
.setRoute(route);
@@ -169,12 +168,10 @@
ndn::util::DummyClientFace face;
ndn::nfd::Controller controller;
- Rib rib;
+ rib::Rib rib;
MockFibUpdater fibUpdater;
};
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_RIB_FIB_UPDATES_COMMON_HPP
diff --git a/tests/daemon/rib/fib-updates-erase-face.t.cpp b/tests/daemon/rib/fib-updates-erase-face.t.cpp
index d55f207..a911d5e 100644
--- a/tests/daemon/rib/fib-updates-erase-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-erase-face.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -426,6 +424,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-new-face.t.cpp b/tests/daemon/rib/fib-updates-new-face.t.cpp
index 49cd56f..79924df 100644
--- a/tests/daemon/rib/fib-updates-new-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-new-face.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -267,6 +265,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-new-namespace.t.cpp b/tests/daemon/rib/fib-updates-new-namespace.t.cpp
index 90abd31..4ceb60b 100644
--- a/tests/daemon/rib/fib-updates-new-namespace.t.cpp
+++ b/tests/daemon/rib/fib-updates-new-namespace.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -195,6 +193,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/fib-updates-update-face.t.cpp b/tests/daemon/rib/fib-updates-update-face.t.cpp
index 54cd2d4..bb76d01 100644
--- a/tests/daemon/rib/fib-updates-update-face.t.cpp
+++ b/tests/daemon/rib/fib-updates-update-face.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "tests/test-common.hpp"
#include "fib-updates-common.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
BOOST_FIXTURE_TEST_SUITE(TestFibUpdates, FibUpdatesFixture)
@@ -261,6 +259,4 @@
BOOST_AUTO_TEST_SUITE_END() // FibUpdates
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
index b804725..eab14e8 100644
--- a/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
+++ b/tests/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
@@ -28,11 +28,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
BOOST_AUTO_TEST_SUITE(Readvertise)
BOOST_FIXTURE_TEST_SUITE(TestClientToNlsrReadvertisePolicy, GlobalIoFixture)
@@ -72,6 +70,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestClientToNlsrReadvertisePolicy
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
index c3682dd..df73058 100644
--- a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
+++ b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
@@ -29,11 +29,9 @@
#include "tests/key-chain-fixture.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
class HostToGatewayReadvertisePolicyFixture : public GlobalIoFixture, public KeyChainFixture
{
@@ -109,6 +107,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestHostToGatewayReadvertisePolicy
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
index 5a64bbe..36ca585 100644
--- a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
+++ b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,11 +32,9 @@
#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
class NfdRibReadvertiseDestinationFixture : public GlobalIoTimeFixture, public KeyChainFixture
{
@@ -251,6 +249,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNfdRibReadvertiseDestination
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/readvertise/readvertise.t.cpp b/tests/daemon/rib/readvertise/readvertise.t.cpp
index ffcab71..6242dfc 100644
--- a/tests/daemon/rib/readvertise/readvertise.t.cpp
+++ b/tests/daemon/rib/readvertise/readvertise.t.cpp
@@ -34,11 +34,9 @@
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::rib;
class DummyReadvertisePolicy : public ReadvertisePolicy
{
@@ -300,6 +298,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestReadvertise
BOOST_AUTO_TEST_SUITE_END() // Readvertise
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/rib-entry.t.cpp b/tests/daemon/rib/rib-entry.t.cpp
index b946b78..903313e 100644
--- a/tests/daemon/rib/rib-entry.t.cpp
+++ b/tests/daemon/rib/rib-entry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,21 +28,20 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::RibEntry;
+using rib::Route;
BOOST_FIXTURE_TEST_SUITE(TestRibEntry, GlobalIoFixture)
BOOST_AUTO_TEST_CASE(Basic)
{
- rib::RibEntry entry;
- rib::RibEntry::iterator entryIt;
+ RibEntry entry;
+ RibEntry::iterator entryIt;
bool didInsert = false;
- rib::Route route1;
+ Route route1;
route1.faceId = 1;
route1.origin = ndn::nfd::ROUTE_ORIGIN_APP;
@@ -172,6 +171,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibEntry
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/rib-update.t.cpp b/tests/daemon/rib/rib-update.t.cpp
index 90c80f0..533439a 100644
--- a/tests/daemon/rib/rib-update.t.cpp
+++ b/tests/daemon/rib/rib-update.t.cpp
@@ -29,9 +29,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/rib/create-route.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
+
+using namespace nfd::rib;
BOOST_AUTO_TEST_SUITE(TestRibUpdate)
@@ -76,6 +76,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibUpdate
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/rib.t.cpp b/tests/daemon/rib/rib.t.cpp
index cc96e79..b635207 100644
--- a/tests/daemon/rib/rib.t.cpp
+++ b/tests/daemon/rib/rib.t.cpp
@@ -29,11 +29,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/rib/create-route.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::Route;
BOOST_FIXTURE_TEST_SUITE(TestRib, GlobalIoFixture)
@@ -239,39 +237,37 @@
Route route1 = createRoute(1, 20, 10);
Route route2 = createRoute(2, 30, 20);
- RibRouteRef routeInfo;
-
int nAfterInsertEntryInvocations = 0;
int nAfterAddRouteInvocations = 0;
int nBeforeRemoveRouteInvocations = 0;
int nAfterEraseEntryInvocations = 0;
- rib.afterInsertEntry.connect([&] (const Name& inName) {
- BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 0);
- BOOST_CHECK_EQUAL(nAfterAddRouteInvocations, 0);
- BOOST_CHECK(rib.find(name) != rib.end());
- nAfterInsertEntryInvocations++;
- });
+ rib.afterInsertEntry.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 0);
+ BOOST_CHECK_EQUAL(nAfterAddRouteInvocations, 0);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ nAfterInsertEntryInvocations++;
+ });
- rib.afterAddRoute.connect([&] (const RibRouteRef& rrr) {
- BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 1);
- BOOST_CHECK(rib.find(name) != rib.end());
- BOOST_CHECK(rib.find(name, route) != nullptr);
- nAfterAddRouteInvocations++;
- });
+ rib.afterAddRoute.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterInsertEntryInvocations, 1);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ BOOST_CHECK(rib.find(name, route) != nullptr);
+ nAfterAddRouteInvocations++;
+ });
- rib.beforeRemoveRoute.connect([&] (const RibRouteRef& rrr) {
- BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
- BOOST_CHECK(rib.find(name) != rib.end());
- BOOST_CHECK(rib.find(name, route) != nullptr);
- nBeforeRemoveRouteInvocations++;
- });
+ rib.beforeRemoveRoute.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
+ BOOST_CHECK(rib.find(name) != rib.end());
+ BOOST_CHECK(rib.find(name, route) != nullptr);
+ nBeforeRemoveRouteInvocations++;
+ });
- rib.afterEraseEntry.connect([&] (const Name& inName) {
- BOOST_CHECK_EQUAL(nBeforeRemoveRouteInvocations, 2);
- BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
- BOOST_CHECK(rib.find(name) == rib.end());
- nAfterEraseEntryInvocations++;
- });
+ rib.afterEraseEntry.connect([&] (const auto&) {
+ BOOST_CHECK_EQUAL(nBeforeRemoveRouteInvocations, 2);
+ BOOST_CHECK_EQUAL(nAfterEraseEntryInvocations, 0);
+ BOOST_CHECK(rib.find(name) == rib.end());
+ nAfterEraseEntryInvocations++;
+ });
route = route1;
rib.insert(name, route);
@@ -333,6 +329,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRib
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/route.t.cpp b/tests/daemon/rib/route.t.cpp
index 011ce7e..910e641 100644
--- a/tests/daemon/rib/route.t.cpp
+++ b/tests/daemon/rib/route.t.cpp
@@ -28,11 +28,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::Route;
BOOST_FIXTURE_TEST_SUITE(TestRoute, GlobalIoTimeFixture)
@@ -161,6 +159,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRoute
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/rib/service.t.cpp b/tests/daemon/rib/service.t.cpp
index caa59d3..5b808cc 100644
--- a/tests/daemon/rib/service.t.cpp
+++ b/tests/daemon/rib/service.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,11 +32,9 @@
#include <boost/property_tree/info_parser.hpp>
#include <sstream>
-namespace nfd {
-namespace rib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using rib::Service;
class RibServiceFixture : public RibIoFixture
{
@@ -147,6 +145,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestService
-} // namespace tests
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cleanup.t.cpp b/tests/daemon/table/cleanup.t.cpp
index b7395a3..1631b9c 100644
--- a/tests/daemon/table/cleanup.t.cpp
+++ b/tests/daemon/table/cleanup.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestCleanup, GlobalIoFixture)
@@ -183,5 +182,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCleanup
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cs-fixture.hpp b/tests/daemon/table/cs-fixture.hpp
index 82fbb7e..30273d3 100644
--- a/tests/daemon/table/cs-fixture.hpp
+++ b/tests/daemon/table/cs-fixture.hpp
@@ -33,13 +33,9 @@
#include <cstring>
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
-
-#define CHECK_CS_FIND(expected) find([&] (uint32_t found) { BOOST_CHECK_EQUAL(expected, found); });
+#define CHECK_CS_FIND(expected) find([&] (uint32_t found) { BOOST_CHECK_EQUAL(expected, found); })
class CsFixture : public GlobalIoTimeFixture
{
@@ -105,8 +101,6 @@
shared_ptr<Interest> interest;
};
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_DAEMON_TABLE_CS_FIXTURE_HPP
diff --git a/tests/daemon/table/cs-policy-lru.t.cpp b/tests/daemon/table/cs-policy-lru.t.cpp
index ed4fa7c..ce19f94 100644
--- a/tests/daemon/table/cs-policy-lru.t.cpp
+++ b/tests/daemon/table/cs-policy-lru.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,22 +27,20 @@
#include "tests/daemon/table/cs-fixture.hpp"
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_AUTO_TEST_SUITE(TestCsLru)
BOOST_AUTO_TEST_CASE(Registration)
{
- std::set<std::string> policyNames = Policy::getPolicyNames();
+ std::set<std::string> policyNames = cs::Policy::getPolicyNames();
BOOST_CHECK_EQUAL(policyNames.count("lru"), 1);
}
BOOST_FIXTURE_TEST_CASE(EvictOne, CsFixture)
{
- cs.setPolicy(make_unique<LruPolicy>());
+ cs.setPolicy(make_unique<cs::LruPolicy>());
cs.setLimit(3);
insert(1, "/A");
@@ -84,6 +82,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCsLru
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cs-policy-priority-fifo.t.cpp b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
index c059756..a1c88d0 100644
--- a/tests/daemon/table/cs-policy-priority-fifo.t.cpp
+++ b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,22 +27,20 @@
#include "tests/daemon/table/cs-fixture.hpp"
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_AUTO_TEST_SUITE(TestCsPriorityFifo)
BOOST_AUTO_TEST_CASE(Registration)
{
- std::set<std::string> policyNames = Policy::getPolicyNames();
+ std::set<std::string> policyNames = cs::Policy::getPolicyNames();
BOOST_CHECK_EQUAL(policyNames.count("priority_fifo"), 1);
}
BOOST_FIXTURE_TEST_CASE(EvictOne, CsFixture)
{
- cs.setPolicy(make_unique<PriorityFifoPolicy>());
+ cs.setPolicy(make_unique<cs::PriorityFifoPolicy>());
cs.setLimit(3);
insert(1, "/A", [] (Data& data) { data.setFreshnessPeriod(99999_ms); });
@@ -71,7 +69,7 @@
BOOST_FIXTURE_TEST_CASE(Refresh, CsFixture)
{
- cs.setPolicy(make_unique<PriorityFifoPolicy>());
+ cs.setPolicy(make_unique<cs::PriorityFifoPolicy>());
cs.setLimit(3);
insert(1, "/A", [] (Data& data) { data.setFreshnessPeriod(99999_ms); });
@@ -99,6 +97,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCsPriorityFifo
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/cs.t.cpp b/tests/daemon/table/cs.t.cpp
index b8e34de..67a5621 100644
--- a/tests/daemon/table/cs.t.cpp
+++ b/tests/daemon/table/cs.t.cpp
@@ -29,9 +29,7 @@
#include <ndn-cxx/lp/tags.hpp>
-namespace nfd {
-namespace cs {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestCs, CsFixture)
@@ -275,6 +273,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCs
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/dead-nonce-list.t.cpp b/tests/daemon/table/dead-nonce-list.t.cpp
index 44b0bfd..7df4ec8 100644
--- a/tests/daemon/table/dead-nonce-list.t.cpp
+++ b/tests/daemon/table/dead-nonce-list.t.cpp
@@ -29,8 +29,7 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestDeadNonceList, GlobalIoFixture)
@@ -193,5 +192,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestDeadNonceList
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/fib.t.cpp b/tests/daemon/table/fib.t.cpp
index 1655fac..e0246db 100644
--- a/tests/daemon/table/fib.t.cpp
+++ b/tests/daemon/table/fib.t.cpp
@@ -31,11 +31,9 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace fib {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::fib;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestFib, GlobalIoFixture)
@@ -390,6 +388,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFib
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/measurements-accessor.t.cpp b/tests/daemon/table/measurements-accessor.t.cpp
index 67e0623..73ec418 100644
--- a/tests/daemon/table/measurements-accessor.t.cpp
+++ b/tests/daemon/table/measurements-accessor.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,11 +31,7 @@
#include "tests/daemon/fw/dummy-strategy.hpp"
#include "tests/daemon/fw/choose-strategy.hpp"
-namespace nfd {
-namespace measurements {
-namespace tests {
-
-using namespace nfd::tests;
+namespace nfd::tests {
class MeasurementsAccessorTestStrategy : public DummyStrategy
{
@@ -114,13 +110,13 @@
BOOST_AUTO_TEST_CASE(GetParent)
{
- Entry& entryRoot = measurements.get("/");
+ auto& entryRoot = measurements.get("/");
BOOST_CHECK(accessor1->getParent(entryRoot) == nullptr);
BOOST_CHECK(accessor2->getParent(entryRoot) == nullptr);
- Entry& entryA = measurements.get("/A");
+ auto& entryA = measurements.get("/A");
BOOST_CHECK(accessor2->getParent(entryA) == nullptr);
- Entry& entryAD = measurements.get("/A/D");
+ auto& entryAD = measurements.get("/A/D");
BOOST_CHECK(accessor2->getParent(entryAD) != nullptr);
// whether accessor1 and accessor3 can getParent(entryA) and getParent(entryAD) is undefined,
// because they shouldn't have obtained those entries in the first place
@@ -176,6 +172,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMeasurementsAccessor
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/measurements.t.cpp b/tests/daemon/table/measurements.t.cpp
index 23034a3..9ba03d8 100644
--- a/tests/daemon/table/measurements.t.cpp
+++ b/tests/daemon/table/measurements.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,11 +30,9 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace measurements {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::measurements;
BOOST_AUTO_TEST_SUITE(Table)
@@ -260,6 +258,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMeasurements
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/name-tree.t.cpp b/tests/daemon/table/name-tree.t.cpp
index 6c410aa..8a7665e 100644
--- a/tests/daemon/table/name-tree.t.cpp
+++ b/tests/daemon/table/name-tree.t.cpp
@@ -30,11 +30,9 @@
#include <unordered_set>
-namespace nfd {
-namespace name_tree {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::name_tree;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestNameTree, GlobalIoFixture)
@@ -764,6 +762,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNameTree
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/network-region-table.t.cpp b/tests/daemon/table/network-region-table.t.cpp
index 431e3d3..e3c568f 100644
--- a/tests/daemon/table/network-region-table.t.cpp
+++ b/tests/daemon/table/network-region-table.t.cpp
@@ -28,8 +28,7 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestNetworkRegionTable, GlobalIoFixture)
@@ -59,5 +58,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestNetworkRegionTable
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/pit-entry.t.cpp b/tests/daemon/table/pit-entry.t.cpp
index 6f97a1c..45076e3 100644
--- a/tests/daemon/table/pit-entry.t.cpp
+++ b/tests/daemon/table/pit-entry.t.cpp
@@ -33,11 +33,9 @@
namespace bdata = boost::unit_test::data;
-namespace nfd {
-namespace pit {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::pit;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestPitEntry, GlobalIoFixture)
@@ -239,6 +237,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPitEntry
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/pit.t.cpp b/tests/daemon/table/pit.t.cpp
index defa768..b52ac0e 100644
--- a/tests/daemon/table/pit.t.cpp
+++ b/tests/daemon/table/pit.t.cpp
@@ -27,13 +27,10 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-namespace nfd {
-namespace pit {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
+using namespace nfd::pit;
BOOST_AUTO_TEST_SUITE(Table)
BOOST_FIXTURE_TEST_SUITE(TestPit, GlobalIoFixture)
@@ -344,6 +341,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestPit
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/strategy-choice.t.cpp b/tests/daemon/table/strategy-choice.t.cpp
index ff6b754..574317d 100644
--- a/tests/daemon/table/strategy-choice.t.cpp
+++ b/tests/daemon/table/strategy-choice.t.cpp
@@ -29,8 +29,7 @@
#include "tests/daemon/global-io-fixture.hpp"
#include "tests/daemon/fw/dummy-strategy.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class StrategyChoiceFixture : public GlobalIoFixture
{
@@ -335,5 +334,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyChoice
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/daemon/table/strategy-info-host.t.cpp b/tests/daemon/table/strategy-info-host.t.cpp
index e4323e4..87c36c8 100644
--- a/tests/daemon/table/strategy-info-host.t.cpp
+++ b/tests/daemon/table/strategy-info-host.t.cpp
@@ -28,8 +28,7 @@
#include "tests/test-common.hpp"
#include "tests/daemon/global-io-fixture.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
using fw::StrategyInfo;
@@ -131,5 +130,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyInfoHost
BOOST_AUTO_TEST_SUITE_END() // Table
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/global-configuration.cpp b/tests/global-configuration.cpp
index d3ab83a..dfae750 100644
--- a/tests/global-configuration.cpp
+++ b/tests/global-configuration.cpp
@@ -31,8 +31,7 @@
#include <fstream>
#include <stdlib.h>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class GlobalConfiguration
{
@@ -68,5 +67,4 @@
BOOST_TEST_GLOBAL_CONFIGURATION(GlobalConfiguration);
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/io-fixture.hpp b/tests/io-fixture.hpp
index af9fc84..fec308e 100644
--- a/tests/io-fixture.hpp
+++ b/tests/io-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <boost/asio/io_service.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class IoFixture : public ClockFixture
{
@@ -53,7 +52,6 @@
boost::asio::io_service m_io;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_IO_FIXTURE_HPP
diff --git a/tests/key-chain-fixture.cpp b/tests/key-chain-fixture.cpp
index de6feb6..21a6b9f 100644
--- a/tests/key-chain-fixture.cpp
+++ b/tests/key-chain-fixture.cpp
@@ -29,8 +29,7 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
using namespace ndn::security;
@@ -95,5 +94,4 @@
return saveIdentityCert(id, filename);
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/key-chain-fixture.hpp b/tests/key-chain-fixture.hpp
index 0ffcb0e..3f0f149 100644
--- a/tests/key-chain-fixture.hpp
+++ b/tests/key-chain-fixture.hpp
@@ -31,8 +31,7 @@
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/**
* @brief A fixture providing an in-memory KeyChain.
@@ -85,7 +84,6 @@
std::vector<std::string> m_certFiles;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_KEY_CHAIN_FIXTURE_HPP
diff --git a/tests/other/cs-benchmark.cpp b/tests/other/cs-benchmark.cpp
index fe4eeaa..793ccf1 100644
--- a/tests/other/cs-benchmark.cpp
+++ b/tests/other/cs-benchmark.cpp
@@ -32,8 +32,7 @@
#include <valgrind/callgrind.h>
#endif
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class CsBenchmarkFixture
{
@@ -210,5 +209,4 @@
std::cout << "find(CanBePrefix-hit) " << (N_INTERESTS * N_CHILDREN * REPEAT) << ": " << d << std::endl;
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/other/face-benchmark.cpp b/tests/other/face-benchmark.cpp
index 0b809c6..c9a28b6 100644
--- a/tests/other/face-benchmark.cpp
+++ b/tests/other/face-benchmark.cpp
@@ -37,8 +37,7 @@
#include <valgrind/callgrind.h>
#endif
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class FaceBenchmark
{
@@ -171,8 +170,7 @@
std::vector<std::pair<FaceUri, FaceUri>> m_faceUris;
};
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
int
main(int argc, char** argv)
diff --git a/tests/other/fw/congestion-mark-strategy.cpp b/tests/other/fw/congestion-mark-strategy.cpp
index 3d920c7..078799b 100644
--- a/tests/other/fw/congestion-mark-strategy.cpp
+++ b/tests/other/fw/congestion-mark-strategy.cpp
@@ -25,8 +25,7 @@
#include "congestion-mark-strategy.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_REGISTER_STRATEGY(CongestionMarkStrategy);
@@ -91,5 +90,4 @@
}
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/tests/other/fw/congestion-mark-strategy.hpp b/tests/other/fw/congestion-mark-strategy.hpp
index 9b0f982..7c41f3e 100644
--- a/tests/other/fw/congestion-mark-strategy.hpp
+++ b/tests/other/fw/congestion-mark-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "daemon/fw/best-route-strategy.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Congestion Mark integration testing strategy
*
@@ -58,7 +57,6 @@
bool m_shouldPreserveMark = true;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_TESTS_OTHER_FW_CONGESTION_MARK_STRATEGY_HPP
diff --git a/tests/other/pit-fib-benchmark.cpp b/tests/other/pit-fib-benchmark.cpp
index c6888d1..a154297 100644
--- a/tests/other/pit-fib-benchmark.cpp
+++ b/tests/other/pit-fib-benchmark.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <valgrind/callgrind.h>
#endif
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
class PitFibBenchmarkFixture
{
@@ -149,5 +148,4 @@
std::cout << time::duration_cast<time::microseconds>(t2 - t1) << std::endl;
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/test-common.cpp b/tests/test-common.cpp
index 7494c4b..0a7c7f6 100644
--- a/tests/test-common.cpp
+++ b/tests/test-common.cpp
@@ -25,8 +25,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
shared_ptr<Interest>
makeInterest(const Name& name, bool canBePrefix, std::optional<time::milliseconds> lifetime,
@@ -93,5 +92,4 @@
return std::move(pa);
}
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index beae58e..0986f11 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -44,8 +44,7 @@
#define SKIP_IF_NOT_SUPERUSER()
#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
-namespace nfd {
-namespace tests {
+namespace nfd::tests {
/**
* \brief Create an Interest
@@ -125,7 +124,6 @@
const ndn::security::SigningInfo& si = ndn::security::SigningInfo(),
std::optional<uint64_t> version = std::nullopt);
-} // namespace tests
-} // namespace nfd
+} // namespace nfd::tests
#endif // NFD_TESTS_TEST_COMMON_HPP
diff --git a/tests/tools/mock-nfd-mgmt-fixture.hpp b/tests/tools/mock-nfd-mgmt-fixture.hpp
index ec98657..3aa106b 100644
--- a/tests/tools/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/mock-nfd-mgmt-fixture.hpp
@@ -36,14 +36,12 @@
#include <boost/concept/assert.hpp>
-namespace nfd {
-namespace tools {
-namespace tests {
+namespace nfd::tests {
-using namespace nfd::tests;
using ndn::nfd::ControlParameters;
-/** \brief Fixture to emulate NFD management.
+/**
+ * \brief Fixture to emulate NFD management.
*/
class MockNfdMgmtFixture : public IoFixture, public KeyChainFixture
{
@@ -210,9 +208,7 @@
std::function<void(const Interest&)> processInterest;
};
-} // namespace tests
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tests
/** \brief require the command in \p interest has expected prefix
* \note This must be used in processInterest lambda, and the Interest must be named 'interest'.
diff --git a/tests/tools/ndn-autoconfig-server/program.t.cpp b/tests/tools/ndn-autoconfig-server/program.t.cpp
index 96bed31..c70cedd 100644
--- a/tests/tools/ndn-autoconfig-server/program.t.cpp
+++ b/tests/tools/ndn-autoconfig-server/program.t.cpp
@@ -32,10 +32,7 @@
#include <ndn-cxx/util/dummy-client-face.hpp>
#include <ndn-cxx/util/segment-fetcher.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig_server {
-namespace tests {
+namespace ndn::autoconfig_server::tests {
class AutoconfigServerFixture : public ::nfd::tests::KeyChainFixture
{
@@ -136,7 +133,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestProgram
BOOST_AUTO_TEST_SUITE_END() // NdnAutoconfigServer
-} // namespace tests
-} // namespace autoconfig_server
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig_server::tests
diff --git a/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp b/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp
index b71cc84..eaaca51 100644
--- a/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp
+++ b/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp
@@ -30,16 +30,10 @@
#include <ndn-cxx/encoding/block-helpers.hpp>
#include <ndn-cxx/encoding/tlv-nfd.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
-namespace tests {
-
-using namespace ::nfd::tools::tests;
-using nfd::ControlParameters;
+namespace ndn::autoconfig::tests {
BOOST_AUTO_TEST_SUITE(NdnAutoconfig)
-BOOST_FIXTURE_TEST_SUITE(TestMulticastDiscovery, MockNfdMgmtFixture)
+BOOST_FIXTURE_TEST_SUITE(TestMulticastDiscovery, ::nfd::tests::MockNfdMgmtFixture)
BOOST_AUTO_TEST_CASE(Normal)
{
@@ -69,7 +63,7 @@
BOOST_REQUIRE(req->hasFaceId());
if (req->getFaceId() == 860) {
- ControlParameters resp;
+ nfd::ControlParameters resp;
resp.setName("/localhop/ndn-autoconf/hub")
.setFaceId(860)
.setOrigin(nfd::ROUTE_ORIGIN_APP)
@@ -98,7 +92,7 @@
}
if (interest.getName() == "/localhop/ndn-autoconf/hub") {
- auto data = makeData(Name("/localhop/ndn-autoconf/hub").appendVersion());
+ auto data = ::nfd::tests::makeData(Name("/localhop/ndn-autoconf/hub").appendVersion());
data->setFreshnessPeriod(1_s);
data->setContent(makeStringBlock(tlv::nfd::Uri, "udp://router.example.net"));
face.receive(*data);
@@ -131,7 +125,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestMulticastDiscovery
BOOST_AUTO_TEST_SUITE_END() // NdnAutoconfig
-} // namespace tests
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig::tests
diff --git a/tests/tools/ndn-autoconfig/procedure.t.cpp b/tests/tools/ndn-autoconfig/procedure.t.cpp
index a392da8..d8911bb 100644
--- a/tests/tools/ndn-autoconfig/procedure.t.cpp
+++ b/tests/tools/ndn-autoconfig/procedure.t.cpp
@@ -29,16 +29,10 @@
#include <boost/logic/tribool.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
-namespace tests {
-
-using namespace ::nfd::tests;
-using nfd::ControlParameters;
+namespace ndn::autoconfig::tests {
template<typename ProcedureClass>
-class ProcedureFixture : public ::nfd::tools::tests::MockNfdMgmtFixture
+class ProcedureFixture : public ::nfd::tests::MockNfdMgmtFixture
{
public:
void
@@ -128,7 +122,7 @@
private:
void
- makeStages(const Options& options) override
+ makeStages(const Options&) override
{
m_stages.push_back(make_unique<DummyStage>("first", &nCalls1, FaceUri("udp://188.7.60.95"), m_io));
m_stages.push_back(make_unique<DummyStage>("second", &nCalls2, std::nullopt, m_io));
@@ -155,7 +149,7 @@
private:
void
- makeStages(const Options& options) override
+ makeStages(const Options&) override
{
m_stages.push_back(make_unique<DummyStage>("first", &nCalls1, std::nullopt, m_io));
m_stages.push_back(make_unique<DummyStage>("second", &nCalls2, FaceUri("tcp://40.23.174.71"), m_io));
@@ -183,7 +177,7 @@
BOOST_REQUIRE(req->hasUri());
BOOST_CHECK_EQUAL(req->getUri(), "udp4://188.7.60.95:6363");
- ControlParameters resp;
+ nfd::ControlParameters resp;
resp.setFaceId(1178)
.setUri("udp4://188.7.60.95:6363")
.setLocalUri("udp4://110.69.164.68:23197")
@@ -210,7 +204,7 @@
BOOST_ERROR("unexpected prefix registration " << req->getName());
}
- ControlParameters resp;
+ nfd::ControlParameters resp;
resp.setName(req->getName())
.setFaceId(1178)
.setOrigin(nfd::ROUTE_ORIGIN_AUTOCONF)
@@ -238,7 +232,7 @@
this->processInterest = [&] (const Interest& interest) {
auto req = parseCommand(interest, "/localhost/nfd/faces/create");
if (req) {
- ControlParameters resp;
+ nfd::ControlParameters resp;
resp.setFaceId(3146)
.setUri("tcp4://40.23.174.71:6363")
.setLocalUri("tcp4://34.213.69.67:14445")
@@ -261,7 +255,7 @@
BOOST_ERROR("unexpected prefix registration " << req->getName());
}
- ControlParameters resp;
+ nfd::ControlParameters resp;
resp.setName(req->getName())
.setFaceId(3146)
.setOrigin(nfd::ROUTE_ORIGIN_AUTOCONF)
@@ -284,7 +278,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestProcedure
BOOST_AUTO_TEST_SUITE_END() // NdnAutoconfig
-} // namespace tests
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig::tests
diff --git a/tests/tools/nfdc/channel-module.t.cpp b/tests/tools/nfdc/channel-module.t.cpp
index 1f815ff..25ffe57 100644
--- a/tests/tools/nfdc/channel-module.t.cpp
+++ b/tests/tools/nfdc/channel-module.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,7 @@
#include "status-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestChannelModule, StatusFixture<ChannelModule>)
@@ -69,7 +66,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestChannelModule
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/command-definition.t.cpp b/tests/tools/nfdc/command-definition.t.cpp
index 7dbbbf6..6314e2e 100644
--- a/tests/tools/nfdc/command-definition.t.cpp
+++ b/tests/tools/nfdc/command-definition.t.cpp
@@ -28,10 +28,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_AUTO_TEST_SUITE(TestCommandDefinition)
@@ -383,7 +380,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCommandDefinition
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/command-parser.t.cpp b/tests/tools/nfdc/command-parser.t.cpp
index 3c77c05..c9de564 100644
--- a/tests/tools/nfdc/command-parser.t.cpp
+++ b/tests/tools/nfdc/command-parser.t.cpp
@@ -27,10 +27,7 @@
#include "tests/test-common.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_AUTO_TEST_SUITE(TestCommandParser)
@@ -138,7 +135,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCommandParser
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/cs-module.t.cpp b/tests/tools/nfdc/cs-module.t.cpp
index 9b1ba0a..ac046bd 100644
--- a/tests/tools/nfdc/cs-module.t.cpp
+++ b/tests/tools/nfdc/cs-module.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,10 +28,7 @@
#include "status-fixture.hpp"
#include "execute-command-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_AUTO_TEST_SUITE(TestCsModule)
@@ -278,7 +275,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCsModule
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/execute-command-fixture.hpp b/tests/tools/nfdc/execute-command-fixture.hpp
index 103c50e..4a9df2d 100644
--- a/tests/tools/nfdc/execute-command-fixture.hpp
+++ b/tests/tools/nfdc/execute-command-fixture.hpp
@@ -33,12 +33,10 @@
#include <boost/algorithm/string/split.hpp>
#include <boost/test/tools/output_test_stream.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
-/** \brief fixture to test command execution
+/**
+ * \brief Fixture to test command execution.
*/
class ExecuteCommandFixture : public MockNfdMgmtFixture
{
@@ -65,9 +63,6 @@
int exitCode = -1;
};
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
#endif // NFD_TESTS_TOOLS_NFDC_EXECUTE_COMMAND_FIXTURE_HPP
diff --git a/tests/tools/nfdc/face-module.t.cpp b/tests/tools/nfdc/face-module.t.cpp
index d99383e..87356a1 100644
--- a/tests/tools/nfdc/face-module.t.cpp
+++ b/tests/tools/nfdc/face-module.t.cpp
@@ -28,10 +28,7 @@
#include "execute-command-fixture.hpp"
#include "status-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
using ndn::nfd::FaceQueryFilter;
@@ -1162,7 +1159,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFaceModule
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/fib-module.t.cpp b/tests/tools/nfdc/fib-module.t.cpp
index 9476500..ea8b139 100644
--- a/tests/tools/nfdc/fib-module.t.cpp
+++ b/tests/tools/nfdc/fib-module.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,7 @@
#include "status-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestFibModule, StatusFixture<FibModule>)
@@ -98,7 +95,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFibModule
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/format-helpers.t.cpp b/tests/tools/nfdc/format-helpers.t.cpp
index a9e4c87..26c9b1b 100644
--- a/tests/tools/nfdc/format-helpers.t.cpp
+++ b/tests/tools/nfdc/format-helpers.t.cpp
@@ -29,10 +29,7 @@
#include <boost/test/tools/output_test_stream.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
using boost::test_tools::output_test_stream;
@@ -141,7 +138,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestFormatHelpers
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/forwarder-general-module.t.cpp b/tests/tools/nfdc/forwarder-general-module.t.cpp
index 5d2255b..173ffb9 100644
--- a/tests/tools/nfdc/forwarder-general-module.t.cpp
+++ b/tests/tools/nfdc/forwarder-general-module.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,7 @@
#include "status-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestForwarderGeneralModule, StatusFixture<ForwarderGeneralModule>)
@@ -123,7 +120,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestForwarderGeneralModule
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/help.t.cpp b/tests/tools/nfdc/help.t.cpp
index 6f5392c..f629f62 100644
--- a/tests/tools/nfdc/help.t.cpp
+++ b/tests/tools/nfdc/help.t.cpp
@@ -29,10 +29,7 @@
#include <boost/test/tools/output_test_stream.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_AUTO_TEST_SUITE(TestHelp)
@@ -100,7 +97,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestCommandParser
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp b/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp
index 239faa9..eb197a4 100644
--- a/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/nfdc/mock-nfd-mgmt-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,16 +28,15 @@
#include "tests/tools/mock-nfd-mgmt-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+#include <ndn-cxx/mgmt/nfd/face-query-filter.hpp>
+#include <ndn-cxx/mgmt/nfd/face-status.hpp>
-using namespace nfd::tests;
+namespace nfd::tools::nfdc::tests {
-/** \brief fixture to emulate NFD management
+/**
+ * \brief Fixture to emulate NFD management.
*/
-class MockNfdMgmtFixture : public nfd::tools::tests::MockNfdMgmtFixture
+class MockNfdMgmtFixture : public nfd::tests::MockNfdMgmtFixture
{
protected:
/** \brief respond to FaceQuery requests
@@ -102,9 +101,6 @@
}
};
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
#endif // NFD_TESTS_TOOLS_NFDC_MOCK_NFD_MGMT_FIXTURE_HPP
diff --git a/tests/tools/nfdc/rib-module.t.cpp b/tests/tools/nfdc/rib-module.t.cpp
index 7f268dd..b50625d 100644
--- a/tests/tools/nfdc/rib-module.t.cpp
+++ b/tests/tools/nfdc/rib-module.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,10 +28,7 @@
#include "execute-command-fixture.hpp"
#include "status-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestRibModule, StatusFixture<RibModule>)
@@ -617,7 +614,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestRibModule
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/status-fixture.hpp b/tests/tools/nfdc/status-fixture.hpp
index f00b135..7616306 100644
--- a/tests/tools/nfdc/status-fixture.hpp
+++ b/tests/tools/nfdc/status-fixture.hpp
@@ -33,10 +33,7 @@
#include <boost/test/tools/output_test_stream.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
using ndn::Face;
using ndn::KeyChain;
@@ -152,9 +149,6 @@
return s;
}
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
#endif // NFD_TESTS_TOOLS_NFDC_STATUS_FIXTURE_HPP
diff --git a/tests/tools/nfdc/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
index 2ab5c3e..f978c57 100644
--- a/tests/tools/nfdc/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,7 @@
#include "status-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
const std::string STATUS_XML = stripXmlSpaces(R"XML(
<?xml version="1.0"?>
@@ -120,7 +117,7 @@
std::function<void()> processEventsFunc;
};
-class StatusReportModulesFixture : public IoFixture, public KeyChainFixture
+class StatusReportModulesFixture : public nfd::tests::IoFixture, public nfd::tests::KeyChainFixture
{
protected:
StatusReportModulesFixture()
@@ -211,7 +208,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStatusReport
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tests/tools/nfdc/strategy-choice-module.t.cpp b/tests/tools/nfdc/strategy-choice-module.t.cpp
index 22f7d92..6ff8abb 100644
--- a/tests/tools/nfdc/strategy-choice-module.t.cpp
+++ b/tests/tools/nfdc/strategy-choice-module.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,10 +28,7 @@
#include "execute-command-fixture.hpp"
#include "status-fixture.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
-namespace tests {
+namespace nfd::tools::nfdc::tests {
BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_AUTO_TEST_SUITE(TestStrategyChoiceModule)
@@ -262,7 +259,4 @@
BOOST_AUTO_TEST_SUITE_END() // TestStrategyChoiceModule
BOOST_AUTO_TEST_SUITE_END() // Nfdc
-} // namespace tests
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc::tests
diff --git a/tools/ndn-autoconfig-server/main.cpp b/tools/ndn-autoconfig-server/main.cpp
index c281148..38b4f32 100644
--- a/tools/ndn-autoconfig-server/main.cpp
+++ b/tools/ndn-autoconfig-server/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,9 +31,7 @@
#include <boost/exception/diagnostic_information.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig_server {
+namespace ndn::autoconfig_server {
static void
usage(const char* programName)
@@ -93,12 +91,10 @@
return 0;
}
-} // namespace autoconfig_server
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig_server
int
main(int argc, char** argv)
{
- return ndn::tools::autoconfig_server::main(argc, argv);
+ return ndn::autoconfig_server::main(argc, argv);
}
diff --git a/tools/ndn-autoconfig-server/program.cpp b/tools/ndn-autoconfig-server/program.cpp
index 82c1497..542d91a 100644
--- a/tools/ndn-autoconfig-server/program.cpp
+++ b/tools/ndn-autoconfig-server/program.cpp
@@ -31,9 +31,7 @@
#include <iostream>
-namespace ndn {
-namespace tools {
-namespace autoconfig_server {
+namespace ndn::autoconfig_server {
const Name HUB_DATA_NAME("/localhop/ndn-autoconf/hub");
const Name ROUTABLE_PREFIXES_DATA_PREFIX("/localhop/nfd");
@@ -97,6 +95,4 @@
m_face.shutdown();
}
-} // namespace autoconfig_server
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig_server
diff --git a/tools/ndn-autoconfig-server/program.hpp b/tools/ndn-autoconfig-server/program.hpp
index 39b5bce..03d5e20 100644
--- a/tools/ndn-autoconfig-server/program.hpp
+++ b/tools/ndn-autoconfig-server/program.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,14 +26,12 @@
#ifndef NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
#define NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
-#include "core/common.hpp"
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/mgmt/dispatcher.hpp>
+#include <ndn-cxx/net/face-uri.hpp>
#include <ndn-cxx/security/key-chain.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig_server {
+namespace ndn::autoconfig_server {
struct Options
{
@@ -68,8 +66,6 @@
mgmt::Dispatcher m_dispatcher;
};
-} // namespace autoconfig_server
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig_server
#endif // NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
diff --git a/tools/ndn-autoconfig/dns-srv.cpp b/tools/ndn-autoconfig/dns-srv.cpp
index 574ef17..bc0b3a6 100644
--- a/tools/ndn-autoconfig/dns-srv.cpp
+++ b/tools/ndn-autoconfig/dns-srv.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,13 +34,14 @@
#include <arpa/nameser_compat.h>
#endif
+#include <ndn-cxx/util/backports.hpp>
+#include <ndn-cxx/util/exception.hpp>
+
#include <iostream>
#include <boost/endian/conversion.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
using namespace std::string_literals;
@@ -165,6 +166,4 @@
return parseSrvRr(queryAnswer, answerSize);
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
diff --git a/tools/ndn-autoconfig/dns-srv.hpp b/tools/ndn-autoconfig/dns-srv.hpp
index 41563e9..8d156b1 100644
--- a/tools/ndn-autoconfig/dns-srv.hpp
+++ b/tools/ndn-autoconfig/dns-srv.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,11 +26,10 @@
#ifndef NFD_TOOLS_NDN_AUTOCONFIG_DNS_SRV_HPP
#define NFD_TOOLS_NDN_AUTOCONFIG_DNS_SRV_HPP
-#include "core/common.hpp"
+#include <stdexcept>
+#include <string>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
/** \file
* \brief provide synchronous DNS SRV record querying
@@ -39,14 +38,9 @@
class DnsSrvError : public std::runtime_error
{
public:
- explicit
- DnsSrvError(const std::string& what)
- : std::runtime_error(what)
- {
- }
+ using std::runtime_error::runtime_error;
};
-
/** \brief Send DNS SRV request for \p fqdn
* \param fqdn a fully qualified domain name
* \return FaceUri of the hub from the requested SRV record
@@ -62,8 +56,6 @@
std::string
querySrvRrSearch();
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
#endif // NFD_TOOLS_NDN_AUTOCONFIG_DNS_SRV_HPP
diff --git a/tools/ndn-autoconfig/guess-from-identity-name.cpp b/tools/ndn-autoconfig/guess-from-identity-name.cpp
index 9c50c20..16cf743 100644
--- a/tools/ndn-autoconfig/guess-from-identity-name.cpp
+++ b/tools/ndn-autoconfig/guess-from-identity-name.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,9 +31,7 @@
#include <sstream>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
GuessFromIdentityName::GuessFromIdentityName(KeyChain& keyChain)
: m_keyChain(keyChain)
@@ -62,6 +60,4 @@
}
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
diff --git a/tools/ndn-autoconfig/guess-from-identity-name.hpp b/tools/ndn-autoconfig/guess-from-identity-name.hpp
index 9da9093..2901a55 100644
--- a/tools/ndn-autoconfig/guess-from-identity-name.hpp
+++ b/tools/ndn-autoconfig/guess-from-identity-name.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,7 @@
#include "stage.hpp"
#include <ndn-cxx/security/key-chain.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
/**
* @brief Guessing home router based on the default identity name
@@ -75,8 +73,6 @@
KeyChain& m_keyChain;
};
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
#endif // NFD_TOOLS_NDN_AUTOCONFIG_GUESS_FROM_IDENTITY_NAME_HPP
diff --git a/tools/ndn-autoconfig/guess-from-search-domains.cpp b/tools/ndn-autoconfig/guess-from-search-domains.cpp
index 2f92cc3..8b32867 100644
--- a/tools/ndn-autoconfig/guess-from-search-domains.cpp
+++ b/tools/ndn-autoconfig/guess-from-search-domains.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,7 @@
#include "guess-from-search-domains.hpp"
#include "dns-srv.hpp"
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
void
GuessFromSearchDomains::doStart()
@@ -42,6 +40,4 @@
}
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
diff --git a/tools/ndn-autoconfig/guess-from-search-domains.hpp b/tools/ndn-autoconfig/guess-from-search-domains.hpp
index 9bd6521..fd02b80 100644
--- a/tools/ndn-autoconfig/guess-from-search-domains.hpp
+++ b/tools/ndn-autoconfig/guess-from-search-domains.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "stage.hpp"
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
/**
* @brief Guessing home router based on DNS query with default suffix
@@ -61,8 +59,6 @@
doStart() override;
};
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
#endif // NFD_TOOLS_NDN_AUTOCONFIG_GUESS_FROM_SEARCH_DOMAINS_HPP
diff --git a/tools/ndn-autoconfig/main.cpp b/tools/ndn-autoconfig/main.cpp
index afedc38..2f8e561 100644
--- a/tools/ndn-autoconfig/main.cpp
+++ b/tools/ndn-autoconfig/main.cpp
@@ -38,11 +38,7 @@
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/util/time.hpp>
-// ndn-autoconfig is an NDN tool not an NFD tool, so it uses ndn::tools::autoconfig namespace.
-// It lives in NFD repository because nfd-start can automatically start ndn-autoconfig in daemon mode.
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
namespace po = boost::program_options;
@@ -184,12 +180,10 @@
return exitCode;
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
int
main(int argc, char** argv)
{
- return ndn::tools::autoconfig::main(argc, argv);
+ return ndn::autoconfig::main(argc, argv);
}
diff --git a/tools/ndn-autoconfig/multicast-discovery.cpp b/tools/ndn-autoconfig/multicast-discovery.cpp
index a9fbc88..550ed7f 100644
--- a/tools/ndn-autoconfig/multicast-discovery.cpp
+++ b/tools/ndn-autoconfig/multicast-discovery.cpp
@@ -29,9 +29,7 @@
#include <ndn-cxx/encoding/tlv-nfd.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
using nfd::ControlParameters;
@@ -153,6 +151,4 @@
});
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
diff --git a/tools/ndn-autoconfig/multicast-discovery.hpp b/tools/ndn-autoconfig/multicast-discovery.hpp
index a1d5884..b2a63ed 100644
--- a/tools/ndn-autoconfig/multicast-discovery.hpp
+++ b/tools/ndn-autoconfig/multicast-discovery.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,9 +31,7 @@
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/mgmt/nfd/face-status.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
/** \brief multicast discovery stage
*
@@ -87,8 +85,6 @@
int m_nRegFailure = 0;
};
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
#endif // NFD_TOOLS_NDN_AUTOCONFIG_MULTICAST_DISCOVERY_HPP
diff --git a/tools/ndn-autoconfig/ndn-fch-discovery.cpp b/tools/ndn-autoconfig/ndn-fch-discovery.cpp
index 879ea8e..c6df1b7 100644
--- a/tools/ndn-autoconfig/ndn-fch-discovery.cpp
+++ b/tools/ndn-autoconfig/ndn-fch-discovery.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,9 +31,7 @@
#include <regex>
#include <sstream>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
/**
* A partial and specialized copy of ndn::FaceUri implementation
@@ -210,6 +208,4 @@
}
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
diff --git a/tools/ndn-autoconfig/ndn-fch-discovery.hpp b/tools/ndn-autoconfig/ndn-fch-discovery.hpp
index 000568d..64d3899 100644
--- a/tools/ndn-autoconfig/ndn-fch-discovery.hpp
+++ b/tools/ndn-autoconfig/ndn-fch-discovery.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "stage.hpp"
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
/**
* @brief Discovery NDN hub using NDN-FCH protocol
@@ -61,8 +59,6 @@
std::string m_url;
};
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
#endif // NFD_TOOLS_NDN_AUTOCONFIG_NDN_FCH_DISCOVERY_HPP
diff --git a/tools/ndn-autoconfig/procedure.cpp b/tools/ndn-autoconfig/procedure.cpp
index cda39ad..f7295d3 100644
--- a/tools/ndn-autoconfig/procedure.cpp
+++ b/tools/ndn-autoconfig/procedure.cpp
@@ -29,9 +29,7 @@
#include "multicast-discovery.hpp"
#include "ndn-fch-discovery.hpp"
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
using nfd::ControlParameters;
using nfd::ControlResponse;
@@ -138,6 +136,4 @@
});
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
diff --git a/tools/ndn-autoconfig/procedure.hpp b/tools/ndn-autoconfig/procedure.hpp
index 7c52658..c5dc0bb 100644
--- a/tools/ndn-autoconfig/procedure.hpp
+++ b/tools/ndn-autoconfig/procedure.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,13 +28,13 @@
#include "stage.hpp"
+#include "core/common.hpp"
+
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/security/key-chain.hpp>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
struct Options
{
@@ -89,8 +89,6 @@
nfd::Controller m_controller;
};
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
#endif // NFD_TOOLS_NDN_AUTOCONFIG_PROCEDURE_HPP
diff --git a/tools/ndn-autoconfig/stage.cpp b/tools/ndn-autoconfig/stage.cpp
index 0569b24..6bfaff0 100644
--- a/tools/ndn-autoconfig/stage.cpp
+++ b/tools/ndn-autoconfig/stage.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,9 +25,7 @@
#include "stage.hpp"
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
void
Stage::start()
@@ -69,6 +67,4 @@
m_isInProgress = false;
}
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
diff --git a/tools/ndn-autoconfig/stage.hpp b/tools/ndn-autoconfig/stage.hpp
index f7f358e..d11309b 100644
--- a/tools/ndn-autoconfig/stage.hpp
+++ b/tools/ndn-autoconfig/stage.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,16 +26,12 @@
#ifndef NFD_TOOLS_NDN_AUTOCONFIG_STAGE_HPP
#define NFD_TOOLS_NDN_AUTOCONFIG_STAGE_HPP
-#include "core/common.hpp"
-
#include <ndn-cxx/net/face-uri.hpp>
#include <ndn-cxx/util/signal.hpp>
#include <iostream>
-namespace ndn {
-namespace tools {
-namespace autoconfig {
+namespace ndn::autoconfig {
/** \brief a discovery stage
*/
@@ -45,14 +41,11 @@
class Error : public std::runtime_error
{
public:
- explicit
- Error(const std::string& what)
- : std::runtime_error(what)
- {
- }
+ using std::runtime_error::runtime_error;
};
- virtual ~Stage() = default;
+ virtual
+ ~Stage() = default;
/** \brief get stage name
* \return stage name as a phrase, typically starting with lower case
@@ -99,8 +92,6 @@
bool m_isInProgress = false;
};
-} // namespace autoconfig
-} // namespace tools
-} // namespace ndn
+} // namespace ndn::autoconfig
#endif // NFD_TOOLS_NDN_AUTOCONFIG_STAGE_HPP
diff --git a/tools/nfd-autoreg.cpp b/tools/nfd-autoreg.cpp
index 3745cb0..7a72b82 100644
--- a/tools/nfd-autoreg.cpp
+++ b/tools/nfd-autoreg.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,6 @@
#include "core/version.hpp"
#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/name.hpp>
-#include <ndn-cxx/encoding/buffer-stream.hpp>
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/mgmt/nfd/face-monitor.hpp>
#include <ndn-cxx/mgmt/nfd/face-status.hpp>
@@ -37,35 +35,25 @@
#include <boost/exception/diagnostic_information.hpp>
#include <boost/program_options/options_description.hpp>
-#include <boost/program_options/variables_map.hpp>
#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
#include <iostream>
-namespace ndn {
-namespace nfd_autoreg {
-
-using ::nfd::Network;
+namespace nfd::tools::autoreg {
class AutoregServer : boost::noncopyable
{
public:
- AutoregServer()
- : m_controller(m_face, m_keyChain)
- , m_faceMonitor(m_face)
- , m_cost(255)
- {
- }
-
- void
+ static void
onRegisterCommandSuccess(uint64_t faceId, const Name& prefix)
{
- std::cerr << "SUCCEED: register " << prefix << " on face " << faceId << std::endl;
+ std::cerr << "SUCCESS: register " << prefix << " on face " << faceId << std::endl;
}
- void
+ static void
onRegisterCommandFailure(uint64_t faceId, const Name& prefix,
- const nfd::ControlResponse& response)
+ const ndn::nfd::ControlResponse& response)
{
std::cerr << "FAILED: register " << prefix << " on face " << faceId
<< " (code: " << response.getCode() << ", reason: " << response.getText() << ")"
@@ -90,7 +78,7 @@
isBlacklisted(const boost::asio::ip::address& address) const
{
return std::any_of(m_blackList.begin(), m_blackList.end(),
- std::bind(&Network::doesContain, _1, address));
+ [&] (const auto& net) { return net.doesContain(address); });
}
/**
@@ -100,27 +88,27 @@
isWhitelisted(const boost::asio::ip::address& address) const
{
return std::any_of(m_whiteList.begin(), m_whiteList.end(),
- std::bind(&Network::doesContain, _1, address));
+ [&] (const auto& net) { return net.doesContain(address); });
}
void
registerPrefixesForFace(uint64_t faceId, const std::vector<Name>& prefixes)
{
for (const Name& prefix : prefixes) {
- m_controller.start<nfd::RibRegisterCommand>(
- nfd::ControlParameters()
+ m_controller.start<ndn::nfd::RibRegisterCommand>(
+ ndn::nfd::ControlParameters()
.setName(prefix)
.setFaceId(faceId)
- .setOrigin(nfd::ROUTE_ORIGIN_AUTOREG)
+ .setOrigin(ndn::nfd::ROUTE_ORIGIN_AUTOREG)
.setCost(m_cost)
.setExpirationPeriod(time::milliseconds::max()),
- std::bind(&AutoregServer::onRegisterCommandSuccess, this, faceId, prefix),
- std::bind(&AutoregServer::onRegisterCommandFailure, this, faceId, prefix, _1));
+ [=] (auto&&...) { onRegisterCommandSuccess(faceId, prefix); },
+ [=] (const auto& response) { onRegisterCommandFailure(faceId, prefix, response); });
}
}
void
- registerPrefixesIfNeeded(uint64_t faceId, const FaceUri& uri, nfd::FacePersistency facePersistency)
+ registerPrefixesIfNeeded(uint64_t faceId, const FaceUri& uri, ndn::nfd::FacePersistency facePersistency)
{
if (hasAllowedSchema(uri)) {
boost::system::error_code ec;
@@ -131,7 +119,7 @@
registerPrefixesForFace(faceId, m_allFacesPrefixes);
// register autoreg prefixes if new face is on-demand and not blacklisted and whitelisted
- if (facePersistency == nfd::FACE_PERSISTENCY_ON_DEMAND &&
+ if (facePersistency == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND &&
!isBlacklisted(address) && isWhitelisted(address)) {
registerPrefixesForFace(faceId, m_autoregPrefixes);
}
@@ -140,10 +128,10 @@
}
void
- onNotification(const nfd::FaceEventNotification& notification)
+ onNotification(const ndn::nfd::FaceEventNotification& notification)
{
- if (notification.getKind() == nfd::FACE_EVENT_CREATED &&
- notification.getFaceScope() != nfd::FACE_SCOPE_LOCAL) {
+ if (notification.getKind() == ndn::nfd::FACE_EVENT_CREATED &&
+ notification.getFaceScope() != ndn::nfd::FACE_SCOPE_LOCAL) {
std::cerr << "PROCESSING: " << notification << std::endl;
registerPrefixesIfNeeded(notification.getFaceId(), FaceUri(notification.getRemoteUri()),
@@ -154,16 +142,6 @@
}
}
- static void
- usage(std::ostream& os,
- const boost::program_options::options_description& desc,
- const char* programName)
- {
- os << "Usage: " << programName << " [--prefix=</autoreg/prefix>]... [options]\n"
- << "\n"
- << desc;
- }
-
void
startProcessing()
{
@@ -188,7 +166,7 @@
std::cout << " " << network << std::endl;
}
- m_faceMonitor.onNotification.connect(std::bind(&AutoregServer::onNotification, this, _1));
+ m_faceMonitor.onNotification.connect([this] (const auto& notif) { onNotification(notif); });
m_faceMonitor.start();
boost::asio::signal_set signalSet(m_face.getIoService(), SIGINT, SIGTERM);
@@ -200,7 +178,7 @@
void
startFetchingFaceStatusDataset()
{
- m_controller.fetch<nfd::FaceDataset>(
+ m_controller.fetch<ndn::nfd::FaceDataset>(
[this] (const auto& faces) {
for (const auto& faceStatus : faces) {
registerPrefixesIfNeeded(faceStatus.getFaceId(), FaceUri(faceStatus.getRemoteUri()),
@@ -224,7 +202,7 @@
("all-faces-prefix,a", po::value<std::vector<Name>>(&m_allFacesPrefixes)->composing(),
"prefix that should be automatically registered for all TCP and UDP non-local faces "
"(blacklists and whitelists do not apply to this prefix)")
- ("cost,c", po::value<uint64_t>(&m_cost)->default_value(255),
+ ("cost,c", po::value<uint64_t>(&m_cost)->default_value(m_cost),
"FIB cost that should be assigned to autoreg nexthops")
("whitelist,w", po::value<std::vector<Network>>(&m_whiteList)->composing(),
"Whitelisted network, e.g., 192.168.2.0/24 or ::1/128")
@@ -232,6 +210,12 @@
"Blacklisted network, e.g., 192.168.2.32/30 or ::1/128")
;
+ auto usage = [&] (std::ostream& os) {
+ os << "Usage: " << argv[0] << " [--prefix=</autoreg/prefix>]... [options]\n"
+ << "\n"
+ << optionsDesc;
+ };
+
po::variables_map options;
try {
po::store(po::parse_command_line(argc, argv, optionsDesc), options);
@@ -239,12 +223,12 @@
}
catch (const std::exception& e) {
std::cerr << "ERROR: " << e.what() << std::endl << std::endl;
- usage(std::cerr, optionsDesc, argv[0]);
+ usage(std::cerr);
return 2;
}
if (options.count("help") > 0) {
- usage(std::cout, optionsDesc, argv[0]);
+ usage(std::cout);
return 0;
}
@@ -256,7 +240,7 @@
if (m_autoregPrefixes.empty() && m_allFacesPrefixes.empty()) {
std::cerr << "ERROR: at least one --prefix or --all-faces-prefix must be specified"
<< std::endl << std::endl;
- usage(std::cerr, optionsDesc, argv[0]);
+ usage(std::cerr);
return 2;
}
@@ -279,23 +263,22 @@
}
private:
- Face m_face;
- KeyChain m_keyChain;
- nfd::Controller m_controller;
- nfd::FaceMonitor m_faceMonitor;
+ ndn::Face m_face;
+ ndn::KeyChain m_keyChain;
+ ndn::nfd::Controller m_controller{m_face, m_keyChain};
+ ndn::nfd::FaceMonitor m_faceMonitor{m_face};
std::vector<Name> m_autoregPrefixes;
std::vector<Name> m_allFacesPrefixes;
- uint64_t m_cost;
+ uint64_t m_cost = 255;
std::vector<Network> m_whiteList;
std::vector<Network> m_blackList;
};
-} // namespace nfd_autoreg
-} // namespace ndn
+} // namespace nfd::tools::autoreg
int
main(int argc, char* argv[])
{
- ndn::nfd_autoreg::AutoregServer server;
+ nfd::tools::autoreg::AutoregServer server;
return server.main(argc, argv);
}
diff --git a/tools/nfdc/available-commands.cpp b/tools/nfdc/available-commands.cpp
index 5be4854..6df761a 100644
--- a/tools/nfdc/available-commands.cpp
+++ b/tools/nfdc/available-commands.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,9 +30,7 @@
#include "status.hpp"
#include "strategy-choice-module.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
registerCommands(CommandParser& parser)
@@ -44,6 +42,4 @@
StrategyChoiceModule::registerCommands(parser);
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/available-commands.hpp b/tools/nfdc/available-commands.hpp
index a887eec..ad6525c 100644
--- a/tools/nfdc/available-commands.hpp
+++ b/tools/nfdc/available-commands.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,15 +28,11 @@
#include "command-parser.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
registerCommands(CommandParser& parser);
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_AVAILABLE_COMMANDS_HPP
diff --git a/tools/nfdc/canonizer.cpp b/tools/nfdc/canonizer.cpp
index a44a2bf..c6f150b 100644
--- a/tools/nfdc/canonizer.cpp
+++ b/tools/nfdc/canonizer.cpp
@@ -25,9 +25,7 @@
#include "canonizer.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
std::pair<std::optional<FaceUri>, std::string>
canonize(ExecuteContext& ctx, const FaceUri& uri)
@@ -56,6 +54,4 @@
return {FindFace::Code::CANONIZE_ERROR, msg};
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/canonizer.hpp b/tools/nfdc/canonizer.hpp
index 90b3afb..d693a55 100644
--- a/tools/nfdc/canonizer.hpp
+++ b/tools/nfdc/canonizer.hpp
@@ -32,9 +32,7 @@
#include <ndn-cxx/net/face-uri.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
/** \brief canonize FaceUri
* \return pair of canonical FaceUri (nullopt if failure) and error string
@@ -53,8 +51,6 @@
const std::string& error,
const std::string& field = "");
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_CANONIZER_HPP
diff --git a/tools/nfdc/channel-module.cpp b/tools/nfdc/channel-module.cpp
index 81f69d4..085fc35 100644
--- a/tools/nfdc/channel-module.cpp
+++ b/tools/nfdc/channel-module.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,7 @@
#include "channel-module.hpp"
#include "format-helpers.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
ChannelModule::fetchStatus(Controller& controller,
@@ -78,6 +76,4 @@
os << "\n";
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/channel-module.hpp b/tools/nfdc/channel-module.hpp
index 17989a6..6698ae8 100644
--- a/tools/nfdc/channel-module.hpp
+++ b/tools/nfdc/channel-module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "module.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::ChannelStatus;
@@ -70,8 +68,6 @@
std::vector<ChannelStatus> m_status;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_CHANNEL_MODULE_HPP
diff --git a/tools/nfdc/command-arguments.hpp b/tools/nfdc/command-arguments.hpp
index 2ab30f2..6dc060a 100644
--- a/tools/nfdc/command-arguments.hpp
+++ b/tools/nfdc/command-arguments.hpp
@@ -33,9 +33,7 @@
#include <any>
#include <boost/logic/tribool.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::FacePersistency;
using ndn::nfd::RouteOrigin;
@@ -75,8 +73,6 @@
}
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_COMMAND_ARGUMENTS_HPP
diff --git a/tools/nfdc/command-definition.cpp b/tools/nfdc/command-definition.cpp
index 7952e25..08952fd 100644
--- a/tools/nfdc/command-definition.cpp
+++ b/tools/nfdc/command-definition.cpp
@@ -28,9 +28,7 @@
#include <ndn-cxx/util/logger.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
NDN_LOG_INIT(nfdc.CommandDefinition);
@@ -291,6 +289,4 @@
NDN_CXX_UNREACHABLE;
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/command-definition.hpp b/tools/nfdc/command-definition.hpp
index 8cd56d9..26e309b 100644
--- a/tools/nfdc/command-definition.hpp
+++ b/tools/nfdc/command-definition.hpp
@@ -28,16 +28,14 @@
#include "command-arguments.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
/** \brief indicates argument value type
*/
enum class ArgValueType {
/** \brief boolean argument without value
*
- * The argument appears in CommandArguments as bool value 'true'.
+ * The argument appears in CommandArguments as bool value `true`.
* It must not be declared as positional.
*/
NONE,
@@ -212,8 +210,6 @@
std::vector<std::string> m_positionalArgs;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_COMMAND_DEFINITION_HPP
diff --git a/tools/nfdc/command-parser.cpp b/tools/nfdc/command-parser.cpp
index 69bc26a..19bb5a2 100644
--- a/tools/nfdc/command-parser.cpp
+++ b/tools/nfdc/command-parser.cpp
@@ -28,9 +28,7 @@
#include <ndn-cxx/util/logger.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
NDN_LOG_INIT(nfdc.CommandParser);
@@ -129,6 +127,4 @@
return {def.getNoun(), def.getVerb(), def.parse(tokens, nConsumed), i->second->execute};
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/command-parser.hpp b/tools/nfdc/command-parser.hpp
index f03027b..e0849b0 100644
--- a/tools/nfdc/command-parser.hpp
+++ b/tools/nfdc/command-parser.hpp
@@ -31,9 +31,7 @@
#include <type_traits>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
/** \brief indicates which modes is a command allowed
*/
@@ -125,8 +123,6 @@
std::vector<CommandContainer::const_iterator> m_commandOrder;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_COMMAND_PARSER_HPP
diff --git a/tools/nfdc/cs-module.cpp b/tools/nfdc/cs-module.cpp
index cdaad5a..73d066c 100644
--- a/tools/nfdc/cs-module.cpp
+++ b/tools/nfdc/cs-module.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include <ndn-cxx/util/indented-stream.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
CsModule::registerCommands(CommandParser& parser)
@@ -184,6 +182,4 @@
<< ia.end();
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/cs-module.hpp b/tools/nfdc/cs-module.hpp
index 3b16952..3c78765 100644
--- a/tools/nfdc/cs-module.hpp
+++ b/tools/nfdc/cs-module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,7 @@
#include "command-parser.hpp"
#include "module.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::CsInfo;
@@ -78,8 +76,6 @@
CsInfo m_status;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_CS_MODULE_HPP
diff --git a/tools/nfdc/execute-command.cpp b/tools/nfdc/execute-command.cpp
index 7067ebf..6706ffc 100644
--- a/tools/nfdc/execute-command.cpp
+++ b/tools/nfdc/execute-command.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,9 +25,7 @@
#include "execute-command.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
time::nanoseconds
ExecuteContext::getTimeout() const
@@ -60,6 +58,4 @@
};
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/execute-command.hpp b/tools/nfdc/execute-command.hpp
index 0458fb1..8132774 100644
--- a/tools/nfdc/execute-command.hpp
+++ b/tools/nfdc/execute-command.hpp
@@ -37,9 +37,7 @@
#include <ndn-cxx/mgmt/nfd/status-dataset.hpp>
#include <ndn-cxx/security/key-chain.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::Face;
using ndn::KeyChain;
@@ -92,8 +90,6 @@
*/
using ExecuteCommand = std::function<void(ExecuteContext&)>;
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_EXECUTE_COMMAND_HPP
diff --git a/tools/nfdc/face-module.cpp b/tools/nfdc/face-module.cpp
index 267187e..08409f7 100644
--- a/tools/nfdc/face-module.cpp
+++ b/tools/nfdc/face-module.cpp
@@ -27,9 +27,7 @@
#include "canonizer.hpp"
#include "find-face.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
FaceModule::registerCommands(CommandParser& parser)
@@ -557,6 +555,4 @@
os << '\n';
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/face-module.hpp b/tools/nfdc/face-module.hpp
index cffd98b..1d3eac8 100644
--- a/tools/nfdc/face-module.hpp
+++ b/tools/nfdc/face-module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,9 +30,7 @@
#include "command-parser.hpp"
#include "format-helpers.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::FaceStatus;
@@ -114,8 +112,6 @@
std::vector<FaceStatus> m_status;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_FACE_MODULE_HPP
diff --git a/tools/nfdc/fib-module.cpp b/tools/nfdc/fib-module.cpp
index e040109..92f7212 100644
--- a/tools/nfdc/fib-module.cpp
+++ b/tools/nfdc/fib-module.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,7 @@
#include "fib-module.hpp"
#include "format-helpers.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
FibModule::fetchStatus(Controller& controller,
@@ -98,6 +96,4 @@
os << "\n";
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/fib-module.hpp b/tools/nfdc/fib-module.hpp
index a41c978..e182f59 100644
--- a/tools/nfdc/fib-module.hpp
+++ b/tools/nfdc/fib-module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "module.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::FibEntry;
using ndn::nfd::NextHopRecord;
@@ -71,8 +69,6 @@
std::vector<FibEntry> m_status;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_FIB_MODULE_HPP
diff --git a/tools/nfdc/find-face.cpp b/tools/nfdc/find-face.cpp
index 2240433..054cba9 100644
--- a/tools/nfdc/find-face.cpp
+++ b/tools/nfdc/find-face.cpp
@@ -29,9 +29,7 @@
#include <ndn-cxx/util/logger.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
NDN_LOG_INIT(nfdc.FindFace);
@@ -180,6 +178,4 @@
}
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/find-face.hpp b/tools/nfdc/find-face.hpp
index ee1c521..02de011 100644
--- a/tools/nfdc/find-face.hpp
+++ b/tools/nfdc/find-face.hpp
@@ -28,9 +28,7 @@
#include "execute-command.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::FaceQueryFilter;
using ndn::nfd::FaceStatus;
@@ -139,8 +137,6 @@
std::string m_errorReason;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_FIND_FACE_HPP
diff --git a/tools/nfdc/format-helpers.cpp b/tools/nfdc/format-helpers.cpp
index 63f2417..1810f30 100644
--- a/tools/nfdc/format-helpers.cpp
+++ b/tools/nfdc/format-helpers.cpp
@@ -28,9 +28,7 @@
#include <iomanip>
#include <sstream>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
namespace xml {
@@ -204,6 +202,4 @@
} // namespace text
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/format-helpers.hpp b/tools/nfdc/format-helpers.hpp
index 4140ae2..2ee28ba 100644
--- a/tools/nfdc/format-helpers.hpp
+++ b/tools/nfdc/format-helpers.hpp
@@ -28,9 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
namespace xml {
@@ -266,8 +264,6 @@
} // namespace text
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_FORMAT_HELPERS_HPP
diff --git a/tools/nfdc/forwarder-general-module.cpp b/tools/nfdc/forwarder-general-module.cpp
index 1542b9f..7cfab84 100644
--- a/tools/nfdc/forwarder-general-module.cpp
+++ b/tools/nfdc/forwarder-general-module.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include <ndn-cxx/util/indented-stream.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
ForwarderGeneralModule::fetchStatus(Controller& controller,
@@ -130,6 +128,4 @@
os << ia.end();
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/forwarder-general-module.hpp b/tools/nfdc/forwarder-general-module.hpp
index 10d5cf3..239cea6 100644
--- a/tools/nfdc/forwarder-general-module.hpp
+++ b/tools/nfdc/forwarder-general-module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,9 +28,7 @@
#include "module.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::ForwarderStatus;
@@ -70,8 +68,6 @@
ForwarderStatus m_status;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_FORWARDER_GENERAL_MODULE_HPP
diff --git a/tools/nfdc/help.cpp b/tools/nfdc/help.cpp
index 052d16c..357a647 100644
--- a/tools/nfdc/help.cpp
+++ b/tools/nfdc/help.cpp
@@ -32,9 +32,7 @@
#include <cstring>
#include <unistd.h>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
NDN_LOG_INIT(nfdc.Help);
@@ -98,6 +96,4 @@
}
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/help.hpp b/tools/nfdc/help.hpp
index 53d21d4..19df8c1 100644
--- a/tools/nfdc/help.hpp
+++ b/tools/nfdc/help.hpp
@@ -28,9 +28,7 @@
#include "command-parser.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
/** \brief writes the list of available commands to a stream
* \param os the output stream to write the list to
@@ -56,8 +54,6 @@
help(std::ostream& os, const CommandParser& parser,
std::vector<std::string> args);
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_HELP_HPP
diff --git a/tools/nfdc/main.cpp b/tools/nfdc/main.cpp
index a9d9c6f..78da697 100644
--- a/tools/nfdc/main.cpp
+++ b/tools/nfdc/main.cpp
@@ -31,9 +31,7 @@
#include <fstream>
#include <iostream>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
static int
main(int argc, char** argv)
@@ -184,9 +182,7 @@
}
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
int
main(int argc, char** argv)
diff --git a/tools/nfdc/module.hpp b/tools/nfdc/module.hpp
index b8ede30..6793b3e 100644
--- a/tools/nfdc/module.hpp
+++ b/tools/nfdc/module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,9 +30,7 @@
#include <ndn-cxx/mgmt/nfd/command-options.hpp>
#include <ndn-cxx/mgmt/nfd/controller.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::CommandOptions;
using ndn::nfd::Controller;
@@ -74,8 +72,6 @@
formatStatusText(std::ostream& os) const = 0;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_MODULE_HPP
diff --git a/tools/nfdc/rib-module.cpp b/tools/nfdc/rib-module.cpp
index 5ed8553..d0489cf 100644
--- a/tools/nfdc/rib-module.cpp
+++ b/tools/nfdc/rib-module.cpp
@@ -29,9 +29,7 @@
#include "find-face.hpp"
#include "format-helpers.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
RibModule::registerCommands(CommandParser& parser)
@@ -410,6 +408,4 @@
}
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/rib-module.hpp b/tools/nfdc/rib-module.hpp
index 6c64cd2..22d4e76 100644
--- a/tools/nfdc/rib-module.hpp
+++ b/tools/nfdc/rib-module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,7 @@
#include "module.hpp"
#include "command-parser.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::RibEntry;
using ndn::nfd::Route;
@@ -113,8 +111,6 @@
std::vector<RibEntry> m_status;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_RIB_MODULE_HPP
diff --git a/tools/nfdc/status-report.cpp b/tools/nfdc/status-report.cpp
index aa3cdf1..ff0ea1c 100644
--- a/tools/nfdc/status-report.cpp
+++ b/tools/nfdc/status-report.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,7 @@
#include "status-report.hpp"
#include "format-helpers.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
ReportFormat
parseReportFormat(const std::string& s)
@@ -99,6 +97,4 @@
}
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/status-report.hpp b/tools/nfdc/status-report.hpp
index ae5ecdc..20c364d 100644
--- a/tools/nfdc/status-report.hpp
+++ b/tools/nfdc/status-report.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,9 +32,7 @@
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/validator.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::Face;
using ndn::KeyChain;
@@ -93,8 +91,6 @@
std::vector<unique_ptr<Module>> sections;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_STATUS_REPORT_HPP
diff --git a/tools/nfdc/status.cpp b/tools/nfdc/status.cpp
index a338b1d..081eea9 100644
--- a/tools/nfdc/status.cpp
+++ b/tools/nfdc/status.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,9 +34,7 @@
#include <ndn-cxx/security/validator-null.hpp>
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
reportStatus(ExecuteContext& ctx, const StatusReportOptions& options)
@@ -154,6 +152,4 @@
parser.addAlias("cs", "info", "");
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/status.hpp b/tools/nfdc/status.hpp
index b5d2e94..c563ad7 100644
--- a/tools/nfdc/status.hpp
+++ b/tools/nfdc/status.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,7 @@
#include "status-report.hpp"
#include "command-parser.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
struct StatusReportOptions
{
@@ -63,8 +61,6 @@
void
registerStatusCommands(CommandParser& parser);
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_STATUS_HPP
diff --git a/tools/nfdc/strategy-choice-module.cpp b/tools/nfdc/strategy-choice-module.cpp
index 004f368..1fbca4c 100644
--- a/tools/nfdc/strategy-choice-module.cpp
+++ b/tools/nfdc/strategy-choice-module.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,7 @@
#include "strategy-choice-module.hpp"
#include "format-helpers.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
void
StrategyChoiceModule::registerCommands(CommandParser& parser)
@@ -202,6 +200,4 @@
<< ia.end();
}
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
diff --git a/tools/nfdc/strategy-choice-module.hpp b/tools/nfdc/strategy-choice-module.hpp
index 7c403a9..502d66b 100644
--- a/tools/nfdc/strategy-choice-module.hpp
+++ b/tools/nfdc/strategy-choice-module.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,7 @@
#include "module.hpp"
#include "command-parser.hpp"
-namespace nfd {
-namespace tools {
-namespace nfdc {
+namespace nfd::tools::nfdc {
using ndn::nfd::StrategyChoice;
@@ -97,8 +95,6 @@
std::vector<StrategyChoice> m_status;
};
-} // namespace nfdc
-} // namespace tools
-} // namespace nfd
+} // namespace nfd::tools::nfdc
#endif // NFD_TOOLS_NFDC_STRATEGY_CHOICE_MODULE_HPP