Reinitialize state in between individual unit tests.
This changes the TestingSetup fixture to be per-unit-test rather than global. Most tests don't need it, so it's only invoked in a few.
This commit is contained in:
@@ -903,8 +903,8 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
|
||||
int64_t now = GetTime();
|
||||
std::string newFilename = strprintf("wallet.%d.bak", now);
|
||||
|
||||
int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL,
|
||||
newFilename.c_str(), DB_AUTO_COMMIT);
|
||||
int result = dbenv.dbenv->dbrename(NULL, filename.c_str(), NULL,
|
||||
newFilename.c_str(), DB_AUTO_COMMIT);
|
||||
if (result == 0)
|
||||
LogPrintf("Renamed %s to %s\n", filename, newFilename);
|
||||
else
|
||||
@@ -923,7 +923,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
|
||||
LogPrintf("Salvage(aggressive) found %u records\n", salvagedData.size());
|
||||
|
||||
bool fSuccess = allOK;
|
||||
boost::scoped_ptr<Db> pdbCopy(new Db(&dbenv.dbenv, 0));
|
||||
boost::scoped_ptr<Db> pdbCopy(new Db(dbenv.dbenv, 0));
|
||||
int ret = pdbCopy->open(NULL, // Txn pointer
|
||||
filename.c_str(), // Filename
|
||||
"main", // Logical db name
|
||||
|
||||
Reference in New Issue
Block a user