UnitTestFrameworkPkg/GoogleTestLib: Enhance unit test NULL checks
gtest.h uses standard includes that define NULL to __null. This is different that the C++ standard that uses nullptr. Redefine NULL in GoogleTestLib.h to use C++ form of nullptr. This allows NULL to be used in checks and mocks without explicit typecasts. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
f93e6a0743
commit
b4e5860fd5
@@ -13,6 +13,15 @@
|
||||
#include <gmock/gmock.h>
|
||||
#include <cstring>
|
||||
|
||||
//
|
||||
// For all use of GoogleTestLib, make sure NULL is defined to nullptr to
|
||||
// support matching any unit test pointer value to NULL.
|
||||
//
|
||||
#ifdef NULL
|
||||
#undef NULL
|
||||
#define NULL nullptr
|
||||
#endif
|
||||
|
||||
using ::testing::Throws;
|
||||
using ::testing::ThrowsMessage;
|
||||
using ::testing::HasSubstr;
|
||||
|
||||
Reference in New Issue
Block a user