Eliminate dependency on Boost.Random

Also replace use of std::random_shuffle (removed in C++17)
with std::shuffle.

Change-Id: I200a8a404e67447c547c9abfa1a5a55a18de9ef3
diff --git a/tests/integrated/test-basic-command-insert-delete.cpp b/tests/integrated/test-basic-command-insert-delete.cpp
index 28fea81..ff4b866 100644
--- a/tests/integrated/test-basic-command-insert-delete.cpp
+++ b/tests/integrated/test-basic-command-insert-delete.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -27,9 +27,9 @@
 #include "../dataset-fixtures.hpp"
 
 #include <ndn-cxx/util/random.hpp>
-#include <boost/preprocessor/comparison/not_equal.hpp>
+
+#include <boost/mpl/vector.hpp>
 #include <boost/test/unit_test.hpp>
-#include <fstream>
 
 namespace repo {
 namespace tests {
@@ -37,9 +37,8 @@
 using ndn::time::milliseconds;
 using ndn::time::seconds;
 using ndn::EventId;
-namespace random=ndn::random;
 
-//All the test cases in this test suite should be run at once.
+// All the test cases in this test suite should be run at once.
 BOOST_AUTO_TEST_SUITE(TestBasicCommandInsertDelete)
 
 const static uint8_t content[8] = {3, 1, 4, 1, 5, 9, 2, 6};
@@ -225,7 +224,7 @@
     Name insertCommandName("/repo/command/insert");
     RepoCommandParameter insertParameter;
     insertParameter.setName(Name((*i)->getName())
-                              .appendNumber(random::generateWord64()));
+                            .appendNumber(ndn::random::generateWord64()));
 
     insertCommandName.append(insertParameter.wireEncode());
     Interest insertInterest(insertCommandName);
@@ -256,9 +255,7 @@
        i != this->data.end(); ++i) {
     Name deleteCommandName("/repo/command/delete");
     RepoCommandParameter deleteParameter;
-    static boost::random::mt19937_64 gen;
-    static boost::random::uniform_int_distribution<uint64_t> dist(0, 0xFFFFFFFFFFFFFFFFLL);
-    deleteParameter.setProcessId(dist(gen));
+    deleteParameter.setProcessId(ndn::random::generateWord64());
     deleteParameter.setName((*i)->getName());
     deleteCommandName.append(deleteParameter.wireEncode());
     Interest deleteInterest(deleteCommandName);
diff --git a/tests/integrated/test-basic-command-watch.cpp b/tests/integrated/test-basic-command-watch.cpp
index a29deed..1e38da9 100644
--- a/tests/integrated/test-basic-command-watch.cpp
+++ b/tests/integrated/test-basic-command-watch.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -26,8 +26,8 @@
 
 #include <ndn-cxx/util/random.hpp>
 
+#include <boost/mpl/vector.hpp>
 #include <boost/test/unit_test.hpp>
-#include <fstream>
 
 namespace repo {
 namespace tests {
@@ -35,9 +35,8 @@
 using ndn::time::milliseconds;
 using ndn::time::seconds;
 using ndn::EventId;
-namespace random = ndn::random;
 
-//All the test cases in this test suite should be run at once.
+// All the test cases in this test suite should be run at once.
 BOOST_AUTO_TEST_SUITE(TestBasicCommandWatchDelete)
 
 const static uint8_t content[8] = {3, 1, 4, 1, 5, 9, 2, 6};
@@ -97,7 +96,8 @@
 template<class T> void
 Fixture<T>::onWatchInterest(const Interest& interest)
 {
-  shared_ptr<Data> data = make_shared<Data>(Name(interest.getName()).appendNumber(random::generateWord64()+100));
+  auto data = make_shared<Data>(Name(interest.getName())
+                                .appendNumber(ndn::random::generateWord64() + 100));
   data->setContent(content, sizeof(content));
   data->setFreshnessPeriod(milliseconds(0));
   keyChain.sign(*data);
diff --git a/tests/integrated/test-basic-interest-read.cpp b/tests/integrated/test-basic-interest-read.cpp
index eb412e8..cb10c89 100644
--- a/tests/integrated/test-basic-interest-read.cpp
+++ b/tests/integrated/test-basic-interest-read.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
@@ -24,14 +24,12 @@
 #include "../repo-storage-fixture.hpp"
 #include "../dataset-fixtures.hpp"
 
-#include <ndn-cxx/util/random.hpp>
-
 #include <boost/test/unit_test.hpp>
 
 namespace repo {
 namespace tests {
 
-//All the test cases in this test suite should be run at once.
+// All the test cases in this test suite should be run at once.
 BOOST_AUTO_TEST_SUITE(TestBasicInerestRead)
 
 const static uint8_t content[8] = {3, 1, 4, 1, 5, 9, 2, 6};
diff --git a/tests/other/skiplist-list.hpp b/tests/other/skiplist-list.hpp
index 72d1dda..ca71c7f 100644
--- a/tests/other/skiplist-list.hpp
+++ b/tests/other/skiplist-list.hpp
@@ -1,26 +1,29 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
-* Copyright (c) 2014, 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.
-*
-* repo-ng 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.
-*
-* repo-ng 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
-* repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-*/
+/*
+ * Copyright (c) 2014-2017, 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.
+ *
+ * repo-ng 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.
+ *
+ * repo-ng 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
+ * repo-ng, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
 
 #ifndef REPO_TESTS_OTHER_SKIPLIST_LIST_HPP
 #define REPO_TESTS_OTHER_SKIPLIST_LIST_HPP
+
 #include "common.hpp"
 
+#include <random>
+
 namespace update1 {
 
 class SkipList32Levels25Probabilty
@@ -136,7 +139,7 @@
   }
 };
 
-/*
+/**
  * @brief SkipList
  *
  * Examples of internal structure:
@@ -224,7 +227,7 @@
 
 protected:
 
-  /*
+  /**
    * @brief initialize the node
    */
   NodePointer
@@ -234,9 +237,9 @@
     return p;
   }
 
-  /*
+  /**
    * @brief initialize the node with given value
-   * @para to be set to the value of node
+   * @param x to be set to the value of node
    */
   NodePointer
   createNode(const T& x)
@@ -246,9 +249,9 @@
     return p;
   }
 
-  /*
-   * @brief destructror of the node
-   * @para given pointer of node to be destructed
+  /**
+   * @brief destructor of the node
+   * @param p pointer to the node to be destructed
    */
   void
   destroyNode(NodePointer p)
@@ -256,7 +259,7 @@
     delete(p);
   }
 
-  /*
+  /**
    * @brief initialize the head
    */
   void
@@ -268,7 +271,7 @@
     m_size = 0;
   }
 
-  /*
+  /**
    * @brief destroy all the nodes of skiplist except the head
    */
   void
@@ -284,14 +287,14 @@
     m_head->prevs.front() = m_head;
   }
 
-  /*
+  /**
    * @brief pick a random height for inserted skiplist entry
    */
   size_t
   pickRandomLevel() const
   {
-    static boost::random::mt19937 gen;
-    static boost::random::geometric_distribution<size_t> dist(Traits::getProbability());
+    static std::mt19937 gen(std::random_device{}());
+    static std::geometric_distribution<size_t> dist(Traits::getProbability());
     return std::min(dist(gen), Traits::getMaxLevels());
   }
 
@@ -473,6 +476,6 @@
   }
 }
 
-} //end namespace update1
+} // namespace update1
 
-#endif // REPO_TESTS_UNIT_SKIPLIST_LIST_HPP
+#endif // REPO_TESTS_OTHER_SKIPLIST_LIST_HPP
diff --git a/tests/other/skiplist-prev.hpp b/tests/other/skiplist-prev.hpp
index 1bb416d..c19ca29 100644
--- a/tests/other/skiplist-prev.hpp
+++ b/tests/other/skiplist-prev.hpp
@@ -1,27 +1,29 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
-* Copyright (c) 2014, 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.
-*
-* repo-ng 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.
-*
-* repo-ng 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
-* repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-*/
+/*
+ * Copyright (c) 2014-2017, 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.
+ *
+ * repo-ng 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.
+ *
+ * repo-ng 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
+ * repo-ng, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
 
 #ifndef REPO_TESTS_OTHER_SKIPLIST_PREV_HPP
 #define REPO_TESTS_OTHER_SKIPLIST_PREV_HPP
 
 #include "common.hpp"
 
+#include <random>
+
 namespace prev {
 
 class SkipList32Levels25Probabilty
@@ -312,8 +314,8 @@
   size_t
   pickRandomLevel() const
   {
-    static boost::random::mt19937 gen;
-    static boost::random::geometric_distribution<size_t> dist(Traits::getProbability());
+    static std::mt19937 gen(std::random_device{}());
+    static std::geometric_distribution<size_t> dist(Traits::getProbability());
     return std::min(dist(gen), Traits::getMaxLevels());
   }
 
diff --git a/tests/other/skiplist-vector.hpp b/tests/other/skiplist-vector.hpp
index 6079dd3..8ef1ed9 100644
--- a/tests/other/skiplist-vector.hpp
+++ b/tests/other/skiplist-vector.hpp
@@ -1,26 +1,29 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
-* Copyright (c) 2014, 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.
-*
-* repo-ng 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.
-*
-* repo-ng 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
-* repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
-*/
+/*
+ * Copyright (c) 2014-2017, 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.
+ *
+ * repo-ng 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.
+ *
+ * repo-ng 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
+ * repo-ng, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
 
 #ifndef REPO_TESTS_OTHER_SKIPLIST_VECTOR_HPP
 #define REPO_TESTS_OTHER_SKIPLIST_VECTOR_HPP
+
 #include "common.hpp"
 
+#include <random>
+
 namespace update2 {
 
 class SkipList32Levels25Probabilty
@@ -290,8 +293,8 @@
   size_t
   pickRandomLevel() const
   {
-    static boost::random::mt19937 gen;
-    static boost::random::geometric_distribution<size_t> dist(Traits::getProbability());
+    static std::mt19937 gen(std::random_device{}());
+    static std::geometric_distribution<size_t> dist(Traits::getProbability());
     return std::min(dist(gen), Traits::getMaxLevels());
   }
 
@@ -412,6 +415,6 @@
 
 }
 
-} //end namespace update2
+} // namespace update2
 
 #endif // REPO_TESTS_OTHER_SKIPLIST_VECTOR_HPP
diff --git a/tests/unit/sqlite-handle.cpp b/tests/unit/sqlite-handle.cpp
index d493e3d..ca7c7dd 100644
--- a/tests/unit/sqlite-handle.cpp
+++ b/tests/unit/sqlite-handle.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014,  Regents of the University of California.
+/*
+ * Copyright (c) 2014-2017, 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.
@@ -23,6 +23,7 @@
 #include "../dataset-fixtures.hpp"
 
 #include <boost/test/unit_test.hpp>
+#include <random>
 
 namespace repo {
 namespace tests {
@@ -33,28 +34,28 @@
 class Fixture : public SqliteFixture, public Dataset
 {
 public:
-  std::map<int64_t, shared_ptr<Data> > idToDataMap;
+  std::map<int64_t, shared_ptr<Data>> idToDataMap;
 };
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(InsertReadDelete, T, CommonDatasets, Fixture<T>)
 {
-  BOOST_TEST_MESSAGE(T::getName());
+  BOOST_TEST_CHECKPOINT(T::getName());
 
   std::vector<int64_t> ids;
 
   // Insert
   for (typename T::DataContainer::iterator i = this->data.begin();
-       i != this->data.end(); ++i)
-    {
-      int64_t id = -1;
-      BOOST_REQUIRE_NO_THROW(id = this->handle->insert(**i));
+       i != this->data.end(); ++i) {
+    int64_t id = -1;
+    BOOST_REQUIRE_NO_THROW(id = this->handle->insert(**i));
 
-      this->idToDataMap.insert(std::make_pair(id, *i));
-      ids.push_back(id);
-    }
+    this->idToDataMap.insert(std::make_pair(id, *i));
+    ids.push_back(id);
+  }
   BOOST_CHECK_EQUAL(this->handle->size(), static_cast<int64_t>(this->data.size()));
 
-  std::random_shuffle(ids.begin(), ids.end());
+  std::mt19937 rng{std::random_device{}()};
+  std::shuffle(ids.begin(), ids.end(), rng);
 
   // Read (all items should exist)
   for (std::vector<int64_t>::iterator i = ids.begin(); i != ids.end(); ++i) {