mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
test: Add LockStackEmpty()
This commit is contained in:
parent
42b2a95373
commit
63e9e40b73
3 changed files with 21 additions and 6 deletions
|
|
@ -14,6 +14,7 @@ void TestPotentialDeadLockDetected(MutexType& mutex1, MutexType& mutex2)
|
|||
{
|
||||
LOCK2(mutex1, mutex2);
|
||||
}
|
||||
BOOST_CHECK(LockStackEmpty());
|
||||
bool error_thrown = false;
|
||||
try {
|
||||
LOCK2(mutex2, mutex1);
|
||||
|
|
@ -21,6 +22,7 @@ void TestPotentialDeadLockDetected(MutexType& mutex1, MutexType& mutex2)
|
|||
BOOST_CHECK_EQUAL(e.what(), "potential deadlock detected: mutex1 -> mutex2 -> mutex1");
|
||||
error_thrown = true;
|
||||
}
|
||||
BOOST_CHECK(LockStackEmpty());
|
||||
#ifdef DEBUG_LOCKORDER
|
||||
BOOST_CHECK(error_thrown);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue