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>
This commit is contained in:
Michael D Kinney
2024-02-06 14:43:16 -08:00
committed by mergify[bot]
parent 81b69f306f
commit 312ccaf81b
5 changed files with 12 additions and 2 deletions

View File

@@ -166,6 +166,10 @@ UnitTestLog (
VA_LIST Marker;
FrameworkHandle = GetActiveFrameworkHandle ();
if (FrameworkHandle == NULL) {
DEBUG ((DEBUG_ERROR, "%a - FrameworkHandle not initialized\n", __func__));
return;
}
LogTypePrefix = NULL;