9#include <boost/test/unit_test.hpp>
19 std::string u8_str =
"fs_tests_₿_🏃";
20 std::u8string str8{
u8"fs_tests_₿_🏃"};
34 std::string invalid_u8_str =
"\xf0";
42 std::string test_filename =
"fs_tests_₿_🏃.dat";
43 std::string expected_stem =
"fs_tests_₿_🏃";
49 fs::path tmpfolder = m_args.GetDataDirBase();
54 std::ofstream file{tmpfile1};
58 std::ifstream file{tmpfile2};
59 std::string input_buffer;
64 std::ifstream file{tmpfile1, std::ios_base::in | std::ios_base::ate};
65 std::string input_buffer;
74 std::ifstream file{tmpfile1};
75 std::string input_buffer;
84 std::ifstream file{tmpfile1};
85 std::string input_buffer;
110 const fs::path tmpfolder{m_args.GetDataDirBase()};
112 const fs::path path1{tmpfolder /
"a"};
113 const fs::path path2{tmpfolder /
"b"};
115 const std::string path1_contents{
"1111"};
116 const std::string path2_contents{
"2222"};
119 std::ofstream file{path1};
120 file << path1_contents;
124 std::ofstream file{path2};
125 file << path2_contents;
134 std::ifstream file{path2};
135 std::string contents;
146 const fs::path tmpfolder{m_args.GetDataDirBase()};
148 const fs::path dir{tmpfolder /
"a"};
149 fs::create_directory(dir);
154 const fs::path symlink{tmpfolder /
"b"};
155 fs::create_directory_symlink(dir, symlink);
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
bool RenameOver(fs::path src, fs::path dest)
Rename src to dest.
BOOST_AUTO_TEST_CASE(fsbridge_pathtostring)
static path u8path(const std::string &utf8_str)
static bool create_directories(const std::filesystem::path &p)
Create directory (and if necessary its parents), unless the leaf directory already exists or is a sym...
static bool exists(const path &p)
static std::string PathToString(const path &path)
Convert path object to a byte string.
static path PathFromString(const std::string &string)
Convert byte string to path object.
fs::path AbsPathJoin(const fs::path &base, const fs::path &path)
Helper function for joining two paths.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)