diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2024-02-06 14:43:16 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-02-14 02:37:16 +0000 |
commit | 312ccaf81b6343c9bcee1f8992086075353abeca (patch) | |
tree | e1913dbc5e5a0a8a92ce466f691632b49f5297e9 /UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c | |
parent | 81b69f306fe801546786186e1e5ae5f79a2fde97 (diff) | |
download | edk2-312ccaf81b6343c9bcee1f8992086075353abeca.tar.gz edk2-312ccaf81b6343c9bcee1f8992086075353abeca.tar.bz2 edk2-312ccaf81b6343c9bcee1f8992086075353abeca.zip |
UnitTestFrameworkPkg/UnitTestLib: GetActiveFrameworkHandle() no ASSERT()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4683
Update GetActiveFrameworkHandle() to remove ASSERT() and require
caller to check for NULL.
This allows GetActiveFrameworkHandle() to be used to determine if the
current host-based test environment is framework/cmocka or gtest. In
the framework/cmocka host-based environment GetActiveFrameworkHandle()
returns non-NULL. In the gtest host-based environment
GetActiveFrameworkHandle() returns NULL.
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>
Diffstat (limited to 'UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c')
-rw-r--r-- | UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c index 35636565b7..53cb71f610 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c @@ -57,6 +57,10 @@ UnitTestLogFailure ( // Get active Framework handle
//
FrameworkHandle = GetActiveFrameworkHandle ();
+ if (FrameworkHandle == NULL) {
+ DEBUG ((DEBUG_ERROR, "%a - FrameworkHandle not initialized\n", __func__));
+ return;
+ }
//
// Convert the message to an ASCII String
|