UnitTestFrameworkPkg/SampleGoogleTest: Use EXPECT_ANY_THROW()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4683 Update GoogleTest samples to use EXPECT_ANY_THROW() instead of ASSERT_DEATH(). ASSERT_DEATH() is a very slow method to detect an expected ASSERT() condition. Throwing an exception from ASSERT() and using EXPECT_ANY_THROW() is several orders of magnitude faster. Update GoogleTest sample with example of using EXPECT_THROW() and EXPECT_THAT() to check for more specific ASSERT() conditions that allow unit test cases to test functions that contain more than one ASSERT() statement and verify that the expected ASSERT() is the one that was actually triggered. Update library mappings so target-based unit tests use UnitTestDebugAssertLib.inf and host-based unit tests use UnitTestDebugAssertLibHost.inf Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
This commit is contained in:
committed by
mergify[bot]
parent
2d144d7e14
commit
0a989069df
@@ -59,7 +59,7 @@ reviewed. The paths to the SecureBootVariableLib unit tests are:
|
||||
| Unit Test Source Language | C | C++ |
|
||||
| Register Test Suite | YES | Auto |
|
||||
| Register Test Case | YES | Auto |
|
||||
| Death/Expected Assert Tests | YES | YES |
|
||||
| Expected Assert Tests | YES | YES |
|
||||
| Setup/Teardown Hooks | YES | YES |
|
||||
| Value-Parameterized Tests | NO | YES |
|
||||
| Typed Tests | NO | YES |
|
||||
|
Reference in New Issue
Block a user