Browse Source

tests: Fix dangling pwalletMain pointer in wallet tests

0.15
Wladimir J. van der Laan 8 years ago
parent
commit
75a109338f
  1. 2
      src/wallet/test/wallet_tests.cpp

2
src/wallet/test/wallet_tests.cpp

@ -397,6 +397,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
{ {
CWallet wallet; CWallet wallet;
CWallet *backup = ::pwalletMain;
::pwalletMain = &wallet; ::pwalletMain = &wallet;
UniValue key; UniValue key;
key.setObject(); key.setObject();
@ -412,6 +413,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
UniValue response = importmulti(request); UniValue response = importmulti(request);
BOOST_CHECK_EQUAL(response.write(), strprintf("[{\"success\":false,\"error\":{\"code\":-1,\"message\":\"Failed to rescan before time %d, transactions may be missing.\"}}]", newTip->GetBlockTimeMax())); BOOST_CHECK_EQUAL(response.write(), strprintf("[{\"success\":false,\"error\":{\"code\":-1,\"message\":\"Failed to rescan before time %d, transactions may be missing.\"}}]", newTip->GetBlockTimeMax()));
::pwalletMain = backup;
} }
} }

Loading…
Cancel
Save