TemporaryDirectory: Use boost::filesystem::equivalent() instead of == in path comparisons

This commit is contained in:
Kamil Śliwak 2021-05-20 00:07:36 +02:00
parent 828b15b34f
commit 4a2080b3aa

View File

@ -43,8 +43,8 @@ TemporaryDirectory::~TemporaryDirectory()
{
// A few paranoid sanity checks just to be extra sure we're not deleting someone's homework.
assert(m_path.string().find(fs::temp_directory_path().string()) == 0);
assert(m_path != fs::temp_directory_path());
assert(m_path != m_path.root_path());
assert(!fs::equivalent(m_path, fs::temp_directory_path()));
assert(!fs::equivalent(m_path, m_path.root_path()));
assert(!m_path.empty());
boost::system::error_code errorCode;