From db058efeb0821cb5022e3b29e0aff3627d7aaf83 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 26 Nov 2020 14:39:12 +0100 Subject: [PATCH] sync: use HasReason() in double lock tests `HasReason()` is shorter than a lambda function. --- src/test/sync_tests.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/sync_tests.cpp b/src/test/sync_tests.cpp index 6c148672110..14145ced7e1 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)); }