7 #include <test/util/logging.h> 10 #include <test/util/setup_common.h> 13 #include <boost/test/unit_test.hpp> 18 SetWalletDir(m_walletdir_path_cases[
"default"]);
19 bool result = m_chain_client->verify(
Params());
21 fs::path walletdir =
gArgs.
GetArg(
"-walletdir",
"");
22 fs::path expected_path = fs::canonical(m_walletdir_path_cases[
"default"]);
27 SetWalletDir(m_walletdir_path_cases[
"custom"]);
28 bool result = m_chain_client->verify(
Params());
30 fs::path walletdir =
gArgs.
GetArg(
"-walletdir",
"");
31 fs::path expected_path = fs::canonical(m_walletdir_path_cases[
"custom"]);
36 SetWalletDir(m_walletdir_path_cases[
"nonexistent"]);
38 ASSERT_DEBUG_LOG(
"does not exist");
39 bool result = m_chain_client->verify(
Params());
45 SetWalletDir(m_walletdir_path_cases[
"file"]);
47 ASSERT_DEBUG_LOG(
"is not a directory");
48 bool result = m_chain_client->verify(
Params());
54 SetWalletDir(m_walletdir_path_cases[
"relative"]);
56 ASSERT_DEBUG_LOG(
"is a relative path");
57 bool result = m_chain_client->verify(
Params());
63 SetWalletDir(m_walletdir_path_cases[
"trailing"]);
64 bool result = m_chain_client->verify(
Params());
66 fs::path walletdir =
gArgs.
GetArg(
"-walletdir",
"");
67 fs::path expected_path = fs::canonical(m_walletdir_path_cases[
"default"]);
72 SetWalletDir(m_walletdir_path_cases[
"trailing2"]);
73 bool result = m_chain_client->verify(
Params());
75 fs::path walletdir =
gArgs.
GetArg(
"-walletdir",
"");
76 fs::path expected_path = fs::canonical(m_walletdir_path_cases[
"default"]);
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_default)
#define BOOST_FIXTURE_TEST_SUITE(a, b)
const CChainParams & Params()
Return the currently selected parameters.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
#define BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK(expr)