Remove dependency on Selectors and refactor codebase.
Change-Id: Ic3024b76ba0eea61f790c91c36090b4aa68702a3
Refs: #4522
diff --git a/tests/unit/repo-storage.cpp b/tests/unit/repo-storage.cpp
index 1caecf1..0458c23 100644
--- a/tests/unit/repo-storage.cpp
+++ b/tests/unit/repo-storage.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-2018, Regents of the University of California.
*
* This file is part of NDN repo-ng (Next generation of NDN repository).
* See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -37,41 +37,31 @@
{
};
-// Combine CommonDatasets with ComplexSelectorDataset
-typedef boost::mpl::push_back<CommonDatasets,
- ComplexSelectorsDataset>::type Datasets;
-BOOST_FIXTURE_TEST_CASE_TEMPLATE(Bulk, T, Datasets, Fixture<T>)
+BOOST_FIXTURE_TEST_CASE_TEMPLATE(Bulk, T, CommonDatasets, Fixture<T>)
{
- // typedef ComplexSelectorsDataset T;
BOOST_TEST_MESSAGE(T::getName());
// Insert data into repo
- for (typename T::DataContainer::iterator i = this->data.begin();
- i != this->data.end(); ++i)
- {
- BOOST_CHECK_EQUAL(this->handle->insertData(**i), true);
- }
+ for (auto i = this->data.begin(); i != this->data.end(); ++i) {
+ BOOST_CHECK_EQUAL(this->handle->insertData(**i), true);
+ }
// check size directly with the storage (repo doesn't have interface yet)
BOOST_CHECK_EQUAL(this->store->size(), static_cast<int64_t>(this->data.size()));
// Read
- for (typename T::InterestContainer::iterator i = this->interests.begin();
- i != this->interests.end(); ++i)
- {
- shared_ptr<ndn::Data> dataTest = this->handle->readData(i->first);
- BOOST_CHECK_EQUAL(*this->handle->readData(i->first), *i->second);
- }
+ for (auto i = this->interests.begin(); i != this->interests.end(); ++i) {
+ std::shared_ptr<ndn::Data> dataTest = this->handle->readData(i->first);
+ BOOST_CHECK_EQUAL(*dataTest, *i->second);
+ }
// Remove items
- for (typename T::RemovalsContainer::iterator i = this->removals.begin();
- i != this->removals.end(); ++i)
- {
- size_t nRemoved = 0;
- BOOST_REQUIRE_NO_THROW(nRemoved = this->handle->deleteData(i->first));
- BOOST_CHECK_EQUAL(nRemoved, i->second);
- }
+ for (auto i = this->removals.begin(); i != this->removals.end(); ++i) {
+ size_t nRemoved = 0;
+ nRemoved = this->handle->deleteData(i->first);
+ BOOST_CHECK_EQUAL(nRemoved, i->second);
+ }
}
BOOST_AUTO_TEST_SUITE_END()