ims: move InMemoryStorage from util/
refs #3940
Change-Id: I4468fe9b65ef6263a62800701eb6b03df28fa274
diff --git a/tests/unit-tests/util/in-memory-storage-fifo.t.cpp b/tests/unit-tests/ims/in-memory-storage-fifo.t.cpp
similarity index 87%
rename from tests/unit-tests/util/in-memory-storage-fifo.t.cpp
rename to tests/unit-tests/ims/in-memory-storage-fifo.t.cpp
index 6175837..7455ec0 100644
--- a/tests/unit-tests/util/in-memory-storage-fifo.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage-fifo.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -19,20 +19,18 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "util/in-memory-storage-fifo.hpp"
+#include "ims/in-memory-storage-fifo.hpp"
#include "boost-test.hpp"
#include "../make-interest-data.hpp"
namespace ndn {
-namespace util {
namespace tests {
using namespace ndn::tests;
-BOOST_AUTO_TEST_SUITE(Util)
-BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
-BOOST_AUTO_TEST_SUITE(Fifo)
+BOOST_AUTO_TEST_SUITE(Ims)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorageFifo)
BOOST_AUTO_TEST_CASE(ArrivalQueue)
{
@@ -75,10 +73,8 @@
BOOST_CHECK(found2 == nullptr);
}
-BOOST_AUTO_TEST_SUITE_END() // Fifo
-BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorageFifo
+BOOST_AUTO_TEST_SUITE_END() // Ims
} // namespace tests
-} // namespace util
} // namespace ndn
diff --git a/tests/unit-tests/util/in-memory-storage-lfu.t.cpp b/tests/unit-tests/ims/in-memory-storage-lfu.t.cpp
similarity index 92%
rename from tests/unit-tests/util/in-memory-storage-lfu.t.cpp
rename to tests/unit-tests/ims/in-memory-storage-lfu.t.cpp
index 5c37e56..b3462de 100644
--- a/tests/unit-tests/util/in-memory-storage-lfu.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage-lfu.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -19,20 +19,18 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "util/in-memory-storage-lfu.hpp"
+#include "ims/in-memory-storage-lfu.hpp"
#include "boost-test.hpp"
#include "../make-interest-data.hpp"
namespace ndn {
-namespace util {
namespace tests {
using namespace ndn::tests;
-BOOST_AUTO_TEST_SUITE(Util)
-BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
-BOOST_AUTO_TEST_SUITE(Lfu)
+BOOST_AUTO_TEST_SUITE(Ims)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorageLfu)
BOOST_AUTO_TEST_CASE(FrequencyQueue)
{
@@ -130,10 +128,8 @@
BOOST_CHECK_EQUAL(found3->getName(), name3);
}
-BOOST_AUTO_TEST_SUITE_END() // Lfu
-BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorageLfu
+BOOST_AUTO_TEST_SUITE_END() // Ims
} // namespace tests
-} // namespace util
} // namespace ndn
diff --git a/tests/unit-tests/util/in-memory-storage-lru.t.cpp b/tests/unit-tests/ims/in-memory-storage-lru.t.cpp
similarity index 92%
rename from tests/unit-tests/util/in-memory-storage-lru.t.cpp
rename to tests/unit-tests/ims/in-memory-storage-lru.t.cpp
index 67068bd..f371f9b 100644
--- a/tests/unit-tests/util/in-memory-storage-lru.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage-lru.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -19,20 +19,18 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "util/in-memory-storage-lru.hpp"
+#include "ims/in-memory-storage-lru.hpp"
#include "boost-test.hpp"
#include "../make-interest-data.hpp"
namespace ndn {
-namespace util {
namespace tests {
using namespace ndn::tests;
-BOOST_AUTO_TEST_SUITE(Util)
-BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
-BOOST_AUTO_TEST_SUITE(Lru)
+BOOST_AUTO_TEST_SUITE(Ims)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorageLru)
BOOST_AUTO_TEST_CASE(UsedTimeQueue)
{
@@ -132,10 +130,8 @@
BOOST_CHECK_EQUAL(found3->getName(), name3);
}
-BOOST_AUTO_TEST_SUITE_END() // Lru
-BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorageLru
+BOOST_AUTO_TEST_SUITE_END() // Ims
} // namespace tests
-} // namespace util
} // namespace ndn
diff --git a/tests/unit-tests/util/in-memory-storage-persistent.t.cpp b/tests/unit-tests/ims/in-memory-storage-persistent.t.cpp
similarity index 84%
rename from tests/unit-tests/util/in-memory-storage-persistent.t.cpp
rename to tests/unit-tests/ims/in-memory-storage-persistent.t.cpp
index 9770ef3..69c0d7e 100644
--- a/tests/unit-tests/util/in-memory-storage-persistent.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage-persistent.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -19,20 +19,18 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "util/in-memory-storage-persistent.hpp"
+#include "ims/in-memory-storage-persistent.hpp"
#include "boost-test.hpp"
#include "../make-interest-data.hpp"
namespace ndn {
-namespace util {
namespace tests {
using namespace ndn::tests;
-BOOST_AUTO_TEST_SUITE(Util)
-BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
-BOOST_AUTO_TEST_SUITE(Persistent)
+BOOST_AUTO_TEST_SUITE(Ims)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStoragePersistent)
BOOST_AUTO_TEST_CASE(GetLimit)
{
@@ -60,10 +58,8 @@
BOOST_CHECK_EQUAL(ims.getCapacity(), 20);
}
-BOOST_AUTO_TEST_SUITE_END() // Persistent
-BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStoragePersistent
+BOOST_AUTO_TEST_SUITE_END() // Ims
} // namespace tests
-} // namespace util
} // namespace ndn
diff --git a/tests/unit-tests/util/in-memory-storage-common.t.cpp b/tests/unit-tests/ims/in-memory-storage.t.cpp
similarity index 96%
rename from tests/unit-tests/util/in-memory-storage-common.t.cpp
rename to tests/unit-tests/ims/in-memory-storage.t.cpp
index 5c83391..691321a 100644
--- a/tests/unit-tests/util/in-memory-storage-common.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage.t.cpp
@@ -19,12 +19,13 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#include "util/in-memory-storage-persistent.hpp"
-#include "util/in-memory-storage-fifo.hpp"
-#include "util/in-memory-storage-lfu.hpp"
-#include "util/in-memory-storage-lru.hpp"
-#include "util/digest.hpp"
+#include "ims/in-memory-storage.hpp"
+#include "ims/in-memory-storage-fifo.hpp"
+#include "ims/in-memory-storage-lfu.hpp"
+#include "ims/in-memory-storage-lru.hpp"
+#include "ims/in-memory-storage-persistent.hpp"
#include "security/signature-sha256-with-rsa.hpp"
+#include "util/digest.hpp"
#include "boost-test.hpp"
#include "../make-interest-data.hpp"
@@ -33,14 +34,12 @@
#include <boost/mpl/list.hpp>
namespace ndn {
-namespace util {
namespace tests {
using namespace ndn::tests;
-BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(Ims)
BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
-BOOST_AUTO_TEST_SUITE(Common)
using InMemoryStorages = boost::mpl::list<InMemoryStoragePersistent,
InMemoryStorageFifo,
@@ -274,7 +273,7 @@
{
shared_ptr<Data> data = makeData("/digest/compute");
- ConstBufferPtr digest1 = Sha256::computeDigest(data->wireEncode().wire(), data->wireEncode().size());
+ ConstBufferPtr digest1 = util::Sha256::computeDigest(data->wireEncode().wire(), data->wireEncode().size());
BOOST_CHECK_EQUAL(digest1->size(), 32);
InMemoryStorageEntry entry;
@@ -372,7 +371,7 @@
shared_ptr<Data> data7 = makeData("/c/c/1");
ims.insert(*data7);
- ConstBufferPtr digest1 = Sha256::computeDigest(data->wireEncode().wire(), data->wireEncode().size());
+ ConstBufferPtr digest1 = util::Sha256::computeDigest(data->wireEncode().wire(), data->wireEncode().size());
Name name("/a");
ims.erase(name);
@@ -393,7 +392,7 @@
shared_ptr<Data> data3 = makeData("/z/z/z");
ims.insert(*data3);
- ConstBufferPtr digest1 = Sha256::computeDigest(data->wireEncode().wire(), data->wireEncode().size());
+ ConstBufferPtr digest1 = util::Sha256::computeDigest(data->wireEncode().wire(), data->wireEncode().size());
shared_ptr<Interest> interest = makeInterest("");
interest->setName(Name(name).appendImplicitSha256Digest(digest1->buf(), digest1->size()));
@@ -506,7 +505,6 @@
SignatureSha256WithRsa fakeSignature;
fakeSignature.setValue(makeEmptyBlock(tlv::SignatureValue));
-
fakeSignature.setKeyLocator(locator);
data2->setSignature(fakeSignature);
data2->wireEncode();
@@ -694,8 +692,7 @@
BOOST_CHECK(found == nullptr);
}
-///as Find function is implemented at the base case, therefore testing for one derived class is
-///sufficient for all
+// Find function is implemented at the base case, so it's sufficient to test for one derived class.
class FindFixture : public tests::UnitTestTimeFixture
{
protected:
@@ -928,9 +925,9 @@
Name n2 = insert(2, "ndn:/A");
insert(3, "ndn:/A/B");
- uint8_t digest00[Sha256::DIGEST_SIZE];
+ uint8_t digest00[util::Sha256::DIGEST_SIZE];
std::fill_n(digest00, sizeof(digest00), 0x00);
- uint8_t digestFF[Sha256::DIGEST_SIZE];
+ uint8_t digestFF[util::Sha256::DIGEST_SIZE];
std::fill_n(digestFF, sizeof(digestFF), 0xFF);
Exclude excludeDigest;
@@ -1050,10 +1047,8 @@
}
BOOST_AUTO_TEST_SUITE_END() // Find
-BOOST_AUTO_TEST_SUITE_END() // Common
BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
-BOOST_AUTO_TEST_SUITE_END() // Util
+BOOST_AUTO_TEST_SUITE_END() // Ims
} // namespace tests
-} // namespace util
} // namespace ndn
diff --git a/tests/unit-tests/mgmt/dispatcher.t.cpp b/tests/unit-tests/mgmt/dispatcher.t.cpp
index 6127ea0..536616c 100644
--- a/tests/unit-tests/mgmt/dispatcher.t.cpp
+++ b/tests/unit-tests/mgmt/dispatcher.t.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -47,7 +47,7 @@
public:
util::DummyClientFace face;
mgmt::Dispatcher dispatcher;
- util::InMemoryStorageFifo& storage;
+ InMemoryStorageFifo& storage;
};
class VoidParameters : public mgmt::ControlParameters