mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
sync: use HasReason() in double lock tests
`HasReason()` is shorter than a lambda function.
This commit is contained in:
parent
a21dc469cc
commit
db058efeb0
@ -50,10 +50,8 @@ void TestDoubleLock(bool should_throw)
|
|||||||
MutexType m;
|
MutexType m;
|
||||||
ENTER_CRITICAL_SECTION(m);
|
ENTER_CRITICAL_SECTION(m);
|
||||||
if (should_throw) {
|
if (should_throw) {
|
||||||
BOOST_CHECK_EXCEPTION(
|
BOOST_CHECK_EXCEPTION(TestDoubleLock2(m), std::logic_error,
|
||||||
TestDoubleLock2(m), std::logic_error, [](const std::logic_error& e) {
|
HasReason("double lock detected"));
|
||||||
return strcmp(e.what(), "double lock detected") == 0;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
BOOST_CHECK_NO_THROW(TestDoubleLock2(m));
|
BOOST_CHECK_NO_THROW(TestDoubleLock2(m));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user