Switch to std::filesystem
Drop the dependency on Boost.Filesystem
Change-Id: I5d6f6fe38cd0cf1c6996221188fa63db146dc9f9
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