35bf69ec94
- test_triangles.cpp: add globals excluded with init.o (fEnforceCanonical, nNodeLifespan, fConfChange, CheckpointsMode, nDerivationMethodIndex, fUseFastIndex) - DoS_tests.cpp: update AddOrphanTx and mapOrphanTransactions to match current CTransaction-based API (was old CDataStream-based) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#define BOOST_TEST_MODULE Triangles Test Suite
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include "db.h"
|
|
#include "main.h"
|
|
#include "wallet.h"
|
|
#include "checkpoints.h"
|
|
|
|
CWallet* pwalletMain;
|
|
CClientUIInterface uiInterface;
|
|
|
|
// Globals normally defined in init.cpp (excluded from test build)
|
|
bool fConfChange;
|
|
bool fEnforceCanonical;
|
|
unsigned int nNodeLifespan;
|
|
unsigned int nDerivationMethodIndex;
|
|
bool fUseFastIndex;
|
|
enum Checkpoints::CPMode CheckpointsMode;
|
|
|
|
extern bool fPrintToConsole;
|
|
extern void noui_connect();
|
|
|
|
struct TestingSetup {
|
|
TestingSetup() {
|
|
fPrintToDebugger = true; // don't want to write to debug.log file
|
|
noui_connect();
|
|
bitdb.MakeMock();
|
|
LoadBlockIndex(true);
|
|
bool fFirstRun;
|
|
pwalletMain = new CWallet("wallet.dat");
|
|
pwalletMain->LoadWallet(fFirstRun);
|
|
RegisterWallet(pwalletMain);
|
|
}
|
|
~TestingSetup()
|
|
{
|
|
delete pwalletMain;
|
|
pwalletMain = NULL;
|
|
bitdb.Flush(true);
|
|
}
|
|
};
|
|
|
|
BOOST_GLOBAL_FIXTURE(TestingSetup);
|
|
|
|
void Shutdown(void* parg)
|
|
{
|
|
exit(0);
|
|
}
|
|
|
|
void StartShutdown()
|
|
{
|
|
exit(0);
|
|
}
|
|
|