Skip to content

Commit fd2d96d

Browse files
committed
build, test: Build db_tests.cpp regardless of USE_BDB
While some tests are specific to BDB, `db_tests` as a whole are not limited to BDB.
1 parent 433412f commit fd2d96d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/wallet/test/CMakeLists.txt

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ target_sources(test_bitcoin
88
PRIVATE
99
init_test_fixture.cpp
1010
wallet_test_fixture.cpp
11+
db_tests.cpp
1112
coinselector_tests.cpp
1213
feebumper_tests.cpp
1314
group_outputs_tests.cpp
@@ -22,10 +23,4 @@ target_sources(test_bitcoin
2223
walletdb_tests.cpp
2324
walletload_tests.cpp
2425
)
25-
if(USE_BDB)
26-
target_sources(test_bitcoin
27-
PRIVATE
28-
db_tests.cpp
29-
)
30-
endif()
3126
target_link_libraries(test_bitcoin bitcoin_wallet)

src/wallet/test/db_tests.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static void CheckPrefix(DatabaseBatch& batch, Span<const std::byte> prefix, Mock
6262

6363
BOOST_FIXTURE_TEST_SUITE(db_tests, BasicTestingSetup)
6464

65+
#ifdef USE_BDB
6566
static std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& path, fs::path& database_filename)
6667
{
6768
fs::path data_file = BDBDataFile(path);
@@ -124,6 +125,7 @@ BOOST_AUTO_TEST_CASE(getwalletenv_g_dbenvs_free_instance)
124125
BOOST_CHECK(env_1_a != env_1_b);
125126
BOOST_CHECK(env_2_a == env_2_b);
126127
}
128+
#endif
127129

128130
static std::vector<std::unique_ptr<WalletDatabase>> TestDatabases(const fs::path& path_root)
129131
{

0 commit comments

Comments
 (0)