-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AdvLoggerPkg: Add mock for AdvancedLoggerHdwPortLib
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
AdvLoggerPkg/Test/Mock/Include/GoogleTest/Library/MockAdvancedLoggerHdwPortLib.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** @file MockAdvancedLoggerHdwPortLib.h | ||
Google Test mocks for AdvancedLoggerHdwPortLib | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef MOCK_ADVANCED_LOGGER_HDW_PORT_LIB_H_ | ||
#define MOCK_ADVANCED_LOGGER_HDW_PORT_LIB_H_ | ||
|
||
#include <Library/GoogleTestLib.h> | ||
#include <Library/FunctionMockLib.h> | ||
extern "C" { | ||
#include <Uefi/UefiBaseType.h> | ||
#include <Uefi.h> | ||
#include <Library/AdvancedLoggerHdwPortLib.h> | ||
} | ||
|
||
struct MockAdvancedLoggerHdwPortLib { | ||
MOCK_INTERFACE_DECLARATION (MockAdvancedLoggerHdwPortLib); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
EFI_STATUS, | ||
AdvancedLoggerHdwPortInitialize, | ||
() | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
UINTN, | ||
AdvancedLoggerHdwPortWrite, | ||
(IN UINTN DebugLevel, | ||
IN UINT8 *Buffer, | ||
IN UINTN NumberOfBytes) | ||
); | ||
}; | ||
|
||
#endif |
13 changes: 13 additions & 0 deletions
13
...est/Mock/Library/GoogleTest/MockAdvancedLoggerHdwPortLib/MockAdvancedLoggerHdwPortLib.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** @file MockAdvancedLoggerHdwPortLib.cpp | ||
Google Test mocks for AdvancedLoggerHdwPortLib | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <GoogleTest/Library/MockAdvancedLoggerHdwPortLib.h> | ||
|
||
MOCK_INTERFACE_DEFINITION (MockAdvancedLoggerHdwPortLib); | ||
|
||
MOCK_FUNCTION_DEFINITION (MockAdvancedLoggerHdwPortLib, AdvancedLoggerHdwPortInitialize, 0, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockAdvancedLoggerHdwPortLib, AdvancedLoggerHdwPortWrite, 3, EFIAPI); |
34 changes: 34 additions & 0 deletions
34
...est/Mock/Library/GoogleTest/MockAdvancedLoggerHdwPortLib/MockAdvancedLoggerHdwPortLib.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## @file MockAdvancedLoggerHdwPortLib.inf | ||
# Google Test mocks for AdvancedLoggerHdwPortLib | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
## | ||
|
||
[Defines] | ||
INF_VERSION = 0x00010005 | ||
BASE_NAME = MockAdvancedLoggerHdwPortLib | ||
FILE_GUID = 88069e60-ae8b-5d10-a654-9aa6ce8b328c | ||
MODULE_TYPE = HOST_APPLICATION | ||
VERSION_STRING = 1.0 | ||
LIBRARY_CLASS = AdvancedLoggerHdwPortLib | ||
|
||
# | ||
# The following information is for reference only and not required by the build tools. | ||
# | ||
# VALID_ARCHITECTURES = IA32 X64 | ||
# | ||
|
||
[Sources] | ||
MockAdvancedLoggerHdwPortLib.cpp | ||
|
||
[Packages] | ||
AdvLoggerPkg/AdvLoggerPkg.dec | ||
MdePkg/MdePkg.dec | ||
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | ||
|
||
[LibraryClasses] | ||
GoogleTestLib | ||
|
||
[BuildOptions] | ||
MSFT:*_*_*_CC_FLAGS = /EHs /bigobj |