mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
test: Add fs_tests/create_directories unit test
This commit is contained in:
parent
1f46b6e46e
commit
ddb75c2e87
@ -152,4 +152,28 @@ BOOST_AUTO_TEST_CASE(rename)
|
||||
fs::remove(path2);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
BOOST_AUTO_TEST_CASE(create_directories)
|
||||
{
|
||||
// Test fs::create_directories workaround.
|
||||
const fs::path tmpfolder{m_args.GetDataDirBase()};
|
||||
|
||||
const fs::path dir{GetUniquePath(tmpfolder)};
|
||||
fs::create_directory(dir);
|
||||
BOOST_CHECK(fs::exists(dir));
|
||||
BOOST_CHECK(fs::is_directory(dir));
|
||||
BOOST_CHECK(!fs::create_directories(dir));
|
||||
|
||||
const fs::path symlink{GetUniquePath(tmpfolder)};
|
||||
fs::create_directory_symlink(dir, symlink);
|
||||
BOOST_CHECK(fs::exists(symlink));
|
||||
BOOST_CHECK(fs::is_symlink(symlink));
|
||||
BOOST_CHECK(fs::is_directory(symlink));
|
||||
BOOST_CHECK(!fs::create_directories(symlink));
|
||||
|
||||
fs::remove(symlink);
|
||||
fs::remove(dir);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
Loading…
Reference in New Issue
Block a user