aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-12-02 09:44:46 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-12-02 09:44:55 +0100
commit7f0f01f0ab4521d05fb5fd6e0b7d19470b342e77 (patch)
tree1b8bda12b0553bcd6bf376c7e64543c46599e851 /src/test
parent283f22cabb9afcb159cb1a9793b5249e55975636 (diff)
parentdb058efeb0821cb5022e3b29e0aff3627d7aaf83 (diff)
Merge #20507: sync: print proper lock order location when double lock is detected
db058efeb0821cb5022e3b29e0aff3627d7aaf83 sync: use HasReason() in double lock tests (Vasil Dimov) a21dc469ccf076ca3b07b1adbd8bf667145f1c44 sync: const-qualify the argument of double_lock_detected() (Vasil Dimov) 6d3689fcf6cff397187028344570489db3e6ecf4 sync: print proper lock order location when double lock is detected (Vasil Dimov) Pull request description: Before: ``` Assertion failed: detected double lock at src/sync.cpp:153, details in debug log. ``` After: ``` Assertion failed: detected double lock for 'm' in src/test/sync_tests.cpp:40 (in thread ''), details in debug log. ``` ACKs for top commit: jonasschnelli: utACK db058efeb0821cb5022e3b29e0aff3627d7aaf83 ajtowns: ACK db058efeb0821cb5022e3b29e0aff3627d7aaf83 hebasto: ACK db058efeb0821cb5022e3b29e0aff3627d7aaf83, tested on Linux Mint 20 (x86_64). Tree-SHA512: 452ddb9a14e44bb174135b39f2219c76eadbb8a6c0e80d64a25f995780d6dbc7b570d9902616db94dbfabaee197b5828ba3475171a68240ac0958fb203a7acdb
Diffstat (limited to 'src/test')
-rw-r--r--src/test/sync_tests.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/sync_tests.cpp b/src/test/sync_tests.cpp
index 6c14867211..14145ced7e 100644
--- a/src/test/sync_tests.cpp
+++ b/src/test/sync_tests.cpp
@@ -50,10 +50,8 @@ void TestDoubleLock(bool should_throw)
MutexType m;
ENTER_CRITICAL_SECTION(m);
if (should_throw) {
- BOOST_CHECK_EXCEPTION(
- TestDoubleLock2(m), std::logic_error, [](const std::logic_error& e) {
- return strcmp(e.what(), "double lock detected") == 0;
- });
+ BOOST_CHECK_EXCEPTION(TestDoubleLock2(m), std::logic_error,
+ HasReason("double lock detected"));
} else {
BOOST_CHECK_NO_THROW(TestDoubleLock2(m));
}