From 250df1259056c66012174e2a565250fc5a4e29ce Mon Sep 17 00:00:00 2001 From: Vivian Nowka-Keane Date: Tue, 20 Aug 2024 15:20:57 -0700 Subject: [PATCH] to squash: misc fixes --- .../GoogleTest/AdvancedLoggerDxeLibGoogleTest.cpp | 5 ++--- .../GoogleTest/AdvancedLoggerDxeLibGoogleTest.inf | 10 +++++----- .../Include/GoogleTest/Protocol/MockAdvancedLogger.h | 12 ++++-------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.cpp b/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.cpp index cb158b6e18..5172f8ed6a 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.cpp +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.cpp @@ -31,8 +31,8 @@ using namespace testing; **/ class AdvancedLoggerWriteTest : public Test { protected: - MockUefiBootServicesTableLib gBSMock; - MockAdvancedLogger AdvLoggerProtocolMock; + StrictMock gBSMock; + StrictMock AdvLoggerProtocolMock; UINTN DebugLevel; CHAR8 *Buffer; UINTN NumberOfBytes; @@ -52,7 +52,6 @@ class AdvancedLoggerWriteTest : public Test { mInitialized = FALSE; gALProtocol->Signature = ADVANCED_LOGGER_PROTOCOL_SIGNATURE; gALProtocol->Version = ADVANCED_LOGGER_PROTOCOL_VERSION; - mInitialized = FALSE; } }; diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.inf b/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.inf index ef70596027..fb3d79fa37 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.inf +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/GoogleTest/AdvancedLoggerDxeLibGoogleTest.inf @@ -8,11 +8,11 @@ ## [Defines] -INF_VERSION = 1.26 -BASE_NAME = AdvancedLoggerDxeLibGoogleTest -FILE_GUID = E6C75458-9408-42F5-BF84-CAF9C6D0751B -MODULE_TYPE = HOST_APPLICATION -VERSION_STRING = 1.0 + INF_VERSION = 1.26 + BASE_NAME = AdvancedLoggerDxeLibGoogleTest + FILE_GUID = E6C75458-9408-42F5-BF84-CAF9C6D0751B + MODULE_TYPE = HOST_APPLICATION + VERSION_STRING = 1.0 # # The following information is for reference only and not required by the build tools. diff --git a/AdvLoggerPkg/Test/Mock/Include/GoogleTest/Protocol/MockAdvancedLogger.h b/AdvLoggerPkg/Test/Mock/Include/GoogleTest/Protocol/MockAdvancedLogger.h index edbd58c137..02b57cd539 100644 --- a/AdvLoggerPkg/Test/Mock/Include/GoogleTest/Protocol/MockAdvancedLogger.h +++ b/AdvLoggerPkg/Test/Mock/Include/GoogleTest/Protocol/MockAdvancedLogger.h @@ -1,12 +1,12 @@ -/** @file MockAdvancedLogger.h +/** @file MockAdvancedLogger.h This file declares a mock of the Advanced Logger Protocol. Copyright (c) Microsoft Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef MOCK_ADVANCED_LOGGER_LIB_H_ -#define MOCK_ADVANCED_LOGGER_LIB_H_ +#ifndef MOCK_ADVANCED_LOGGER_PROTOCOL_H_ +#define MOCK_ADVANCED_LOGGER_PROTOCOL_H_ #include #include @@ -29,10 +29,6 @@ struct MockAdvancedLogger { ); }; -extern "C" { - extern ADVANCED_LOGGER_PROTOCOL *gALProtocol; -} - // // Mock function definitions in header file to prevent need of cpp file and // make it easier to consume in tests. @@ -52,4 +48,4 @@ extern "C" { ADVANCED_LOGGER_PROTOCOL *gALProtocol = &advancedLoggerInstance; } -#endif // MOCK_ADVANCED_LOGGER_LIB_H_ +#endif // MOCK_ADVANCED_LOGGER_PROTOCOL_H_