Skip to content

Commit db058ef

Browse files
committed
sync: use HasReason() in double lock tests
`HasReason()` is shorter than a lambda function.
1 parent a21dc46 commit db058ef

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/test/sync_tests.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ void TestDoubleLock(bool should_throw)
5050
MutexType m;
5151
ENTER_CRITICAL_SECTION(m);
5252
if (should_throw) {
53-
BOOST_CHECK_EXCEPTION(
54-
TestDoubleLock2(m), std::logic_error, [](const std::logic_error& e) {
55-
return strcmp(e.what(), "double lock detected") == 0;
56-
});
53+
BOOST_CHECK_EXCEPTION(TestDoubleLock2(m), std::logic_error,
54+
HasReason("double lock detected"));
5755
} else {
5856
BOOST_CHECK_NO_THROW(TestDoubleLock2(m));
5957
}

0 commit comments

Comments
 (0)