mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
refactor: Block unsafe fs::path std::string conversion calls
There is no change in behavior. This just helps prepare for the transition from boost::filesystem to std::filesystem by avoiding calls to methods which will be unsafe after the transaction to std::filesystem to due lack of a boost::filesystem::path::imbue equivalent and inability to set a predictable locale. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Co-authored-by: Kiminuo <kiminuo@protonmail.com> Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_default)
|
||||
SetWalletDir(m_walletdir_path_cases["default"]);
|
||||
bool result = m_wallet_client->verify();
|
||||
BOOST_CHECK(result == true);
|
||||
fs::path walletdir = gArgs.GetArg("-walletdir", "");
|
||||
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
|
||||
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
|
||||
BOOST_CHECK_EQUAL(walletdir, expected_path);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_custom)
|
||||
SetWalletDir(m_walletdir_path_cases["custom"]);
|
||||
bool result = m_wallet_client->verify();
|
||||
BOOST_CHECK(result == true);
|
||||
fs::path walletdir = gArgs.GetArg("-walletdir", "");
|
||||
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
|
||||
fs::path expected_path = fs::canonical(m_walletdir_path_cases["custom"]);
|
||||
BOOST_CHECK_EQUAL(walletdir, expected_path);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing)
|
||||
SetWalletDir(m_walletdir_path_cases["trailing"]);
|
||||
bool result = m_wallet_client->verify();
|
||||
BOOST_CHECK(result == true);
|
||||
fs::path walletdir = gArgs.GetArg("-walletdir", "");
|
||||
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
|
||||
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
|
||||
BOOST_CHECK_EQUAL(walletdir, expected_path);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing2)
|
||||
SetWalletDir(m_walletdir_path_cases["trailing2"]);
|
||||
bool result = m_wallet_client->verify();
|
||||
BOOST_CHECK(result == true);
|
||||
fs::path walletdir = gArgs.GetArg("-walletdir", "");
|
||||
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
|
||||
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
|
||||
BOOST_CHECK_EQUAL(walletdir, expected_path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user