-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mock Functions for MmReportStatusCodeHandler
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
MdePkg/Test/Mock/Include/GoogleTest/Protocol/MockMmReportStatusCodeHandler.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,50 @@ | ||
/** @file MockMmReportStatusCodeHandler.h | ||
This file declares a mock of Standalone MM Report Status Code Handler Protocol. | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef MOCK_MM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H | ||
#define MOCK_MM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H | ||
|
||
#include <Library/GoogleTestLib.h> | ||
#include <Library/FunctionMockLib.h> | ||
|
||
extern "C" { | ||
#include <Uefi.h> | ||
#include <Library/ReportStatusCodeLib.h> | ||
#include <Protocol/MmReportStatusCodeHandler.h> | ||
} | ||
|
||
struct MockReportStatusCodeHandler { | ||
MOCK_INTERFACE_DECLARATION (MockReportStatusCodeHandler); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
EFI_STATUS, | ||
Register, | ||
( | ||
IN EFI_MM_RSC_HANDLER_CALLBACK Callback) | ||
); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
EFI_STATUS, | ||
Unregister, | ||
(IN EFI_MM_RSC_HANDLER_CALLBACK Callback) | ||
); | ||
}; | ||
|
||
MOCK_INTERFACE_DEFINITION (MockReportStatusCodeHandler); | ||
MOCK_FUNCTION_DEFINITION (MockReportStatusCodeHandler, Register, 1, EFIAPI); | ||
MOCK_FUNCTION_DEFINITION (MockReportStatusCodeHandler, Unregister, 1, EFIAPI); | ||
|
||
EFI_MM_RSC_HANDLER_PROTOCOL MmRscHandlerProtocol = { | ||
Register, | ||
Unregister | ||
}; | ||
|
||
extern "C" { | ||
EFI_MM_RSC_HANDLER_PROTOCOL *MmRscHandlerProtocolServices = &MmRscHandlerProtocol; | ||
} | ||
|
||
#endif |