aboutsummaryrefslogtreecommitdiff
path: root/src/test/accounting_tests.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-01-23 14:18:26 -0500
committerGavin Andresen <gavinandresen@gmail.com>2014-01-24 10:47:29 -0500
commitfd67424c829b9bb0ed7f4a53040524c560262810 (patch)
tree49585a6d81c8bd6fe625d49f8a4eee318a3d6da6 /src/test/accounting_tests.cpp
parentd0a94f2c2f127768acd9be4c0905d40f609ba6fc (diff)
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.
Diffstat (limited to 'src/test/accounting_tests.cpp')
-rw-r--r--src/test/accounting_tests.cpp2
1 files changed, 2 insertions, 0 deletions
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<int64_t, CAccountingEntry> results;
+ LOCK(pwalletMain->cs_wallet);
+
ae.strAccount = "";
ae.nCreditDebit = 1;
ae.nTime = 1333333333;