Improving test coverage [adding Mutex::LockUnlock]
Signed-off-by: Stefano Fiorentino <stefano.fiore84@gmail.com>
This commit is contained in:
parent
53da326aea
commit
bfc4a2c95b
@ -25,4 +25,20 @@ TEST(ThreadLocalStorage, SetGet) {
|
||||
|
||||
localStorage->set<bool>(&flag);
|
||||
ASSERT_TRUE(localStorage->get<bool>());
|
||||
|
||||
loop->run();
|
||||
}
|
||||
|
||||
TEST(Mutex, LockUnlock) {
|
||||
auto loop = uvw::Loop::getDefault();
|
||||
auto mtx = loop->resource<uvw::Mutex>();
|
||||
|
||||
mtx->lock();
|
||||
ASSERT_FALSE(mtx->tryLock());
|
||||
mtx->unlock();
|
||||
ASSERT_TRUE(mtx->tryLock());
|
||||
ASSERT_FALSE(mtx->tryLock());
|
||||
mtx->unlock();
|
||||
|
||||
loop->run();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user