From f2e99dee37660628f634f0d133ea9d946e185bfb Mon Sep 17 00:00:00 2001 From: Vivian Nowka-Keane Date: Mon, 9 Sep 2024 11:31:10 -0700 Subject: [PATCH] Add comments on libraries to mock --- .../AdvancedLoggerDxeCoreGoogleTest.cpp | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/GoogleTest/AdvancedLoggerDxeCoreGoogleTest.cpp b/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/GoogleTest/AdvancedLoggerDxeCoreGoogleTest.cpp index 6f7e36fd1e..89f5812628 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/GoogleTest/AdvancedLoggerDxeCoreGoogleTest.cpp +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/GoogleTest/AdvancedLoggerDxeCoreGoogleTest.cpp @@ -7,32 +7,31 @@ **/ #include -// #include -// #include -// #include +#include +#include +#include +#include extern "C" { - #include // should include basetype and base + #include #include #include #include #include #include - #include // to mock + #include // to mock (MU_BASECORE MdeModulePkg) #include - #include // to mock - #include // to mock - //#include // to mock - #include // to mock - #include // to mock - #include // to mock - #include // to mock + #include // to mock or NULL lib? (MU_PLUS) + #include // to mock (MU_BASECORE MdePkg) + #include // to mock OR NULL lib? (MU_BASECORE MdePkg) + #include // to mock (MU_BASECORE MdePkg) + #include // to mock (MU_BASECORE MdePkg) + #include // to mock (MU_BASECORE MdeModulePkg) #include "../../AdvancedLoggerCommon.h" - // extern ADVANCED_LOGGER_PROTOCOL *mLoggerProtocol; extern ADVANCED_LOGGER_INFO *mLoggerInfo; extern UINT32 mBufferSize; extern EFI_PHYSICAL_ADDRESS mMaxAddress; @@ -52,7 +51,6 @@ using namespace testing; **/ class AdvancedLoggerDxeCoreTest : public Test { protected: - // StrictMock AdvLoggerProtocolMock; UINTN DebugLevel; CHAR8 *Buffer; UINTN NumberOfBytes; @@ -71,8 +69,6 @@ class AdvancedLoggerDxeCoreTest : public Test { Buffer = OutputBuf; DebugLevel = DEBUG_ERROR; mInitialized = FALSE; - // gALProtocol->Signature = ADVANCED_LOGGER_PROTOCOL_SIGNATURE; - // gALProtocol->Version = ADVANCED_LOGGER_PROTOCOL_VERSION; ImageHandle = (EFI_HANDLE)0x12345678; testLoggerInfo.Signature = ADVANCED_LOGGER_SIGNATURE; testLoggerInfo.Version = ADVANCED_LOGGER_VERSION; @@ -118,19 +114,18 @@ TEST_F (AdvancedLoggerDxeCoreTest, AdvLoggerGetInfoFail) { EXPECT_EQ (status, FALSE); } -/* TODO need to mock PCD library, and more +/* Commented out, need mock libraries to be implemented. // Test AdvancedLoggerGetLoggerInfo TEST_F (AdvancedLoggerDxeCoreTest, AdvLoggerGetInfoSuccess) { - loggerInfo = AdvancedLoggerGetLoggerInfo (); + mLoggerInfo = AdvancedLoggerGetLoggerInfo (); } -*/ -/* TODO need to test AdvancedLoggerGetLoggerInfo // Test DxeCore Advanced Logger initialization TEST_F (AdvancedLoggerDxeCoreTest, AdvLoggerContructorSuccess) { DxeCoreAdvancedLoggerLibConstructor (ImageHandle, SystemTable); } */ + int main ( int argc,