From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Liming Gao <gaoliming@byosoft.com.cn>,
Zhiguang Liu <zhiguang.liu@intel.com>
Subject: [Patch v3 2/7] MdePkg/Include/Library: Undefine _ASSERT() if already defined
Date: Tue, 8 Nov 2022 15:12:47 -0800 [thread overview]
Message-ID: <20221108231252.1864-3-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20221108231252.1864-1-michael.d.kinney@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134
When unit testing is enabled, make sure _ASSERT() is not already
defined by the host environment before defining _ASSERT(). This
avoids conflicts with VS20xx builds of GoogleTest based unit tests.
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
---
MdePkg/Include/Library/DebugLib.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
index 8d3d08638d73..9110be2f41b3 100644
--- a/MdePkg/Include/Library/DebugLib.h
+++ b/MdePkg/Include/Library/DebugLib.h
@@ -337,6 +337,9 @@ UnitTestDebugAssert (
IN CONST CHAR8 *Description
);
+ #if defined (_ASSERT)
+ #undef _ASSERT
+ #endif
#if defined (__clang__) && defined (__FILE_NAME__)
#define _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
#else
--
2.37.1.windows.1
next prev parent reply other threads:[~2022-11-08 23:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 23:12 [Patch v3 0/7] Add GoogleTest to UnitTestFrameworkPkg Michael D Kinney
2022-11-08 23:12 ` [Patch v3 1/7] MdePkg/Include: Update Base.h to improve C++ compatibility Michael D Kinney
2022-11-08 23:12 ` Michael D Kinney [this message]
2022-11-08 23:12 ` [Patch v3 3/7] UnitTestFrameworkPkg: Add googletest submodule and GoogleTestLib Michael D Kinney
2022-11-09 18:55 ` Leif Lindholm
2022-11-08 23:12 ` [Patch v3 4/7] UnitTestFrameworkPkg/Library/CmockaLib: Generate symbol information Michael D Kinney
2022-11-08 23:12 ` [Patch v3 5/7] .pytool: Add googletest submodule to CISettings.py Michael D Kinney
2022-11-08 23:12 ` [Patch v3 6/7] BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml output Michael D Kinney
2022-11-08 23:12 ` [Patch v3 7/7] MdePkg/Test: Add port of BaseSafeIntLib unit tests to GoogleTest Michael D Kinney
2022-11-11 1:09 ` FW: [edk2-devel] [Patch v3 0/7] Add GoogleTest to UnitTestFrameworkPkg Michael D Kinney
2022-11-11 1:32 ` 回复: " gaoliming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221108231252.1864-3-michael.d.kinney@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox