sync: use HasReason() in double lock tests

`HasReason()` is shorter than a lambda function.
This commit is contained in:
Vasil Dimov 2020-11-26 14:39:12 +01:00
parent a21dc469cc
commit db058efeb0
No known key found for this signature in database
GPG Key ID: 54DF06F64B55CBBF

View File

@ -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));
}