mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
test: Remove SetUp and TearDown methods in tests (#2086)
Fix: https://github.com/XRPLF/clio/issues/910
This commit is contained in:
@@ -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};
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user