From fd2d96d9087be234bdf4a6eb6d563e92b4fb4501 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:50:39 +0000 Subject: [PATCH] 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. --- src/wallet/test/CMakeLists.txt | 7 +------ src/wallet/test/db_tests.cpp | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/wallet/test/CMakeLists.txt b/src/wallet/test/CMakeLists.txt index 8b442b262bc..f14a78ca1d2 100644 --- a/src/wallet/test/CMakeLists.txt +++ b/src/wallet/test/CMakeLists.txt @@ -8,6 +8,7 @@ target_sources(test_bitcoin PRIVATE init_test_fixture.cpp wallet_test_fixture.cpp + db_tests.cpp coinselector_tests.cpp feebumper_tests.cpp group_outputs_tests.cpp @@ -22,10 +23,4 @@ target_sources(test_bitcoin walletdb_tests.cpp walletload_tests.cpp ) -if(USE_BDB) - target_sources(test_bitcoin - PRIVATE - db_tests.cpp - ) -endif() target_link_libraries(test_bitcoin bitcoin_wallet) diff --git a/src/wallet/test/db_tests.cpp b/src/wallet/test/db_tests.cpp index 41951e84c8b..56a39c8d5f3 100644 --- a/src/wallet/test/db_tests.cpp +++ b/src/wallet/test/db_tests.cpp @@ -62,6 +62,7 @@ static void CheckPrefix(DatabaseBatch& batch, Span prefix, Mock BOOST_FIXTURE_TEST_SUITE(db_tests, BasicTestingSetup) +#ifdef USE_BDB static std::shared_ptr GetWalletEnv(const fs::path& path, fs::path& database_filename) { fs::path data_file = BDBDataFile(path); @@ -124,6 +125,7 @@ BOOST_AUTO_TEST_CASE(getwalletenv_g_dbenvs_free_instance) BOOST_CHECK(env_1_a != env_1_b); BOOST_CHECK(env_2_a == env_2_b); } +#endif static std::vector> TestDatabases(const fs::path& path_root) {