Make qt test compatible with TestChain100Setup framework
Reset global state after rpc tests, and remove unnecessary ECC initialization to prevent assert error if it is initialized twice.
This commit is contained in:
parent
91e303595b
commit
cc9503cec9
2 changed files with 4 additions and 3 deletions
|
@ -148,9 +148,13 @@ void RPCNestedTests::rpcNestedTests()
|
||||||
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, "rpcNestedTest(abc,,)"), std::runtime_error); //don't tollerate empty arguments when using ,
|
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, "rpcNestedTest(abc,,)"), std::runtime_error); //don't tollerate empty arguments when using ,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
UnloadBlockIndex();
|
||||||
delete pcoinsTip;
|
delete pcoinsTip;
|
||||||
|
pcoinsTip = nullptr;
|
||||||
delete pcoinsdbview;
|
delete pcoinsdbview;
|
||||||
|
pcoinsdbview = nullptr;
|
||||||
delete pblocktree;
|
delete pblocktree;
|
||||||
|
pblocktree = nullptr;
|
||||||
|
|
||||||
boost::filesystem::remove_all(boost::filesystem::path(path));
|
boost::filesystem::remove_all(boost::filesystem::path(path));
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "key.h"
|
|
||||||
#include "rpcnestedtests.h"
|
#include "rpcnestedtests.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "uritests.h"
|
#include "uritests.h"
|
||||||
|
@ -36,7 +35,6 @@ extern void noui_connect();
|
||||||
// This is all you need to run all the tests
|
// This is all you need to run all the tests
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
ECC_Start();
|
|
||||||
SetupEnvironment();
|
SetupEnvironment();
|
||||||
SetupNetworking();
|
SetupNetworking();
|
||||||
SelectParams(CBaseChainParams::MAIN);
|
SelectParams(CBaseChainParams::MAIN);
|
||||||
|
@ -66,6 +64,5 @@ int main(int argc, char *argv[])
|
||||||
if (QTest::qExec(&test4) != 0)
|
if (QTest::qExec(&test4) != 0)
|
||||||
fInvalid = true;
|
fInvalid = true;
|
||||||
|
|
||||||
ECC_Stop();
|
|
||||||
return fInvalid;
|
return fInvalid;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue