Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock Functions for MmReportStatusCodeHandler #1234

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = {
apop5 marked this conversation as resolved.
Show resolved Hide resolved
Register,
Unregister
};

extern "C" {
EFI_MM_RSC_HANDLER_PROTOCOL *MmRscHandlerProtocolServices = &MmRscHandlerProtocol;
}

#endif
Loading