From fd67424c829b9bb0ed7f4a53040524c560262810 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 23 Jan 2014 14:18:26 -0500 Subject: Unit test fixes for AssertLockHeld / -DDEBUG_LOCKORDER Unit tests would fail if compiled with -DDEBUG_LOCKORDER (AssertLockHeld() would fail; AssertLockHeld() relies on the DEBUG_LOCKORDER code to keep track of locks held). Fixed by LOCK'ing the wallet mutex in the unit tests that manipulate the wallet. --- src/test/accounting_tests.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/test/accounting_tests.cpp') diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp index 5f79436e48..bfdb95927b 100644 --- a/src/test/accounting_tests.cpp +++ b/src/test/accounting_tests.cpp @@ -34,6 +34,8 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade) CAccountingEntry ae; std::map results; + LOCK(pwalletMain->cs_wallet); + ae.strAccount = ""; ae.nCreditDebit = 1; ae.nTime = 1333333333; -- cgit v1.2.3