Use EXPECT_THROW instead of handmade try-catch in tests

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:
Patryk Wrobel
2022-09-05 23:00:09 +00:00
committed by Compute-Runtime-Automation
parent 301be3c21b
commit 4395e0c3a1
4 changed files with 7 additions and 30 deletions

View File

@@ -953,14 +953,8 @@ void testIDListUnlockOnException() {
};
ListMock l;
bool caughtEx = false;
try {
l.throwExFromLock();
} catch (const ExType &) {
caughtEx = true;
}
EXPECT_THROW(l.throwExFromLock(), ExType);
EXPECT_TRUE(caughtEx);
EXPECT_FALSE(l.getLockedRef().test_and_set(std::memory_order_seq_cst));
}