Skip to content

Commit 059e8cc

Browse files
committed
Change BOOST_CHECK to BOOST_CHECK_EQUAL to see mismatched values when a check fails.
See https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/utf_reference/testing_tool_ref/assertion_boost_level_eq.html
1 parent 3641ec1 commit 059e8cc

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)