mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
Merge bitcoin/bitcoin#29040: refactor: Remove pre-C++20 code, fs::path cleanup
6666713041refactor: Rename fs::path::u8string() to fs::path::utf8string() (MarcoFalke)856c88776fArgsManager: return path by value from GetBlocksDirPath() (Vasil Dimov)fa3d9304e8refactor: Remove pre-C++20 fs code (MarcoFalke)fa00098e1aAdd tests for C++20 std::u8string (MarcoFalke)fa2bac08c2refactor: Avoid copy/move in fs.h (MarcoFalke)faea30227brefactor: Use C++20 std::chrono::days (MarcoFalke) Pull request description: This: * Removes dead code. * Avoids unused copies in some places. * Adds copies in other places for safety. ACKs for top commit: achow101: ACK6666713041ryanofsky: Code review ACK6666713041. Just documentation change since last review. stickies-v: re-ACK6666713041Tree-SHA512: 6176e44f30b310d51632ec2d3827c3819905d0ddc6a4b57acfcb6cfa1f9735176da75ee8ed4a4abd1296cb0b83bee9374cc6f91ffac87c19b63c435eeadf3f46
This commit is contained in:
@@ -17,9 +17,12 @@ BOOST_FIXTURE_TEST_SUITE(fs_tests, BasicTestingSetup)
|
||||
BOOST_AUTO_TEST_CASE(fsbridge_pathtostring)
|
||||
{
|
||||
std::string u8_str = "fs_tests_₿_🏃";
|
||||
std::u8string str8{u8"fs_tests_₿_🏃"};
|
||||
BOOST_CHECK_EQUAL(fs::PathToString(fs::PathFromString(u8_str)), u8_str);
|
||||
BOOST_CHECK_EQUAL(fs::u8path(u8_str).u8string(), u8_str);
|
||||
BOOST_CHECK_EQUAL(fs::PathFromString(u8_str).u8string(), u8_str);
|
||||
BOOST_CHECK_EQUAL(fs::u8path(u8_str).utf8string(), u8_str);
|
||||
BOOST_CHECK_EQUAL(fs::path(str8).utf8string(), u8_str);
|
||||
BOOST_CHECK(fs::path(str8).u8string() == str8);
|
||||
BOOST_CHECK_EQUAL(fs::PathFromString(u8_str).utf8string(), u8_str);
|
||||
BOOST_CHECK_EQUAL(fs::PathToString(fs::u8path(u8_str)), u8_str);
|
||||
#ifndef WIN32
|
||||
// On non-windows systems, verify that arbitrary byte strings containing
|
||||
@@ -46,7 +49,7 @@ BOOST_AUTO_TEST_CASE(fsbridge_fstream)
|
||||
fs::path tmpfolder = m_args.GetDataDirBase();
|
||||
// tmpfile1 should be the same as tmpfile2
|
||||
fs::path tmpfile1 = tmpfolder / fs::u8path("fs_tests_₿_🏃");
|
||||
fs::path tmpfile2 = tmpfolder / fs::u8path("fs_tests_₿_🏃");
|
||||
fs::path tmpfile2 = tmpfolder / fs::path(u8"fs_tests_₿_🏃");
|
||||
{
|
||||
std::ofstream file{tmpfile1};
|
||||
file << "bitcoin";
|
||||
|
||||
Reference in New Issue
Block a user