tests: move makeInterest/makeData/etc to ndn::tests namespace

refs #2376

Change-Id: If824388f1e2859d7d2199cd622db2aa1a3277798
diff --git a/tests/unit-tests/util/test-in-memory-storage-common.cpp b/tests/unit-tests/util/in-memory-storage-common.t.cpp
similarity index 97%
rename from tests/unit-tests/util/test-in-memory-storage-common.cpp
rename to tests/unit-tests/util/in-memory-storage-common.t.cpp
index ea78f29..9e7c814 100644
--- a/tests/unit-tests/util/test-in-memory-storage-common.cpp
+++ b/tests/unit-tests/util/in-memory-storage-common.t.cpp
@@ -33,9 +33,12 @@
 
 namespace ndn {
 namespace util {
+namespace tests {
 
-BOOST_AUTO_TEST_SUITE(UtilInMemoryStorage)
+using namespace ndn::tests;
 
+BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
 BOOST_AUTO_TEST_SUITE(Common)
 
 typedef boost::mpl::list<InMemoryStoragePersistent, InMemoryStorageFifo, InMemoryStorageLfu,
@@ -124,8 +127,7 @@
   shared_ptr<Interest> interest = makeInterest(name);
 
   shared_ptr<const Data> found = ims.find(*interest);
-
-  BOOST_CHECK(static_cast<bool>(found));
+  BOOST_CHECK(found != nullptr);
   BOOST_CHECK_EQUAL(data->getName(), found->getName());
 }
 
@@ -155,8 +157,7 @@
   ims.insert(*data);
 
   shared_ptr<const Data> found = ims.find(name);
-
-  BOOST_CHECK(static_cast<bool>(found));
+  BOOST_CHECK(found != nullptr);
   BOOST_CHECK_EQUAL(data->getName(), found->getName());
 }
 
@@ -170,8 +171,7 @@
   ims.insert(*data);
 
   shared_ptr<const Data> found = ims.find(data->getFullName());
-
-  BOOST_CHECK(static_cast<bool>(found));
+  BOOST_CHECK(found != nullptr);
   BOOST_CHECK_EQUAL(data->getFullName(), found->getFullName());
 }
 
@@ -186,8 +186,7 @@
   Name name2("/not/find");
 
   shared_ptr<const Data> found = ims.find(name2);
-
-  BOOST_CHECK(!static_cast<bool>(found));
+  BOOST_CHECK(found == nullptr);
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(InsertAndNotFindByFullName, T, InMemoryStorages)
@@ -207,8 +206,7 @@
   signData(data2);
 
   shared_ptr<const Data> found = ims.find(data2->getFullName());
-
-  BOOST_CHECK(!static_cast<bool>(found));
+  BOOST_CHECK(found == nullptr);
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(InsertAndEraseByName, T, InMemoryStorages)
@@ -407,7 +405,7 @@
   interest->setMaxSuffixComponents(0);
 
   shared_ptr<const Data> found = ims.find(*interest);
-  BOOST_REQUIRE(static_cast<bool>(found));
+  BOOST_REQUIRE(found != nullptr);
   BOOST_CHECK_EQUAL(found->getName(), name);
 
   shared_ptr<Interest> interest2 = makeInterest("");
@@ -418,7 +416,7 @@
   interest2->setMaxSuffixComponents(0);
 
   shared_ptr<const Data> notfound = ims.find(*interest2);
-  BOOST_CHECK(static_cast<bool>(found));
+  BOOST_CHECK(notfound == nullptr);
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(ChildSelector, T, InMemoryStorages)
@@ -494,7 +492,7 @@
   interest->setPublisherPublicKeyLocator(locator);
 
   shared_ptr<const Data> found = ims.find(*interest);
-  BOOST_CHECK(!static_cast<bool>(found));
+  BOOST_CHECK(found == nullptr);
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(PublisherKeySelector2, T, InMemoryStorages)
@@ -523,7 +521,7 @@
   interest->setPublisherPublicKeyLocator(locator);
 
   shared_ptr<const Data> found = ims.find(*interest);
-  BOOST_CHECK(static_cast<bool>(found));
+  BOOST_CHECK(found != nullptr);
   BOOST_CHECK_EQUAL(found->getName(), data2->getName());
 }
 
@@ -696,7 +694,7 @@
 
   shared_ptr<Interest> interest = makeInterest(name);
   shared_ptr<const Data> found = ims.find(*interest);
-  BOOST_CHECK(!static_cast<bool>(found));
+  BOOST_CHECK(found == nullptr);
 }
 
 ///as Find function is implemented at the base case, therefore testing for one derived class is
@@ -1056,7 +1054,9 @@
 
 BOOST_AUTO_TEST_SUITE_END() // Find
 BOOST_AUTO_TEST_SUITE_END() // Common
-BOOST_AUTO_TEST_SUITE_END() // UtilInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // Util
 
+} // namespace tests
 } // namespace util
 } // namespace ndn
diff --git a/tests/unit-tests/util/in-memory-storage-fifo.t.cpp b/tests/unit-tests/util/in-memory-storage-fifo.t.cpp
index f090169..4404b51 100644
--- a/tests/unit-tests/util/in-memory-storage-fifo.t.cpp
+++ b/tests/unit-tests/util/in-memory-storage-fifo.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -29,7 +29,10 @@
 namespace util {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(UtilInMemoryStorage)
+using namespace ndn::tests;
+
+BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
 BOOST_AUTO_TEST_SUITE(Fifo)
 
 BOOST_AUTO_TEST_CASE(ArrivalQueue)
@@ -45,7 +48,7 @@
 
   shared_ptr<Interest> interest = makeInterest("/1");
   shared_ptr<const Data> found = ims.find(*interest);
-  BOOST_CHECK(!static_cast<bool>(found));
+  BOOST_CHECK(found == nullptr);
 }
 
 BOOST_AUTO_TEST_CASE(ArrivalQueue2)
@@ -61,7 +64,7 @@
 
   shared_ptr<Interest> interest1 = makeInterest("/1");
   shared_ptr<const Data> found1 = ims.find(*interest1);
-  BOOST_CHECK(!static_cast<bool>(found1));
+  BOOST_CHECK(found1 == nullptr);
 
   ims.insert(*makeData("/4"));
 
@@ -70,11 +73,12 @@
 
   shared_ptr<Interest> interest2 = makeInterest("/2");
   shared_ptr<const Data> found2 = ims.find(*interest2);
-  BOOST_CHECK(!static_cast<bool>(found2));
+  BOOST_CHECK(found2 == nullptr);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // Fifo
-BOOST_AUTO_TEST_SUITE_END() // UtilInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // Util
 
 } // namespace tests
 } // namespace util
diff --git a/tests/unit-tests/util/in-memory-storage-lfu.t.cpp b/tests/unit-tests/util/in-memory-storage-lfu.t.cpp
index b8d08c6..bc52b30 100644
--- a/tests/unit-tests/util/in-memory-storage-lfu.t.cpp
+++ b/tests/unit-tests/util/in-memory-storage-lfu.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -29,7 +29,10 @@
 namespace util {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(UtilInMemoryStorage)
+using namespace ndn::tests;
+
+BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
 BOOST_AUTO_TEST_SUITE(Lfu)
 
 BOOST_AUTO_TEST_CASE(FrequencyQueue)
@@ -63,7 +66,7 @@
   BOOST_CHECK_EQUAL(ims.size(), 2);
 
   shared_ptr<const Data> found2 = ims.find(*interest2);
-  BOOST_CHECK(!static_cast<bool>(found2));
+  BOOST_CHECK(found2 == nullptr);
 
   shared_ptr<const Data> found1 = ims.find(*interest1);
   BOOST_CHECK_EQUAL(found1->getName(), name1);
@@ -102,7 +105,7 @@
   BOOST_CHECK_EQUAL(ims.size(), 2);
 
   shared_ptr<const Data> found2 = ims.find(*interest2);
-  BOOST_CHECK(!static_cast<bool>(found2));
+  BOOST_CHECK(found2 == nullptr);
 
   shared_ptr<const Data> found1 = ims.find(*interest1);
   BOOST_CHECK_EQUAL(found1->getName(), name1);
@@ -120,7 +123,7 @@
   BOOST_CHECK_EQUAL(ims.size(), 2);
 
   shared_ptr<const Data> found4 = ims.find(*interest4);
-  BOOST_CHECK(!static_cast<bool>(found4));
+  BOOST_CHECK(found4 == nullptr);
 
   found1 = ims.find(*interest1);
   BOOST_CHECK_EQUAL(found1->getName(), name1);
@@ -129,8 +132,9 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // Lfu
-BOOST_AUTO_TEST_SUITE_END() // UtilInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // Util
 
 } // namespace tests
-} // namesapce util
+} // namespace util
 } // namespace ndn
diff --git a/tests/unit-tests/util/in-memory-storage-lru.t.cpp b/tests/unit-tests/util/in-memory-storage-lru.t.cpp
index 1cbffb8..7585987 100644
--- a/tests/unit-tests/util/in-memory-storage-lru.t.cpp
+++ b/tests/unit-tests/util/in-memory-storage-lru.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -29,7 +29,10 @@
 namespace util {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(UtilInMemoryStorage)
+using namespace ndn::tests;
+
+BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
 BOOST_AUTO_TEST_SUITE(Lru)
 
 BOOST_AUTO_TEST_CASE(UsedTimeQueue)
@@ -63,7 +66,7 @@
   BOOST_CHECK_EQUAL(ims.size(), 2);
 
   shared_ptr<const Data> found2 = ims.find(*interest2);
-  BOOST_CHECK(!static_cast<bool>(found2));
+  BOOST_CHECK(found2 == nullptr);
 
   shared_ptr<const Data> found1 = ims.find(*interest1);
   BOOST_CHECK_EQUAL(found1->getName(), name1);
@@ -102,7 +105,7 @@
   BOOST_CHECK_EQUAL(ims.size(), 2);
 
   shared_ptr<const Data> found2 = ims.find(*interest2);
-  BOOST_CHECK(!static_cast<bool>(found2));
+  BOOST_CHECK(found2 == nullptr);
 
   shared_ptr<const Data> found1 = ims.find(*interest1);
   BOOST_CHECK_EQUAL(found1->getName(), name1);
@@ -122,7 +125,7 @@
   BOOST_CHECK_EQUAL(ims.size(), 2);
 
   shared_ptr<const Data> found4 = ims.find(*interest4);
-  BOOST_CHECK(!static_cast<bool>(found4));
+  BOOST_CHECK(found4 == nullptr);
 
   found1 = ims.find(*interest1);
   BOOST_CHECK_EQUAL(found1->getName(), name1);
@@ -131,7 +134,8 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // Lru
-BOOST_AUTO_TEST_SUITE_END() // UtilInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // Util
 
 } // namespace tests
 } // namespace util
diff --git a/tests/unit-tests/util/in-memory-storage-persistent.t.cpp b/tests/unit-tests/util/in-memory-storage-persistent.t.cpp
index 1734774..af33ab3 100644
--- a/tests/unit-tests/util/in-memory-storage-persistent.t.cpp
+++ b/tests/unit-tests/util/in-memory-storage-persistent.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -29,7 +29,10 @@
 namespace util {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(UtilInMemoryStorage)
+using namespace ndn::tests;
+
+BOOST_AUTO_TEST_SUITE(Util)
+BOOST_AUTO_TEST_SUITE(TestInMemoryStorage)
 BOOST_AUTO_TEST_SUITE(Persistent)
 
 BOOST_AUTO_TEST_CASE(GetLimit)
@@ -59,7 +62,8 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // Persistent
-BOOST_AUTO_TEST_SUITE_END() // UtilInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // TestInMemoryStorage
+BOOST_AUTO_TEST_SUITE_END() // Util
 
 } // namespace tests
 } // namespace util