Skip to content

Commit f61c3a1

Browse files
author
MarcoFalke
committed
Merge #21125: test: Change BOOST_CHECK to BOOST_CHECK_EQUAL for paths
059e8cc Change BOOST_CHECK to BOOST_CHECK_EQUAL to see mismatched values when a check fails. (Kiminuo) Pull request description: This is useful to see mismatched values when a check fails as specified in the [Boost documentation](https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref/assertion_boost_level.html). This PR would make #20744 PR's diff smaller by a bit. ACKs for top commit: MarcoFalke: review ACK 059e8cc theStack: Code Review ACK 059e8cc Tree-SHA512: 82359ef38e0d1926f12a34aeff6fde6d1d307c703a080547749b908f873c2a2f894f6f094c33470b32987c229e3a1f17f7d1e877663c53293c023bde0e7272c1
2 parents 09530b0 + 059e8cc commit f61c3a1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/wallet/test/db_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ BOOST_AUTO_TEST_CASE(getwalletenv_file)
3030

3131
std::string filename;
3232
std::shared_ptr<BerkeleyEnvironment> env = GetWalletEnv(file_path, filename);
33-
BOOST_CHECK(filename == test_name);
34-
BOOST_CHECK(env->Directory() == datadir);
33+
BOOST_CHECK_EQUAL(filename, test_name);
34+
BOOST_CHECK_EQUAL(env->Directory(), datadir);
3535
}
3636

3737
BOOST_AUTO_TEST_CASE(getwalletenv_directory)
@@ -41,8 +41,8 @@ BOOST_AUTO_TEST_CASE(getwalletenv_directory)
4141

4242
std::string filename;
4343
std::shared_ptr<BerkeleyEnvironment> env = GetWalletEnv(datadir, filename);
44-
BOOST_CHECK(filename == expected_name);
45-
BOOST_CHECK(env->Directory() == datadir);
44+
BOOST_CHECK_EQUAL(filename, expected_name);
45+
BOOST_CHECK_EQUAL(env->Directory(), datadir);
4646
}
4747

4848
BOOST_AUTO_TEST_CASE(getwalletenv_g_dbenvs_multiple)

src/wallet/test/init_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_default)
1919
BOOST_CHECK(result == true);
2020
fs::path walletdir = gArgs.GetArg("-walletdir", "");
2121
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
22-
BOOST_CHECK(walletdir == expected_path);
22+
BOOST_CHECK_EQUAL(walletdir, expected_path);
2323
}
2424

2525
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_custom)
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_custom)
2929
BOOST_CHECK(result == true);
3030
fs::path walletdir = gArgs.GetArg("-walletdir", "");
3131
fs::path expected_path = fs::canonical(m_walletdir_path_cases["custom"]);
32-
BOOST_CHECK(walletdir == expected_path);
32+
BOOST_CHECK_EQUAL(walletdir, expected_path);
3333
}
3434

3535
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_does_not_exist)
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing)
6969
BOOST_CHECK(result == true);
7070
fs::path walletdir = gArgs.GetArg("-walletdir", "");
7171
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
72-
BOOST_CHECK(walletdir == expected_path);
72+
BOOST_CHECK_EQUAL(walletdir, expected_path);
7373
}
7474

7575
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing2)
@@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing2)
7979
BOOST_CHECK(result == true);
8080
fs::path walletdir = gArgs.GetArg("-walletdir", "");
8181
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
82-
BOOST_CHECK(walletdir == expected_path);
82+
BOOST_CHECK_EQUAL(walletdir, expected_path);
8383
}
8484

8585
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)