tests: follow DummyClientFace namespace change
Change-Id: Ia2ca95d8621e264747b299d1ecd5405bca0dd5af
diff --git a/tests/unit-tests/dummy-forwarder.cpp b/tests/unit-tests/dummy-forwarder.cpp
index 45a8cd6..2bcc3bc 100644
--- a/tests/unit-tests/dummy-forwarder.cpp
+++ b/tests/unit-tests/dummy-forwarder.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2018 University of California, Los Angeles
+ * Copyright (c) 2012-2023 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -33,9 +33,9 @@
Face&
DummyForwarder::addFace()
{
- auto face = std::make_shared<util::DummyClientFace>(m_io, m_keyChain,
- util::DummyClientFace::Options{true, true});
- util::DummyClientFace* self = &*face; // to prevent memory leak
+ auto face = std::make_shared<DummyClientFace>(m_io, m_keyChain, DummyClientFace::Options{true, true});
+ DummyClientFace* self = &*face; // to prevent memory leak
+
face->onSendInterest.connect([this, self] (const Interest& interest) {
Interest i(interest);
for (auto& otherFace : m_faces) {
@@ -45,6 +45,7 @@
m_io.post([=] { otherFace->receive(i); });
}
});
+
face->onSendData.connect([this, self] (const Data& data) {
Data d(data);
for (auto& otherFace : m_faces) {
diff --git a/tests/unit-tests/dummy-forwarder.hpp b/tests/unit-tests/dummy-forwarder.hpp
index 7965338..60e6904 100644
--- a/tests/unit-tests/dummy-forwarder.hpp
+++ b/tests/unit-tests/dummy-forwarder.hpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2018 University of California, Los Angeles
+ * Copyright (c) 2012-2023 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -17,11 +17,11 @@
* ChronoSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <ndn-cxx/interest.hpp>
#include <ndn-cxx/data.hpp>
+#include <ndn-cxx/interest.hpp>
#include <ndn-cxx/lp/nack.hpp>
-#include <ndn-cxx/util/dummy-client-face.hpp>
#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/util/dummy-client-face.hpp>
#ifndef NDN_CHRONOSYNC_UNIT_TESTS_DUMMY_FORWARDER_HPP
#define NDN_CHRONOSYNC_UNIT_TESTS_DUMMY_FORWARDER_HPP
@@ -55,7 +55,7 @@
private:
boost::asio::io_service& m_io;
KeyChain& m_keyChain;
- std::vector<shared_ptr<util::DummyClientFace>> m_faces;
+ std::vector<std::shared_ptr<DummyClientFace>> m_faces;
};
} // namespace chronosync
diff --git a/tests/unit-tests/test-logic.cpp b/tests/unit-tests/test-logic.cpp
index d883fe7..1a1257a 100644
--- a/tests/unit-tests/test-logic.cpp
+++ b/tests/unit-tests/test-logic.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2022 University of California, Los Angeles
+ * Copyright (c) 2012-2023 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -100,7 +100,7 @@
{
Name syncPrefix("/ndn/broadcast/sync");
Name userPrefix("/user");
- ndn::util::DummyClientFace face(io, {true, true});
+ ndn::DummyClientFace face(io, {true, true});
BOOST_REQUIRE_NO_THROW(Logic(face, syncPrefix, userPrefix, bind(onUpdate, _1)));
}
@@ -370,7 +370,7 @@
{
Name syncPrefix("/ndn/broadcast/sync");
Name userPrefix("/user");
- ndn::util::DummyClientFace face;
+ ndn::DummyClientFace face;
Logic logic(face, syncPrefix, userPrefix, bind(onUpdate, _1));
State state;
@@ -397,7 +397,7 @@
addIdentity("/bla");
Name syncPrefix("/ndn/broadcast/sync");
Name userPrefix("/user");
- ndn::util::DummyClientFace face;
+ ndn::DummyClientFace face;
Logic logic(face, syncPrefix, userPrefix, bind(onUpdate, _1));
State state;
diff --git a/tests/unit-tests/test-socket.cpp b/tests/unit-tests/test-socket.cpp
index 67f1c3e..3cde914 100644
--- a/tests/unit-tests/test-socket.cpp
+++ b/tests/unit-tests/test-socket.cpp
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
- * Copyright (c) 2012-2022 University of California, Los Angeles
+ * Copyright (c) 2012-2023 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -28,7 +28,6 @@
namespace test {
using std::string;
-using ndn::util::DummyClientFace;
/**
* @brief Emulate an app that use the Socket class
@@ -41,7 +40,7 @@
public:
SocketTestApp(const Name& syncPrefix,
const Name& userPrefix,
- DummyClientFace& face,
+ ndn::DummyClientFace& face,
bool isNum)
: sum(0)
, socket(syncPrefix,
@@ -155,9 +154,9 @@
userPrefix[1] = Name("/user1");
userPrefix[2] = Name("/user2");
- faces[0].reset(new DummyClientFace(io, {true, true}));
- faces[1].reset(new DummyClientFace(io, {true, true}));
- faces[2].reset(new DummyClientFace(io, {true, true}));
+ faces[0].reset(new ndn::DummyClientFace(io, {true, true}));
+ faces[1].reset(new ndn::DummyClientFace(io, {true, true}));
+ faces[2].reset(new ndn::DummyClientFace(io, {true, true}));
for (int i = 0; i < 3; i++) {
readInterestOffset[i] = 0;
@@ -239,7 +238,7 @@
Name userPrefix[3];
Name sessionName[3];
- std::unique_ptr<DummyClientFace> faces[3];
+ std::unique_ptr<ndn::DummyClientFace> faces[3];
shared_ptr<SocketTestApp> app[3];
size_t readInterestOffset[3];