tests: Add Assertions in reverse_lock tests to exercise thread-safety annotations

This commit is contained in:
Cory Fields
2025-05-22 17:26:13 +00:00
parent c88b1cbf57
commit 3ddd554d31

View File

@@ -17,8 +17,10 @@ BOOST_AUTO_TEST_CASE(reverselock_basics)
WAIT_LOCK(mutex, lock); WAIT_LOCK(mutex, lock);
BOOST_CHECK(lock.owns_lock()); BOOST_CHECK(lock.owns_lock());
AssertLockHeld(mutex);
{ {
REVERSE_LOCK(lock, mutex); REVERSE_LOCK(lock, mutex);
AssertLockNotHeld(mutex);
BOOST_CHECK(!lock.owns_lock()); BOOST_CHECK(!lock.owns_lock());
} }
BOOST_CHECK(lock.owns_lock()); BOOST_CHECK(lock.owns_lock());