tests: Add Assertions in reverse_lock tests to exercise thread-safety annotations
This commit is contained in:
1 parent
c88b1cbf57
commit
3ddd554d31
1 file changed
+2
@@ -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());
|
||||||
|
|||||||
Reference in new issue
Block a user