-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
|
||
[Includes] | ||
Include | ||
UnitTests/Mock/Include | ||
|
||
[LibraryClasses] | ||
|
||
|
66 changes: 66 additions & 0 deletions
66
MsCorePkg/UnitTests/Mock/Include/GoogleTest/Library/MockDeviceBootManagerLib.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,66 @@ | ||
/** @file MockDeviceBootManagerLib.h | ||
Google Test mocks for DeviceBootManagerLib. | ||
Copyright (c) Microsoft Corporation. | ||
Your use of this software is governed by the terms of the Microsoft agreement under which you obtained the software. | ||
**/ | ||
|
||
#ifndef MOCK_DEVICE_BOOT_MANAGER_LIB_H_ | ||
#define MOCK_DEVICE_BOOT_MANAGER_LIB_H_ | ||
|
||
#include <Library/GoogleTestLib.h> | ||
#include <Library/FunctionMockLib.h> | ||
|
||
extern "C" { | ||
#include <Uefi.h> | ||
#include <Library/DeviceBootManagerLib.h> | ||
} | ||
|
||
struct MockDeviceBootManagerLib { | ||
MOCK_INTERFACE_DECLARATION (MockDeviceBootManagerLib); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
EFI_STATUS, | ||
DeviceBootManagerPriorityBoot, | ||
(EFI_BOOT_MANAGER_LOAD_OPTION *BootOption) | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
VOID, | ||
DeviceBootManagerUnableToBoot, | ||
() | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
VOID, | ||
DeviceBootManagerProcessBootCompletion, | ||
(EFI_BOOT_MANAGER_LOAD_OPTION *BootOption) | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
EFI_DEVICE_PATH_PROTOCOL **, | ||
DeviceBootManagerOnDemandConInConnect, | ||
() | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
VOID, | ||
DeviceBootManagerBdsEntry, | ||
() | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
EFI_HANDLE, | ||
DeviceBootManagerBeforeConsole, | ||
(EFI_DEVICE_PATH_PROTOCOL **DevicePath, | ||
BDS_CONSOLE_CONNECT_ENTRY **PlatformConsoles) | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
EFI_DEVICE_PATH_PROTOCOL **, | ||
DeviceBootManagerAfterConsole, | ||
() | ||
); | ||
}; | ||
|
||
#endif |
17 changes: 17 additions & 0 deletions
17
MsCorePkg/UnitTests/Mock/Library/MockDeviceBootManagerLib/MockDeviceBootManagerLib.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,17 @@ | ||
/** @file MockDeviceBootManagerLib.cpp | ||
Google Test mocks for DeviceBootManagerLib. | ||
Copyright (c) Microsoft Corporation. | ||
Your use of this software is governed by the terms of the Microsoft agreement under which you obtained the software. | ||
**/ | ||
|
||
#include <GoogleTest/Library/MockDeviceBootManagerLib.h> | ||
|
||
MOCK_INTERFACE_DEFINITION (MockDeviceBootManagerLib); | ||
MOCK_FUNCTION_DEFINITION (MockDeviceBootManagerLib, DeviceBootManagerPriorityBoot, 1, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockDeviceBootManagerLib, DeviceBootManagerUnableToBoot, 0, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockDeviceBootManagerLib, DeviceBootManagerProcessBootCompletion, 1, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockDeviceBootManagerLib, DeviceBootManagerOnDemandConInConnect, 0, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockDeviceBootManagerLib, DeviceBootManagerBdsEntry, 0, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockDeviceBootManagerLib, DeviceBootManagerBeforeConsole, 2, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockDeviceBootManagerLib, DeviceBootManagerAfterConsole, 0, EFIAPI); |
34 changes: 34 additions & 0 deletions
34
MsCorePkg/UnitTests/Mock/Library/MockDeviceBootManagerLib/MockDeviceBootManagerLib.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 MockDeviceBootManagerLib.inf | ||
# Google Test mocks for DeviceBootManagerLib. | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# Your use of this software is governed by the terms of the Microsoft agreement under which you obtained the software. | ||
## | ||
|
||
[Defines] | ||
INF_VERSION = 0x00010005 | ||
BASE_NAME = MockDeviceBootManagerLib | ||
FILE_GUID = A19D9B27-21EB-4DCF-A084-0326C2EB0E58 | ||
MODULE_TYPE = HOST_APPLICATION | ||
VERSION_STRING = 1.0 | ||
LIBRARY_CLASS = DeviceBootManagerLib | ||
|
||
# | ||
# The following information is for reference only and not required by the build tools. | ||
# | ||
# VALID_ARCHITECTURES = IA32 X64 | ||
# | ||
|
||
[Sources] | ||
MockDeviceBootManagerLib.cpp | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
MdeModulePkg/MdeModulePkg.dec | ||
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | ||
MsCorePkg/MsCorePkg.dec | ||
[LibraryClasses] | ||
GoogleTestLib | ||
|
||
[BuildOptions] | ||
MSFT:*_*_*_CC_FLAGS = /EHsc |
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