Replace all uses of BOOST_THROW_EXCEPTION with NDN_THROW

Refs: #4834
Change-Id: If2455e1830f310beea434ffb455d960e11c4c2ed
diff --git a/tests/daemon/face/channel-fixture.hpp b/tests/daemon/face/channel-fixture.hpp
index f764125..7efedfd 100644
--- a/tests/daemon/face/channel-fixture.hpp
+++ b/tests/daemon/face/channel-fixture.hpp
@@ -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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -63,16 +63,15 @@
   virtual unique_ptr<ChannelT>
   makeChannel()
   {
-    BOOST_THROW_EXCEPTION(std::logic_error("unimplemented"));
+    BOOST_FAIL("Unimplemented");
+    return nullptr;
   }
 
-  /**
-   * if port == 0, use the port number returned by getNextPort()
-   */
   virtual unique_ptr<ChannelT>
-  makeChannel(const boost::asio::ip::address& addr, uint16_t port = 0)
+  makeChannel(const boost::asio::ip::address&, uint16_t port = 0)
   {
-    BOOST_THROW_EXCEPTION(std::logic_error("unimplemented"));
+    BOOST_FAIL("Unimplemented");
+    return nullptr;
   }
 
   void
@@ -93,7 +92,7 @@
   virtual void
   connect(ChannelT&)
   {
-    BOOST_THROW_EXCEPTION(std::logic_error("unimplemented"));
+    BOOST_FAIL("Unimplemented");
   }
 
 protected:
diff --git a/tests/daemon/face/udp-factory.t.cpp b/tests/daemon/face/udp-factory.t.cpp
index 088b300..0c10276 100644
--- a/tests/daemon/face/udp-factory.t.cpp
+++ b/tests/daemon/face/udp-factory.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -869,14 +869,14 @@
   SKIP_IF_NOT_SUPERUSER();
 #endif // __linux__
 
-  // createChannel with a local endpoint that has already been allocated for a UDP multicast face
+  // createChannel with a local endpoint that has already been allocated to a UDP multicast face
   if (!netifsV4.empty()) {
     auto mcastFace = createMulticastFace("127.0.0.1", "224.0.0.254", 20072);
     BOOST_CHECK_EXCEPTION(createChannel("127.0.0.1", 20072), UdpFactory::Error,
                           [] (const UdpFactory::Error& e) {
                             return strcmp(e.what(),
                                           "Cannot create UDP channel on 127.0.0.1:20072, "
-                                          "endpoint already allocated for a UDP multicast face") == 0;
+                                          "endpoint already allocated to a UDP multicast face") == 0;
                           });
   }
   if (!netifsV6.empty()) {
@@ -885,7 +885,7 @@
                           [] (const UdpFactory::Error& e) {
                             return strcmp(e.what(),
                                           "Cannot create UDP channel on [::1]:20072, "
-                                          "endpoint already allocated for a UDP multicast face") == 0;
+                                          "endpoint already allocated to a UDP multicast face") == 0;
                           });
   }
 }
@@ -917,7 +917,7 @@
                         [] (const UdpFactory::Error& e) {
                           return strcmp(e.what(),
                                         "Cannot create UDP multicast face on 127.0.0.1:20071, "
-                                        "endpoint already allocated for a UDP channel") == 0;
+                                        "endpoint already allocated to a UDP channel") == 0;
                         });
 
   // create with a local endpoint already used by a multicast face on a different multicast group
@@ -925,7 +925,7 @@
                         [] (const UdpFactory::Error& e) {
                           return strcmp(e.what(),
                                         "Cannot create UDP multicast face on 127.0.0.1:20070, "
-                                        "endpoint already allocated for a different UDP multicast face") == 0;
+                                        "endpoint already allocated to a different UDP multicast face") == 0;
                         });
 }
 
@@ -956,7 +956,7 @@
                         [] (const UdpFactory::Error& e) {
                           return strcmp(e.what(),
                                         "Cannot create UDP multicast face on [::1]:20071, "
-                                        "endpoint already allocated for a UDP channel") == 0;
+                                        "endpoint already allocated to a UDP channel") == 0;
                         });
 
   // create with a local endpoint already used by a multicast face on a different multicast group
@@ -964,7 +964,7 @@
                         [] (const UdpFactory::Error& e) {
                           return strcmp(e.what(),
                                         "Cannot create UDP multicast face on [::1]:20070, "
-                                        "endpoint already allocated for a different UDP multicast face") == 0;
+                                        "endpoint already allocated to a different UDP multicast face") == 0;
                         });
 }
 
diff --git a/tests/daemon/fw/choose-strategy.hpp b/tests/daemon/fw/choose-strategy.hpp
index 4045540..0da7b84 100644
--- a/tests/daemon/fw/choose-strategy.hpp
+++ b/tests/daemon/fw/choose-strategy.hpp
@@ -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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,6 +28,7 @@
 
 #include "fw/forwarder.hpp"
 #include "table/strategy-choice.hpp"
+
 #include <boost/lexical_cast.hpp>
 
 namespace nfd {
@@ -54,7 +55,7 @@
   StrategyChoice& sc = forwarder.getStrategyChoice();
   auto insertRes = sc.insert(prefix, instanceName);
   if (!insertRes) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument(boost::lexical_cast<std::string>(insertRes)));
+    NDN_THROW(std::invalid_argument(boost::lexical_cast<std::string>(insertRes)));
   }
   return dynamic_cast<S&>(sc.findEffectiveStrategy(prefix));
 }
diff --git a/tests/daemon/mgmt/general-config-section.t.cpp b/tests/daemon/mgmt/general-config-section.t.cpp
index a12b09b..98b9458 100644
--- a/tests/daemon/mgmt/general-config-section.t.cpp
+++ b/tests/daemon/mgmt/general-config-section.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -138,7 +138,7 @@
                         ConfigFile::Error,
                         [] (const ConfigFile::Error& e) {
                           return std::strcmp(e.what(),
-                                             "Invalid value for \"user\" in \"general\" section") == 0;
+                                             "Invalid value for 'user' in section 'general'") == 0;
                         });
 }
 
@@ -155,7 +155,7 @@
                         ConfigFile::Error,
                         [] (const ConfigFile::Error& e) {
                           return std::strcmp(e.what(),
-                                             "Invalid value for \"group\" in \"general\" section") == 0;
+                                             "Invalid value for 'group' in section 'general'") == 0;
                         });
 }
 
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index ab361fd..e9b2762 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -94,7 +94,7 @@
   }
   catch (const ndn::security::Pib::Error&) {
     if (!wantAdd) {
-      BOOST_THROW_EXCEPTION(std::runtime_error("identity does not exist"));
+      NDN_THROW_NESTED(std::runtime_error("Identity does not exist"));
     }
     cert = m_keyChain.createIdentity(identity).getDefaultKey().getDefaultCertificate();
   }
diff --git a/tests/limited-io.cpp b/tests/limited-io.cpp
index 9f8f4dc..f31ec9c 100644
--- a/tests/limited-io.cpp
+++ b/tests/limited-io.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -98,7 +98,7 @@
     m_reason = EXCEED_OPS;
     getGlobalIoService().stop();
     if (m_uttf != nullptr) {
-      BOOST_THROW_EXCEPTION(StopException());
+      NDN_THROW(StopException());
     }
   }
 }
@@ -109,7 +109,7 @@
   m_reason = EXCEED_TIME;
   getGlobalIoService().stop();
   if (m_uttf != nullptr) {
-    BOOST_THROW_EXCEPTION(StopException());
+    NDN_THROW(StopException());
   }
 }
 
diff --git a/tests/other/face-benchmark.cpp b/tests/other/face-benchmark.cpp
index 007a87b..5745c03 100644
--- a/tests/other/face-benchmark.cpp
+++ b/tests/other/face-benchmark.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -94,7 +94,7 @@
     }
 
     if (m_faceUris.empty()) {
-      BOOST_THROW_EXCEPTION(std::runtime_error("No supported FaceUri pairs found in config file"));
+      NDN_THROW(std::runtime_error("No supported FaceUri pairs found in config file"));
     }
   }
 
@@ -159,7 +159,7 @@
   static void
   onFaceCreationFailed(uint32_t status, const std::string& reason)
   {
-    BOOST_THROW_EXCEPTION(std::runtime_error("Failed to create face: " + to_string(status) + ": " + reason));
+    NDN_THROW(std::runtime_error("Failed to create face: [" + to_string(status) + "] " + reason));
   }
 
 private:
diff --git a/tests/other/fw/congestion-mark-strategy.cpp b/tests/other/fw/congestion-mark-strategy.cpp
index 717853f..744608f 100644
--- a/tests/other/fw/congestion-mark-strategy.cpp
+++ b/tests/other/fw/congestion-mark-strategy.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -41,7 +41,7 @@
   switch (parsed.parameters.size()) {
   case 2:
     if (parsed.parameters.at(1).toUri() != "true" && parsed.parameters.at(1).toUri() != "false") {
-      BOOST_THROW_EXCEPTION(std::invalid_argument(
+      NDN_THROW(std::invalid_argument(
         "Second parameter to CongestionMarkStrategy must be either 'true' or 'false'"));
     }
     m_shouldPreserveMark = parsed.parameters.at(1).toUri() == "true";
@@ -50,22 +50,22 @@
     try {
       auto s = parsed.parameters.at(0).toUri();
       if (!s.empty() && s[0] == '-')
-        BOOST_THROW_EXCEPTION(boost::bad_lexical_cast());
+        NDN_THROW(boost::bad_lexical_cast());
       m_congestionMark = boost::lexical_cast<uint64_t>(s);
     }
     catch (const boost::bad_lexical_cast&) {
-      BOOST_THROW_EXCEPTION(std::invalid_argument(
+      NDN_THROW(std::invalid_argument(
         "First parameter to CongestionMarkStrategy must be a non-negative integer"));
     }
     NDN_CXX_FALLTHROUGH;
   case 0:
     break;
   default:
-    BOOST_THROW_EXCEPTION(std::invalid_argument("CongestionMarkStrategy does not accept more than 2 parameters"));
+    NDN_THROW(std::invalid_argument("CongestionMarkStrategy does not accept more than 2 parameters"));
   }
 
   if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
-    BOOST_THROW_EXCEPTION(std::invalid_argument(
+    NDN_THROW(std::invalid_argument(
       "CongestionMarkStrategy does not support version " + to_string(*parsed.version)));
   }
   this->setInstanceName(makeInstanceName(name, getStrategyName()));