diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index b5671bc..c020871 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -25,6 +25,6 @@
 
 elif has Ubuntu $NODE_LABELS; then
     sudo apt-get -qq update
-    sudo apt-get -qy install g++ pkg-config python3-minimal \
+    sudo apt-get -qy install build-essential pkg-config python3-minimal \
                              libboost-all-dev libssl-dev libsqlite3-dev
 fi
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
index 7bf1cfe..4e0e154 100755
--- a/.jenkins.d/01-ndn-cxx.sh
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -35,16 +35,12 @@
 
 pushd ndn-cxx >/dev/null
 
-if has Linux $NODE_LABELS && [[ $CXX != clang* && -z $DISABLE_ASAN ]]; then
-    # https://stackoverflow.com/a/47022141
-    ASAN="--with-sanitizer=address"
-fi
 if has CentOS-8 $NODE_LABELS; then
     # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
     PCH="--without-pch"
 fi
 
-./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $ASAN $PCH
+./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $PCH
 ./waf --color=yes build -j$WAF_JOBS
 sudo_preserve_env PATH -- ./waf --color=yes install
 
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index d4b9652..9ea3853 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -3,28 +3,8 @@
 
 # Prepare environment
 rm -rf ~/.ndn
-
-if has OSX $NODE_LABELS; then
-    security unlock-keychain -p named-data
-fi
-
 ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
 
-BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
-
-ut_log_args() {
-    if (( BOOST_VERSION >= 106200 )); then
-        echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
-    else
-        if [[ -n $XUNIT ]]; then
-            echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
-                 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
-        else
-            echo --log_level=test_suite
-        fi
-    fi
-}
-
 # https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
 ASAN_OPTIONS="color=always"
 ASAN_OPTIONS+=":check_initialization_order=1"
@@ -37,6 +17,8 @@
 
 export BOOST_TEST_BUILD_INFO=1
 export BOOST_TEST_COLOR_OUTPUT=1
+export BOOST_TEST_DETECT_MEMORY_LEAK=0
+export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml
 
 # Run unit tests
-./build/unit-tests $(ut_log_args)
+./build/unit-tests
diff --git a/.travis.yml b/.travis.yml
index 54ce733..2e7caab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,6 +38,12 @@
     - os: osx
       osx_image: xcode11.3
       env: # default compiler
+    - os: osx
+      osx_image: xcode11.6
+      env: # default compiler
+    - os: osx
+      osx_image: xcode12
+      env: # default compiler
 
   allow_failures:
     - arch: s390x # bug 5098
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 9e045c3..f3be6e7 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -1,10 +1,11 @@
 # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
 
+import platform
 from waflib import Configure, Logs, Utils
 
 def options(opt):
     opt.add_option('--debug', '--with-debug', action='store_true', default=False,
-                   help='Compile in debugging mode with minimal optimizations (-O0 or -Og)')
+                   help='Compile in debugging mode with minimal optimizations (-Og)')
 
 def configure(conf):
     conf.start_msg('Checking C++ compiler version')
@@ -17,15 +18,21 @@
     if cxx == 'gcc':
         if ccver < (5, 3, 0):
             errmsg = ('The version of gcc you are using is too old.\n'
-                      'The minimum supported gcc version is 5.3.0.')
+                      'The minimum supported gcc version is 7.4.0.')
+        elif ccver < (7, 4, 0):
+            warnmsg = ('Using a version of gcc older than 7.4.0 is not '
+                       'officially supported and may result in build failures.')
         conf.flags = GccFlags()
     elif cxx == 'clang':
-        if ccver < (3, 6, 0):
+        if Utils.unversioned_sys_platform() == 'darwin' and ccver < (9, 0, 0):
+            errmsg = ('The version of Xcode you are using is too old.\n'
+                      'The minimum supported Xcode version is 9.0.')
+        elif ccver < (4, 0, 0):
             errmsg = ('The version of clang you are using is too old.\n'
-                      'The minimum supported clang version is 3.6.0.')
+                      'The minimum supported clang version is 4.0.')
         conf.flags = ClangFlags()
     else:
-        warnmsg = 'Note: %s compiler is unsupported' % cxx
+        warnmsg = '%s compiler is unsupported' % cxx
         conf.flags = CompilerFlags()
 
     if errmsg:
@@ -33,7 +40,7 @@
         conf.fatal(errmsg)
     elif warnmsg:
         conf.end_msg(ccverstr, color='YELLOW')
-        Logs.warn(warnmsg)
+        Logs.warn('WARNING: ' + warnmsg)
     else:
         conf.end_msg(ccverstr)
 
@@ -137,13 +144,14 @@
 
     def getDebugFlags(self, conf):
         flags = super(GccBasicFlags, self).getDebugFlags(conf)
-        flags['CXXFLAGS'] += ['-O0',
-                              '-Og', # gcc >= 4.8, clang >= 4.0
+        flags['CXXFLAGS'] += ['-Og',
                               '-g3',
                               '-pedantic',
                               '-Wall',
                               '-Wextra',
                               '-Werror',
+                              '-Wcatch-value=2',
+                              '-Wextra-semi',
                               '-Wnon-virtual-dtor',
                               '-Wno-error=deprecated-declarations', # Bug #3795
                               '-Wno-error=maybe-uninitialized', # Bug #1615
@@ -159,6 +167,8 @@
                               '-pedantic',
                               '-Wall',
                               '-Wextra',
+                              '-Wcatch-value=2',
+                              '-Wextra-semi',
                               '-Wnon-virtual-dtor',
                               '-Wno-unused-parameter',
                               ]
@@ -168,49 +178,50 @@
 class GccFlags(GccBasicFlags):
     def getDebugFlags(self, conf):
         flags = super(GccFlags, self).getDebugFlags(conf)
-        flags['CXXFLAGS'] += ['-fdiagnostics-color']
+        flags['CXXFLAGS'] += ['-fdiagnostics-color',
+                              '-Wredundant-tags',
+                              ]
+        if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
+            flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
         return flags
 
     def getOptimizedFlags(self, conf):
         flags = super(GccFlags, self).getOptimizedFlags(conf)
-        flags['CXXFLAGS'] += ['-fdiagnostics-color']
+        flags['CXXFLAGS'] += ['-fdiagnostics-color',
+                              '-Wredundant-tags',
+                              ]
+        if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0):
+            flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
         return flags
 
 class ClangFlags(GccBasicFlags):
     def getGeneralFlags(self, conf):
         flags = super(ClangFlags, self).getGeneralFlags(conf)
-        if Utils.unversioned_sys_platform() == 'darwin' and self.getCompilerVersion(conf) >= (9, 0, 0):
+        if Utils.unversioned_sys_platform() == 'darwin':
             # Bug #4296
             flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew
                                   ['-isystem', '/opt/local/include']] # for MacPorts
-        if Utils.unversioned_sys_platform() == 'freebsd':
-            flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']] # Bug #4790
+        elif Utils.unversioned_sys_platform() == 'freebsd':
+            # Bug #4790
+            flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
         return flags
 
     def getDebugFlags(self, conf):
         flags = super(ClangFlags, self).getDebugFlags(conf)
         flags['CXXFLAGS'] += ['-fcolor-diagnostics',
-                              '-Wextra-semi',
                               '-Wundefined-func-template',
                               '-Wno-unused-local-typedef', # Bugs #2657 and #3209
                               ]
-        version = self.getCompilerVersion(conf)
-        if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
-            flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
-        if version < (6, 0, 0):
+        if self.getCompilerVersion(conf) < (6, 0, 0):
             flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
         return flags
 
     def getOptimizedFlags(self, conf):
         flags = super(ClangFlags, self).getOptimizedFlags(conf)
         flags['CXXFLAGS'] += ['-fcolor-diagnostics',
-                              '-Wextra-semi',
                               '-Wundefined-func-template',
                               '-Wno-unused-local-typedef', # Bugs #2657 and #3209
                               ]
-        version = self.getCompilerVersion(conf)
-        if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
-            flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
-        if version < (6, 0, 0):
+        if self.getCompilerVersion(conf) < (6, 0, 0):
             flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
         return flags
diff --git a/common.hpp b/common.hpp
index 2ec0acd..656740e 100644
--- a/common.hpp
+++ b/common.hpp
@@ -57,9 +57,8 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/asio.hpp>
 #include <boost/assert.hpp>
-#include <boost/foreach.hpp>
+#include <boost/core/noncopyable.hpp>
 #include <boost/lexical_cast.hpp>
-#include <boost/noncopyable.hpp>
 
 namespace chronosync {
 
diff --git a/src/logic.cpp b/src/logic.cpp
index e0e6e02..2701aa5 100644
--- a/src/logic.cpp
+++ b/src/logic.cpp
@@ -482,14 +482,14 @@
 }
 
 void
-Logic::processResetInterest(const Interest& interest)
+Logic::processResetInterest(const Interest&)
 {
   _LOG_DEBUG_ID(">> Logic::processResetInterest");
   reset(true);
 }
 
 void
-Logic::processSyncData(const Name& name, ConstBufferPtr digest, const Block& syncReply)
+Logic::processSyncData(const Name&, ConstBufferPtr digest, const Block& syncReply)
 {
   _LOG_DEBUG_ID(">> Logic::processSyncData");
   DiffStatePtr commit = make_shared<DiffState>();
@@ -502,7 +502,7 @@
     reply.wireDecode(syncReply);
 
     std::vector<MissingDataInfo> v;
-    BOOST_FOREACH(ConstLeafPtr leaf, reply.getLeaves().get<ordered>()) {
+    for (const auto& leaf : reply.getLeaves().get<ordered>()) {
       BOOST_ASSERT(leaf != nullptr);
 
       const Name& info = leaf->getSessionName();
@@ -514,10 +514,8 @@
       std::tie(isInserted, isUpdated, oldSeq) = m_state.update(info, seq);
       if (isInserted || isUpdated) {
         commit->update(info, seq);
-
         oldSeq++;
-        MissingDataInfo mdi = {info, oldSeq, seq};
-        v.push_back(mdi);
+        v.push_back({info, oldSeq, seq});
       }
     }
 
diff --git a/src/state.cpp b/src/state.cpp
index c6b3ead..533a451 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2012-2017 University of California, Los Angeles
+ * Copyright (c) 2012-2020 University of California, Los Angeles
  *
  * This file is part of ChronoSync, synchronization library for distributed realtime
  * applications for NDN.
@@ -24,6 +24,8 @@
 
 #include "state.hpp"
 
+#include <boost/range/adaptor/reversed.hpp>
+
 namespace chronosync {
 
 State::~State() = default;
@@ -52,8 +54,7 @@
     }
 
     SeqNo old = (*leaf)->getSeq();
-    m_leaves.modify(leaf,
-                    [=] (LeafPtr& leaf) { leaf->setSeq(seq); } );
+    m_leaves.modify(leaf, [=] (LeafPtr& leaf) { leaf->setSeq(seq); } );
     return make_tuple(false, true, old);
   }
 }
@@ -63,16 +64,14 @@
 {
   m_digest.reset();
 
-  BOOST_FOREACH (ConstLeafPtr leaf, m_leaves.get<ordered>())
-    {
-      BOOST_ASSERT(leaf != 0);
-      m_digest.update(leaf->getDigest()->data(), leaf->getDigest()->size());
-    }
+  for (const auto& leaf : m_leaves.get<ordered>()) {
+    BOOST_ASSERT(leaf != nullptr);
+    m_digest.update(leaf->getDigest()->data(), leaf->getDigest()->size());
+  }
 
   return m_digest.computeDigest();
 }
 
-
 void
 State::reset()
 {
@@ -82,12 +81,10 @@
 State&
 State::operator+=(const State& state)
 {
-  BOOST_FOREACH (ConstLeafPtr leaf, state.getLeaves())
-    {
-      BOOST_ASSERT(leaf != 0);
-      update(leaf->getSessionName(), leaf->getSeq());
-    }
-
+  for (const auto& leaf : state.getLeaves()) {
+    BOOST_ASSERT(leaf != nullptr);
+    update(leaf->getSessionName(), leaf->getSeq());
+  }
   return *this;
 }
 
@@ -97,15 +94,14 @@
 {
   size_t totalLength = 0;
 
-  BOOST_REVERSE_FOREACH (ConstLeafPtr leaf, m_leaves.get<ordered>())
-    {
-      size_t entryLength = 0;
-      entryLength += prependNonNegativeIntegerBlock(block, tlv::SeqNo, leaf->getSeq());
-      entryLength += leaf->getSessionName().wireEncode(block);
-      entryLength += block.prependVarNumber(entryLength);
-      entryLength += block.prependVarNumber(tlv::StateLeaf);
-      totalLength += entryLength;
-    }
+  for (const auto& leaf : m_leaves.get<ordered>() | boost::adaptors::reversed) {
+    size_t entryLength = 0;
+    entryLength += prependNonNegativeIntegerBlock(block, tlv::SeqNo, leaf->getSeq());
+    entryLength += leaf->getSessionName().wireEncode(block);
+    entryLength += block.prependVarNumber(entryLength);
+    entryLength += block.prependVarNumber(tlv::StateLeaf);
+    totalLength += entryLength;
+  }
 
   totalLength += block.prependVarNumber(totalLength);
   totalLength += block.prependVarNumber(tlv::SyncReply);
@@ -144,12 +140,11 @@
   wire.parse();
   m_wire = wire;
 
-  for (Block::element_const_iterator it = wire.elements_begin();
-       it != wire.elements_end(); it++) {
+  for (auto it = wire.elements_begin(); it != wire.elements_end(); it++) {
     if (it->type() == tlv::StateLeaf) {
       it->parse();
 
-      Block::element_const_iterator val = it->elements_begin();
+      auto val = it->elements_begin();
       Name info(*val);
       val++;
 
diff --git a/tests/boost-multi-log-formatter.hpp b/tests/boost-multi-log-formatter.hpp
deleted file mode 100644
index ae37416..0000000
--- a/tests/boost-multi-log-formatter.hpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California.
- *
- * Based on work by Martin Ba (http://stackoverflow.com/a/26718189)
- *
- * This file is distributed under the Boost Software License, Version 1.0.
- * (See http://www.boost.org/LICENSE_1_0.txt)
- */
-
-#ifndef NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
-#define NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 105900
-#include <boost/test/unit_test_parameters.hpp>
-#else
-#include <boost/test/detail/unit_test_parameters.hpp>
-#endif // BOOST_VERSION >= 105900
-
-#include <boost/test/unit_test_log_formatter.hpp>
-#include <boost/test/output/compiler_log_formatter.hpp>
-#include <boost/test/output/xml_log_formatter.hpp>
-
-namespace boost {
-namespace unit_test {
-namespace output {
-
-/**
- * @brief Log formatter for Boost.Test that outputs the logging to multiple formatters
- *
- * The log formatter is designed to output to one or multiple formatters at the same time.  For
- * example, one HRF formatter can output to the standard output, while XML formatter output to
- * the file.
- *
- * Usage:
- *
- *     // Call in init_unit_test_suite: (this will override the --log_format parameter)
- *     auto formatter = new boost::unit_test::output::multi_log_formatter; // same as already configured logger
- *
- *     // Prepare and add additional logger(s)
- *     formatter.add(std::make_shared<boost::unit_test::output::xml_log_formatter>(),
- *                   std::make_shared<std::ofstream>("out.xml"));
- *
- *      boost::unit_test::unit_test_log.set_formatter(formatter);
- *
- * @note Calling `boost::unit_test::unit_test_log.set_stream(...)` will change the stream for
- *       the original logger.
- */
-class multi_log_formatter : public unit_test_log_formatter
-{
-public:
-  /**
-   * @brief Create instance of the logger, based on the configured logger instance
-   */
-  multi_log_formatter()
-  {
-    auto format =
-#if BOOST_VERSION > 105900
-      runtime_config::get<output_format>(runtime_config::LOG_FORMAT);
-#else
-      runtime_config::log_format();
-#endif // BOOST_VERSION > 105900
-
-    switch (format) {
-      default:
-#if BOOST_VERSION >= 105900
-      case OF_CLF:
-#else
-      case CLF:
-#endif // BOOST_VERSION >= 105900
-        m_loggers.push_back({std::make_shared<compiler_log_formatter>(), nullptr});
-        break;
-#if BOOST_VERSION >= 105900
-      case OF_XML:
-#else
-      case XML:
-#endif // BOOST_VERSION >= 105900
-        m_loggers.push_back({std::make_shared<xml_log_formatter>(), nullptr});
-        break;
-    }
-  }
-
-  void
-  add(std::shared_ptr<unit_test_log_formatter> formatter, std::shared_ptr<std::ostream> os)
-  {
-    m_loggers.push_back({formatter, os});
-  }
-
-  // Formatter interface
-  void
-  log_start(std::ostream& os, counter_t test_cases_amount)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_start(l.os == nullptr ? os : *l.os, test_cases_amount);
-  }
-
-  void
-  log_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_finish(l.os == nullptr ? os : *l.os);
-  }
-
-  void
-  log_build_info(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_build_info(l.os == nullptr ? os : *l.os);
-  }
-
-  void
-  test_unit_start(std::ostream& os, const test_unit& tu)
-  {
-    for (auto& l : m_loggers)
-      l.logger->test_unit_start(l.os == nullptr ? os : *l.os, tu);
-  }
-
-  void
-  test_unit_finish(std::ostream& os, const test_unit& tu, unsigned long elapsed)
-  {
-    for (auto& l : m_loggers)
-      l.logger->test_unit_finish(l.os == nullptr ? os : *l.os, tu, elapsed);
-  }
-
-  void
-  test_unit_skipped(std::ostream& os, const test_unit& tu)
-  {
-    for (auto& l : m_loggers)
-      l.logger->test_unit_skipped(l.os == nullptr ? os : *l.os, tu);
-  }
-
-#if BOOST_VERSION >= 105900
-  void
-  log_exception_start(std::ostream& os, const log_checkpoint_data& lcd, const execution_exception& ex)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_exception_start(l.os == nullptr ? os : *l.os, lcd, ex);
-  }
-
-  void
-  log_exception_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_exception_finish(l.os == nullptr ? os : *l.os);
-  }
-#else
-  void
-  log_exception(std::ostream& os, const log_checkpoint_data& lcd, const execution_exception& ex)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_exception(l.os == nullptr ? os : *l.os, lcd, ex);
-  }
-#endif // BOOST_VERSION >= 105900
-
-  void
-  log_entry_start(std::ostream& os, const log_entry_data& entry_data, log_entry_types let)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_start(l.os == nullptr ? os : *l.os, entry_data, let);
-  }
-
-  void
-  log_entry_value(std::ostream& os, const_string value)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_value(l.os == nullptr ? os : *l.os, value);
-  }
-
-  void
-  log_entry_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_finish(l.os == nullptr ? os : *l.os);
-  }
-
-#if BOOST_VERSION >= 105900
-  void
-  entry_context_start(std::ostream& os, log_level level)
-  {
-    for (auto& l : m_loggers)
-      l.logger->entry_context_start(l.os == nullptr ? os : *l.os, level);
-  }
-
-  void
-  log_entry_context(std::ostream& os, const_string value)
-  {
-    for (auto& l : m_loggers)
-      l.logger->log_entry_context(l.os == nullptr ? os : *l.os, value);
-  }
-
-  void
-  entry_context_finish(std::ostream& os)
-  {
-    for (auto& l : m_loggers)
-      l.logger->entry_context_finish(l.os == nullptr ? os : *l.os);
-  }
-#endif // BOOST_VERSION >= 105900
-
-private:
-  struct LoggerInfo
-  {
-    std::shared_ptr<unit_test_log_formatter> logger;
-    std::shared_ptr<std::ostream> os;
-  };
-  std::vector<LoggerInfo> m_loggers;
-};
-
-} // namespace output
-} // namespace unit_test
-} // namespace boost
-
-#endif // NDN_TESTS_BOOST_MULTI_LOG_FORMATTER_HPP
diff --git a/tests/main.cpp b/tests/main.cpp
index 70d0433..d6119af 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -1,115 +1,21 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
+ * Copyright (c) 2012-2020 University of California, Los Angeles
  *
  * This file is part of ChronoSync, synchronization library for distributed realtime
- * applications for NDN, originally developed as part of NFD (Named Data Networking
- * Forwarding Daemon).  See AUTHORS.md for complete list of NFD authors and contributors.
+ * applications for NDN.
  *
- * NFD 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.
+ * ChronoSync 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.
  *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * ChronoSync 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ * ChronoSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #define BOOST_TEST_MODULE ChronoSync
-
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 106200
-// Boost.Test v3.3 (Boost 1.62) natively supports multi-logger output
 #include "tests/boost-test.hpp"
-#else
-#define BOOST_TEST_ALTERNATIVE_INIT_API
-#define BOOST_TEST_NO_MAIN
-#include "tests/boost-test.hpp"
-#include "tests/boost-multi-log-formatter.hpp"
-
-#include <boost/program_options/options_description.hpp>
-#include <boost/program_options/variables_map.hpp>
-#include <boost/program_options/parsers.hpp>
-
-#include <fstream>
-#include <iostream>
-
-static bool
-init_tests()
-{
-  init_unit_test();
-
-  namespace po = boost::program_options;
-  namespace ut = boost::unit_test;
-
-  po::options_description extraOptions;
-  std::string logger;
-  std::string outputFile = "-";
-  extraOptions.add_options()
-    ("log_format2", po::value<std::string>(&logger), "Type of second log formatter: HRF or XML")
-    ("log_sink2", po::value<std::string>(&outputFile)->default_value(outputFile), "Second log sink, - for stdout")
-    ;
-  po::variables_map vm;
-  try {
-    po::store(po::command_line_parser(ut::framework::master_test_suite().argc,
-                                      ut::framework::master_test_suite().argv)
-                .options(extraOptions)
-                .run(),
-              vm);
-    po::notify(vm);
-  }
-  catch (const std::exception& e) {
-    std::cerr << "ERROR: " << e.what() << "\n"
-              << extraOptions << std::endl;
-    return false;
-  }
-
-  if (vm.count("log_format2") == 0) {
-    // second logger is not configured
-    return true;
-  }
-
-  std::shared_ptr<ut::unit_test_log_formatter> formatter;
-  if (logger == "XML") {
-    formatter = std::make_shared<ut::output::xml_log_formatter>();
-  }
-  else if (logger == "HRF") {
-    formatter = std::make_shared<ut::output::compiler_log_formatter>();
-  }
-  else {
-    std::cerr << "ERROR: only HRF or XML log formatter can be specified" << std::endl;
-    return false;
-  }
-
-  std::shared_ptr<std::ostream> output;
-  if (outputFile == "-") {
-    output = std::shared_ptr<std::ostream>(&std::cout, std::bind([]{}));
-  }
-  else {
-    output = std::make_shared<std::ofstream>(outputFile.c_str());
-  }
-
-  auto multiFormatter = new ut::output::multi_log_formatter;
-  multiFormatter->add(formatter, output);
-  ut::unit_test_log.set_formatter(multiFormatter);
-
-  return true;
-}
-
-int
-main(int argc, char* argv[])
-{
-  return ::boost::unit_test::unit_test_main(&init_tests, argc, argv);
-}
-
-#endif // BOOST_VERSION >= 106200
diff --git a/wscript b/wscript
index 848dbf1..03a2995 100644
--- a/wscript
+++ b/wscript
@@ -8,9 +8,10 @@
 GIT_TAG_PREFIX = ''
 
 def options(opt):
-    opt.load(['compiler_c', 'compiler_cxx', 'gnu_dirs'])
-    opt.load(['default-compiler-flags', 'boost', 'doxygen', 'sphinx_build',
-              'coverage', 'sanitizers'],
+    opt.load(['compiler_cxx', 'gnu_dirs'])
+    opt.load(['default-compiler-flags',
+              'coverage', 'sanitizers', 'boost',
+              'doxygen', 'sphinx_build'],
              tooldir=['.waf-tools'])
 
     optgrp = opt.add_option_group('ChronoSync Options')
@@ -18,7 +19,7 @@
                       help='Build unit tests')
 
 def configure(conf):
-    conf.load(['compiler_c', 'compiler_cxx', 'gnu_dirs',
+    conf.load(['compiler_cxx', 'gnu_dirs',
                'default-compiler-flags', 'boost',
                'doxygen', 'sphinx_build'])
 
