diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2020-11-26 14:39:12 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2020-11-26 14:42:06 +0100 |
commit | db058efeb0821cb5022e3b29e0aff3627d7aaf83 (patch) | |
tree | a726c72642404edcd9f3bdb05c0c23203a4e7260 /src | |
parent | a21dc469ccf076ca3b07b1adbd8bf667145f1c44 (diff) |
sync: use HasReason() in double lock tests
`HasReason()` is shorter than a lambda function.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/sync_tests.cpp | 6 |
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)); } |