aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Yanofsky <[email protected]>2017-03-10 15:52:29 -0500
committerRussell Yanofsky <[email protected]>2017-03-10 15:52:29 -0500
commitcc9503cec9c66acfb38d56b094ada8382d15434f (patch)
tree6339bd010b3f881bedac2e8ce56304ffcd2a8e10 /src
parentMake test_bitcoin.cpp compatible with Qt Test framework (diff)
downloaddiscoin-cc9503cec9c66acfb38d56b094ada8382d15434f.tar.xz
discoin-cc9503cec9c66acfb38d56b094ada8382d15434f.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/qt/test/rpcnestedtests.cpp4
-rw-r--r--src/qt/test/test_main.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp
index bd496f149..a7b82117d 100644
--- a/src/qt/test/rpcnestedtests.cpp
+++ b/src/qt/test/rpcnestedtests.cpp
@@ -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 ,
#endif
+ UnloadBlockIndex();
delete pcoinsTip;
+ pcoinsTip = nullptr;
delete pcoinsdbview;
+ pcoinsdbview = nullptr;
delete pblocktree;
+ pblocktree = nullptr;
boost::filesystem::remove_all(boost::filesystem::path(path));
}
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index d44d71131..fd07ecb7a 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -7,7 +7,6 @@
#endif
#include "chainparams.h"
-#include "key.h"
#include "rpcnestedtests.h"
#include "util.h"
#include "uritests.h"
@@ -36,7 +35,6 @@ extern void noui_connect();
// This is all you need to run all the tests
int main(int argc, char *argv[])
{
- ECC_Start();
SetupEnvironment();
SetupNetworking();
SelectParams(CBaseChainParams::MAIN);
@@ -66,6 +64,5 @@ int main(int argc, char *argv[])
if (QTest::qExec(&test4) != 0)
fInvalid = true;
- ECC_Stop();
return fInvalid;
}