Improving test coverage [adding Mutex::RecursiveLockUnlock]
Signed-off-by: Stefano Fiorentino <stefano.fiore84@gmail.com>
This commit is contained in:
parent
bfc4a2c95b
commit
336e5dfb1d
@ -42,3 +42,18 @@ TEST(Mutex, LockUnlock) {
|
|||||||
|
|
||||||
loop->run();
|
loop->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Mutex, RecursiveLockUnlock) {
|
||||||
|
auto loop = uvw::Loop::getDefault();
|
||||||
|
auto recursive_mtx = loop->resource<uvw::Mutex>(true);
|
||||||
|
|
||||||
|
recursive_mtx->lock();
|
||||||
|
recursive_mtx->unlock();
|
||||||
|
|
||||||
|
recursive_mtx->lock();
|
||||||
|
ASSERT_TRUE(recursive_mtx->tryLock());
|
||||||
|
recursive_mtx->unlock();
|
||||||
|
recursive_mtx->unlock();
|
||||||
|
|
||||||
|
loop->run();
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user