Switch to std::filesystem

Drop the dependency on Boost.Filesystem

Change-Id: I5d6f6fe38cd0cf1c6996221188fa63db146dc9f9
diff --git a/tests/key-chain-fixture.cpp b/tests/key-chain-fixture.cpp
index fefc7cf..9c5c17a 100644
--- a/tests/key-chain-fixture.cpp
+++ b/tests/key-chain-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,7 +23,8 @@
 
 #include "ndn-cxx/util/io.hpp"
 
-#include <boost/filesystem/operations.hpp>
+#include <filesystem>
+#include <system_error>
 
 namespace ndn::tests {
 
@@ -36,9 +37,9 @@
 
 KeyChainFixture::~KeyChainFixture()
 {
-  boost::system::error_code ec;
+  std::error_code ec;
   for (const auto& certFile : m_certFiles) {
-    boost::filesystem::remove(certFile, ec); // ignore error
+    std::filesystem::remove(certFile, ec); // ignore error
   }
 }
 
diff --git a/tests/test-home-fixture.hpp b/tests/test-home-fixture.hpp
index 9801c92..fc82af0 100644
--- a/tests/test-home-fixture.hpp
+++ b/tests/test-home-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -25,12 +25,11 @@
 #include "ndn-cxx/security/key-chain.hpp"
 
 #include <cstdlib>
+#include <filesystem>
 #include <fstream>
 #include <initializer_list>
 
 #include <boost/algorithm/string/replace.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
 
 namespace ndn::tests {
 
@@ -46,11 +45,11 @@
 public:
   PibDirFixture()
   {
-    if (std::getenv("NDN_CLIENT_PIB") != nullptr) {
-      m_oldPib = std::getenv("NDN_CLIENT_PIB");
+    if (const char* envPib = std::getenv("NDN_CLIENT_PIB"); envPib != nullptr) {
+      m_oldPib = envPib;
     }
-    if (std::getenv("NDN_CLIENT_TPM") != nullptr) {
-      m_oldTpm = std::getenv("NDN_CLIENT_TPM");
+    if (const char* envTpm = std::getenv("NDN_CLIENT_TPM"); envTpm != nullptr) {
+      m_oldTpm = envTpm;
     }
 
     /// @todo Consider change to an in-memory PIB/TPM
@@ -74,7 +73,7 @@
       unsetenv("NDN_CLIENT_TPM");
     }
 
-    boost::filesystem::remove_all(m_pibDir);
+    std::filesystem::remove_all(m_pibDir);
     KeyChain::resetDefaultLocators();
   }
 
@@ -106,8 +105,9 @@
   void
   createClientConf(std::initializer_list<std::string> lines) const
   {
-    boost::filesystem::create_directories(boost::filesystem::path(this->m_pibDir) / ".ndn");
-    std::ofstream of((boost::filesystem::path(this->m_pibDir) / ".ndn" / "client.conf").c_str());
+    auto ndnDir = std::filesystem::path(this->m_pibDir) / ".ndn";
+    std::filesystem::create_directories(ndnDir);
+    std::ofstream of(ndnDir / "client.conf");
     for (auto line : lines) {
       boost::replace_all(line, "%PATH%", this->m_pibDir);
       of << line << std::endl;
diff --git a/tests/tests-pch.hpp b/tests/tests-pch.hpp
index 30e0fdc..c277bcf 100644
--- a/tests/tests-pch.hpp
+++ b/tests/tests-pch.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -31,7 +31,7 @@
 
 #include "tests/boost-test.hpp"
 
+#include <filesystem>
 #include <fstream>
-#include <boost/filesystem.hpp>
 
 #endif // NDN_CXX_TESTS_TESTS_PCH_HPP
diff --git a/tests/unit/security/pib/pib-impl.t.cpp b/tests/unit/security/pib/pib-impl.t.cpp
index d3d73de..7f624fd 100644
--- a/tests/unit/security/pib/pib-impl.t.cpp
+++ b/tests/unit/security/pib/pib-impl.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -25,7 +25,8 @@
 #include "tests/boost-test.hpp"
 #include "tests/unit/security/pib/pib-data-fixture.hpp"
 
-#include <boost/filesystem.hpp>
+#include <filesystem>
+
 #include <boost/mp11/list.hpp>
 
 namespace ndn::tests {
@@ -46,14 +47,14 @@
 public:
   ~PibSqlite3Fixture()
   {
-    boost::filesystem::remove_all(m_path);
+    std::filesystem::remove_all(m_path);
   }
 
 private:
-  const boost::filesystem::path m_path{boost::filesystem::path(UNIT_TESTS_TMPDIR) / "TestPibImpl"};
+  const std::filesystem::path m_path{std::filesystem::path(UNIT_TESTS_TMPDIR) / "TestPibImpl"};
 
 public:
-  PibSqlite3 pib{m_path.string()};
+  PibSqlite3 pib{m_path};
 };
 
 using PibImpls = boost::mp11::mp_list<PibMemoryFixture, PibSqlite3Fixture>;
diff --git a/tests/unit/security/tpm/back-end-wrapper-file.hpp b/tests/unit/security/tpm/back-end-wrapper-file.hpp
index 6d8a663..cd25978 100644
--- a/tests/unit/security/tpm/back-end-wrapper-file.hpp
+++ b/tests/unit/security/tpm/back-end-wrapper-file.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,7 +24,7 @@
 
 #include "ndn-cxx/security/tpm/impl/back-end-file.hpp"
 
-#include <boost/filesystem.hpp>
+#include <filesystem>
 
 namespace ndn::tests {
 
@@ -35,14 +35,14 @@
 {
 public:
   BackEndWrapperFile()
-    : m_tmpPath(boost::filesystem::path(UNIT_TESTS_TMPDIR) / "TpmBackEndFile")
-    , m_impl(make_unique<security::tpm::BackEndFile>(m_tmpPath.string()))
+    : m_tmpPath(std::filesystem::path(UNIT_TESTS_TMPDIR) / "TpmBackEndFile")
+    , m_impl(make_unique<security::tpm::BackEndFile>(m_tmpPath))
   {
   }
 
   ~BackEndWrapperFile()
   {
-    boost::filesystem::remove_all(m_tmpPath);
+    std::filesystem::remove_all(m_tmpPath);
   }
 
   security::tpm::BackEnd&
@@ -58,7 +58,7 @@
   }
 
 private:
-  const boost::filesystem::path m_tmpPath;
+  const std::filesystem::path m_tmpPath;
   const unique_ptr<security::tpm::BackEnd> m_impl;
 };
 
diff --git a/tests/unit/security/trust-anchor-container.t.cpp b/tests/unit/security/trust-anchor-container.t.cpp
index 246ef1c..b711ba6 100644
--- a/tests/unit/security/trust-anchor-container.t.cpp
+++ b/tests/unit/security/trust-anchor-container.t.cpp
@@ -25,8 +25,6 @@
 #include "tests/key-chain-fixture.hpp"
 #include "tests/unit/clock-fixture.hpp"
 
-#include <boost/filesystem/operations.hpp>
-
 namespace ndn::tests {
 
 using namespace ndn::security;
@@ -38,20 +36,20 @@
 public:
   TrustAnchorContainerFixture()
   {
-    boost::filesystem::create_directories(certDirPath);
+    std::filesystem::create_directories(certDirPath);
 
     identity1 = m_keyChain.createIdentity("/TestAnchorContainer/First");
     cert1 = identity1.getDefaultKey().getDefaultCertificate();
-    saveCert(cert1, certPath1.string());
+    saveCert(cert1, certPath1);
 
     identity2 = m_keyChain.createIdentity("/TestAnchorContainer/Second");
     cert2 = identity2.getDefaultKey().getDefaultCertificate();
-    saveCert(cert2, certPath2.string());
+    saveCert(cert2, certPath2);
   }
 
   ~TrustAnchorContainerFixture() override
   {
-    boost::filesystem::remove_all(certDirPath);
+    std::filesystem::remove_all(certDirPath);
   }
 
   void
@@ -73,9 +71,9 @@
   }
 
 public:
-  const boost::filesystem::path certDirPath{boost::filesystem::path(UNIT_TESTS_TMPDIR) / "test-cert-dir"};
-  const boost::filesystem::path certPath1{certDirPath / "trust-anchor-1.cert"};
-  const boost::filesystem::path certPath2{certDirPath / "trust-anchor-2.cert"};
+  const std::filesystem::path certDirPath{std::filesystem::path(UNIT_TESTS_TMPDIR) / "test-cert-dir"};
+  const std::filesystem::path certPath1{certDirPath / "trust-anchor-1.cert"};
+  const std::filesystem::path certPath2{certDirPath / "trust-anchor-2.cert"};
 
   TrustAnchorContainer anchorContainer;
 
@@ -100,20 +98,20 @@
   BOOST_CHECK_NO_THROW(anchorContainer.insert("group1", Certificate(cert1)));
   BOOST_CHECK_EQUAL(cert, anchorContainer.find(cert1.getName())); // still the same instance of the certificate
   // cannot add dynamic group when static already exists
-  BOOST_CHECK_THROW(anchorContainer.insert("group1", certPath1.string(), 1_s), TrustAnchorContainer::Error);
+  BOOST_CHECK_THROW(anchorContainer.insert("group1", certPath1, 1_s), TrustAnchorContainer::Error);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group1").size(), 1);
   BOOST_CHECK_EQUAL(anchorContainer.size(), 1);
 
   // From file
-  anchorContainer.insert("group2", certPath2.string(), 1_s);
+  anchorContainer.insert("group2", certPath2, 1_s);
   BOOST_CHECK(anchorContainer.find(cert2.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) != nullptr);
   BOOST_CHECK_THROW(anchorContainer.insert("group2", Certificate(cert2)), TrustAnchorContainer::Error);
-  BOOST_CHECK_THROW(anchorContainer.insert("group2", certPath2.string(), 1_s), TrustAnchorContainer::Error);
+  BOOST_CHECK_THROW(anchorContainer.insert("group2", certPath2, 1_s), TrustAnchorContainer::Error);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group2").size(), 1);
   BOOST_CHECK_EQUAL(anchorContainer.size(), 2);
 
-  boost::filesystem::remove(certPath2);
+  std::filesystem::remove(certPath2);
   advanceClocks(1_s, 11);
 
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
@@ -134,15 +132,15 @@
 
 BOOST_AUTO_TEST_CASE(DynamicAnchorFromDir)
 {
-  boost::filesystem::remove(certPath2);
+  std::filesystem::remove(certPath2);
 
-  anchorContainer.insert("group", certDirPath.string(), 1_s, true /* isDir */);
+  anchorContainer.insert("group", certDirPath, 1_s, /*isDir*/ true);
 
   BOOST_CHECK(anchorContainer.find(identity1.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group").size(), 1);
 
-  saveCert(cert2, certPath2.string());
+  saveCert(cert2, certPath2);
 
   advanceClocks(100_ms, 11);
 
@@ -150,7 +148,7 @@
   BOOST_CHECK(anchorContainer.find(identity2.getName()) != nullptr);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group").size(), 2);
 
-  boost::filesystem::remove_all(certDirPath);
+  std::filesystem::remove_all(certDirPath);
 
   advanceClocks(100_ms, 11);
 
@@ -161,7 +159,7 @@
 
 BOOST_AUTO_TEST_CASE(FindByInterest)
 {
-  anchorContainer.insert("group1", certPath1.string(), 1_s);
+  anchorContainer.insert("group1", certPath1, 1_s);
 
   checkFindByInterest(identity1.getName(), true, cert1);
   checkFindByInterest(identity1.getName().getPrefix(-1), true, cert1);
diff --git a/tests/unit/security/validation-policy-config.t.cpp b/tests/unit/security/validation-policy-config.t.cpp
index 746ac90..34412a1 100644
--- a/tests/unit/security/validation-policy-config.t.cpp
+++ b/tests/unit/security/validation-policy-config.t.cpp
@@ -62,7 +62,7 @@
 public:
   ValidationPolicyConfigFixture()
   {
-    boost::filesystem::create_directories(path);
+    std::filesystem::create_directories(path);
     baseConfig = R"CONF(
         rule
         {
@@ -85,7 +85,7 @@
 
   ~ValidationPolicyConfigFixture()
   {
-    boost::filesystem::remove_all(path);
+    std::filesystem::remove_all(path);
   }
 
 private:
@@ -101,7 +101,7 @@
   }
 
 protected:
-  const boost::filesystem::path path{boost::filesystem::path(UNIT_TESTS_TMPDIR) / "security" / "validation-policy-config"};
+  const std::filesystem::path path{std::filesystem::path(UNIT_TESTS_TMPDIR) / "security" / "validation-policy-config"};
   std::string baseConfig;
 
   using Packet = PacketType;
@@ -115,14 +115,14 @@
   {
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, false);
 
-    this->saveIdentityCert(this->identity, (this->path / "identity.ndncert").string());
+    this->saveIdentityCert(this->identity, this->path / "identity.ndncert");
     this->policy.load(this->baseConfig + R"CONF(
         trust-anchor
         {
           type file
           file-name "trust-anchor.ndncert"
         }
-      )CONF", (this->path / "test-config").string());
+      )CONF", this->path / "test-config");
 
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, true);
     BOOST_CHECK_EQUAL(this->policy.m_shouldBypass, false);
@@ -135,7 +135,7 @@
 public:
   LoadFileWithFileAnchor()
   {
-    std::string configFile = (this->path / "config.conf").string();
+    auto configFile = this->path / "config.conf";
     {
       std::ofstream config(configFile);
       config << this->baseConfig << R"CONF(
@@ -147,7 +147,7 @@
         )CONF";
     }
 
-    this->saveIdentityCert(this->identity, (this->path / "identity.ndncert").string());
+    this->saveIdentityCert(this->identity, this->path / "identity.ndncert");
 
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, false);
 
@@ -164,7 +164,7 @@
 public:
   LoadFileWithMultipleFileAnchors()
   {
-    std::string configFile = (this->path / "config.conf").string();
+    auto configFile = this->path / "config.conf";
     {
       std::ofstream config(configFile);
       config << this->baseConfig << R"CONF(
@@ -181,7 +181,7 @@
         )CONF";
     }
 
-    this->saveIdentityCert(this->identity, (this->path / "identity.ndncert").string());
+    this->saveIdentityCert(this->identity, this->path / "identity.ndncert");
 
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, false);
 
@@ -206,11 +206,11 @@
         }
       )CONF");
 
-    this->saveIdentityCert(this->identity, (this->path / "identity.ndncert").string());
+    this->saveIdentityCert(this->identity, this->path / "identity.ndncert");
 
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, false);
 
-    this->policy.load(section, (this->path / "test-config").string());
+    this->policy.load(section, this->path / "test-config");
 
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, true);
     BOOST_CHECK_EQUAL(this->policy.m_shouldBypass, false);
@@ -238,7 +238,7 @@
           type base64
           base64-string ")CONF" + os.str() + R"CONF("
         }
-      )CONF", (this->path / "test-config").string());
+      )CONF", this->path / "test-config");
 
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, true);
     BOOST_CHECK_EQUAL(this->policy.m_shouldBypass, false);
@@ -307,8 +307,8 @@
   {
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, false);
 
-    boost::filesystem::create_directories(this->path / "keys");
-    this->saveIdentityCert(this->identity, (this->path / "keys" / "identity.ndncert").string());
+    std::filesystem::create_directories(this->path / "keys");
+    this->saveIdentityCert(this->identity, this->path / "keys" / "identity.ndncert");
 
     this->policy.load(this->baseConfig + R"CONF(
         trust-anchor
@@ -317,7 +317,7 @@
           dir keys
           )CONF" + Refresh::getRefreshString() + R"CONF(
         }
-      )CONF", (this->path / "test-config").string());
+      )CONF", this->path / "test-config");
 
     BOOST_CHECK_EQUAL(this->policy.m_isConfigured, true);
     BOOST_CHECK_EQUAL(this->policy.m_shouldBypass, false);
@@ -713,7 +713,7 @@
   using Packet = Data;
   Packet unsignedPacket("/Security/ValidatorFixture/Sub1/Sub2/Packet");
 
-  boost::filesystem::remove(this->path / "keys" / "identity.ndncert");
+  std::filesystem::remove(this->path / "keys" / "identity.ndncert");
   this->advanceClocks(Refresh::getRefreshTime(), 3);
 
   Packet packet = unsignedPacket;
diff --git a/tests/unit/security/validator-config.t.cpp b/tests/unit/security/validator-config.t.cpp
index 3cfb122..8ca4245 100644
--- a/tests/unit/security/validator-config.t.cpp
+++ b/tests/unit/security/validator-config.t.cpp
@@ -51,28 +51,27 @@
 {
 public:
   ValidatorConfigFixture()
-    : path(boost::filesystem::path(UNIT_TESTS_TMPDIR) / "security" / "validator-config")
+    : path(std::filesystem::path(UNIT_TESTS_TMPDIR) / "security" / "validator-config")
     , validator(make_unique<security::CertificateFetcherOffline>())
   {
-    boost::filesystem::create_directories(path);
+    std::filesystem::create_directories(path);
     config = R"CONF(
         trust-anchor
         {
           type any
         }
       )CONF";
-    configFile = (this->path / "config.conf").string();
-    std::ofstream f(configFile.c_str());
-    f << config;
+    configFile = path / "config.conf";
+    std::ofstream(configFile) << config;
   }
 
   ~ValidatorConfigFixture()
   {
-    boost::filesystem::remove_all(path);
+    std::filesystem::remove_all(path);
   }
 
 public:
-  const boost::filesystem::path path;
+  const std::filesystem::path path;
   std::string config;
   std::string configFile;
   ValidatorConfig validator;
diff --git a/tests/unit/util/config-file.t.cpp b/tests/unit/util/config-file.t.cpp
index ab8f212..eac5f21 100644
--- a/tests/unit/util/config-file.t.cpp
+++ b/tests/unit/util/config-file.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,7 +24,6 @@
 #include "tests/boost-test.hpp"
 #include "tests/unit/test-home-env-saver.hpp"
 
-#include <boost/filesystem/operations.hpp>
 #include <cstdlib>
 
 namespace ndn::tests {
@@ -34,15 +33,13 @@
 
 BOOST_AUTO_TEST_CASE(Parse)
 {
-  namespace fs = boost::filesystem;
-
   setenv("TEST_HOME", "tests/unit/util/config-file-home", 1);
 
-  fs::path homePath(fs::absolute(std::getenv("TEST_HOME")));
+  auto homePath = std::filesystem::absolute(std::getenv("TEST_HOME"));
   homePath /= ".ndn/client.conf";
 
   ConfigFile config;
-  BOOST_REQUIRE_EQUAL(config.getPath(), homePath);
+  BOOST_CHECK_EQUAL(config.getPath(), homePath);
 
   const ConfigFile::Parsed& parsed = config.getParsedConfiguration();
   BOOST_CHECK_EQUAL(parsed.get<std::string>("a"), "/path/to/nowhere");
@@ -53,14 +50,14 @@
 {
   setenv("TEST_HOME", "tests/unit/util/does/not/exist", 1);
 
-  BOOST_CHECK_NO_THROW(ConfigFile config);
+  BOOST_CHECK_NO_THROW(ConfigFile{});
 }
 
 BOOST_AUTO_TEST_CASE(ParseMalformed)
 {
   setenv("TEST_HOME", "tests/unit/util/config-file-malformed-home", 1);
 
-  BOOST_CHECK_THROW(ConfigFile config, ConfigFile::Error);
+  BOOST_CHECK_THROW(ConfigFile{}, ConfigFile::Error);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestConfigFile
diff --git a/tests/unit/util/io.t.cpp b/tests/unit/util/io.t.cpp
index 2dc303d..350abf6 100644
--- a/tests/unit/util/io.t.cpp
+++ b/tests/unit/util/io.t.cpp
@@ -24,9 +24,11 @@
 #include "tests/boost-test.hpp"
 #include "tests/key-chain-fixture.hpp"
 
-#include <boost/filesystem.hpp>
 #include <boost/mp11/list.hpp>
 
+#include <filesystem>
+#include <system_error>
+
 namespace ndn::tests {
 
 BOOST_AUTO_TEST_SUITE(Util)
@@ -100,25 +102,23 @@
 {
 protected:
   FileIoFixture()
-    : filepath(boost::filesystem::path(UNIT_TESTS_TMPDIR) / "TestIo")
-    , filename(filepath.string())
   {
-    boost::filesystem::create_directories(filepath.parent_path());
+    std::filesystem::create_directories(filename.parent_path());
   }
 
   ~FileIoFixture()
   {
-    boost::system::error_code ec;
-    boost::filesystem::remove(filepath, ec); // ignore error
+    std::error_code ec;
+    std::filesystem::remove(filename, ec); // ignore error
   }
 
   /**
-   * \brief Create a directory at `filepath`, so that it's neither readable nor writable as a file.
+   * \brief Create a directory at `filename`, so that it's neither readable nor writable as a file.
    */
   void
   mkdir() const
   {
-    boost::filesystem::create_directory(filepath);
+    std::filesystem::create_directory(filename);
   }
 
   template<typename Container>
@@ -148,8 +148,7 @@
   }
 
 protected:
-  const boost::filesystem::path filepath;
-  const std::string filename;
+  const std::filesystem::path filename{std::filesystem::path(UNIT_TESTS_TMPDIR) / "TestIo"};
 };
 
 BOOST_FIXTURE_TEST_SUITE(FileIo, FileIoFixture)
diff --git a/tests/unit/util/sqlite3-statement.t.cpp b/tests/unit/util/sqlite3-statement.t.cpp
index b3d32d5..fe114c9 100644
--- a/tests/unit/util/sqlite3-statement.t.cpp
+++ b/tests/unit/util/sqlite3-statement.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2023 Regents of the University of California.
+ * Copyright (c) 2013-2024 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,8 +23,8 @@
 
 #include "tests/boost-test.hpp"
 
-#include <boost/filesystem.hpp>
 #include <cstring>
+#include <filesystem>
 #include <sqlite3.h>
 
 namespace ndn::tests {
@@ -36,9 +36,9 @@
 public:
   Sqlite3DbFixture()
   {
-    boost::filesystem::create_directories(m_path);
+    std::filesystem::create_directories(m_path);
 
-    int result = sqlite3_open_v2((m_path / "sqlite3-statement.db").string().c_str(), &db,
+    int result = sqlite3_open_v2((m_path / "sqlite3-statement.db").c_str(), &db,
                                  SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
 #ifdef NDN_CXX_DISABLE_SQLITE3_FS_LOCKING
                                  "unix-dotfile"
@@ -48,21 +48,21 @@
                                  );
 
     if (result != SQLITE_OK) {
-      BOOST_FAIL("Sqlite3 database cannot be opened/created: " + m_path.string());
+      BOOST_FAIL("Sqlite3 database cannot be opened/created: " + m_path.native());
     }
   }
 
   ~Sqlite3DbFixture()
   {
     sqlite3_close(db);
-    boost::filesystem::remove_all(m_path);
+    std::filesystem::remove_all(m_path);
   }
 
 protected:
   sqlite3* db = nullptr;
 
 private:
-  const boost::filesystem::path m_path{UNIT_TESTS_TMPDIR};
+  const std::filesystem::path m_path{UNIT_TESTS_TMPDIR};
 };
 
 BOOST_AUTO_TEST_SUITE(Util)