test: Remove SetUp and TearDown methods in tests (#2086)

Fix: https://github.com/XRPLF/clio/issues/910
This commit is contained in:
Ayaz Salikhov
2025-05-07 09:41:23 +01:00
committed by GitHub
parent 9af36e5235
commit 5e43c3b099
8 changed files with 11 additions and 61 deletions

View File

@@ -85,8 +85,7 @@ protected:
class BackendCassandraFactoryTestWithDB : public BackendCassandraFactoryTest {
protected:
void
TearDown() override
~BackendCassandraFactoryTestWithDB()
{
// drop the keyspace for next test
data::cassandra::Handle const handle{TestGlobals::instance().backendHost};

View File

@@ -111,26 +111,17 @@ protected:
// recreated for each test
data::LedgerCache cache_;
std::unique_ptr<BackendInterface> backend_;
std::unique_ptr<BackendInterface> backend_{std::make_unique<CassandraBackend>(settingsProvider_, cache_, false)};
void
SetUp() override
{
SyncAsioContextTest::SetUp();
backend_ = std::make_unique<CassandraBackend>(settingsProvider_, cache_, false);
}
void
TearDown() override
{
backend_.reset();
std::default_random_engine randomEngine_{0};
~BackendCassandraTest()
{
// drop the keyspace for next test
Handle const handle{TestGlobals::instance().backendHost};
EXPECT_TRUE(handle.connect());
handle.execute("DROP KEYSPACE " + TestGlobals::instance().backendKeyspace);
}
std::default_random_engine randomEngine_{0};
};
TEST_F(BackendCassandraTest, Basic)