Skip to content

Commit

Permalink
Update MockSmmSwDispatch2.h
Browse files Browse the repository at this point in the history
Modifications to use #define MOCK_EFI_SMM_SW_DISPATCH2_PROTOCOL_INSTANCE for MockEfiSmmSwDispatch2Protocol definition

Mock Protocol:
MdePkg\Test\Mock\Include\GoogleTest\Protocol\MockSmmSwDispatch2.h

Signed-off-by: Rasheed Yusuf <[email protected]>
Cc: Maintainer Shruti Gupta <[email protected]>
Cc: Reviewer Shruti Gupta <[email protected]>

Signed-off-by: Rasheed-Yusuf <[email protected]>
  • Loading branch information
Rasheed-Yusuf authored Dec 9, 2024
1 parent 4ce95b0 commit bbb2bf4
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions MdePkg/Test/Mock/Include/GoogleTest/Protocol/MockSmmSwDispatch2.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern "C" {
// Declarations to handle usage of the EFI_SMM_SW_DISPATCH2_PROTOCOL
struct MockEfiSmmSwDispatch2Protocol {

MOCK_INTERFACE_DECLARATION (MockSmmSwDispatch2Protocol);
MOCK_INTERFACE_DECLARATION (MockEfiSmmSwDispatch2Protocol);

MOCK_FUNCTION_DECLARATION (
EFI_STATUS,
Expand All @@ -40,17 +40,14 @@ struct MockEfiSmmSwDispatch2Protocol {
);
};

MOCK_INTERFACE_DEFINITION (MockSmmSwDispatch2Protocol);
MOCK_FUNCTION_DEFINITION (MockSmmSwDispatch2Protocol, MockRegister, 4, EFIAPI);
MOCK_FUNCTION_DEFINITION (MockSmmSwDispatch2Protocol, MockUnRegister, 2, EFIAPI);
MOCK_INTERFACE_DEFINITION (MockEfiSmmSwDispatch2Protocol);
MOCK_FUNCTION_DEFINITION (MockEfiSmmSwDispatch2Protocol, MockRegister, 4, EFIAPI);
MOCK_FUNCTION_DEFINITION (MockEfiSmmSwDispatch2Protocol, MockUnRegister, 2, EFIAPI);

EFI_SMM_SW_DISPATCH2_PROTOCOL SMM_SW_DISPATCH2_PROTOCOL_MOCK = {
MockRegister, // EFI_SMM_SW_REGISTER2 Register;
MockUnRegister // EFI_SMM_SW_UNREGISTER2 UnRegister;
};

extern "C" {
EFI_SMM_SW_DISPATCH2_PROTOCOL *gSmmSwDispatch2 = &SMM_SW_DISPATCH2_PROTOCOL_MOCK;
}
#define MOCK_EFI_SMM_SW_DISPATCH2_PROTOCOL_INSTANCE(NAME) \
EFI_SMM_SW_DISPATCH2_PROTOCOL NAME##_INSTANCE = { \
MockRegister, \
MockUnRegister }; \
EFI_SMM_SW_DISPATCH2_PROTOCOL *NAME = &NAME##_INSTANCE;

#endif // MOCK_SMM_SW_DISPATCH2_H_

0 comments on commit bbb2bf4

Please sign in to comment.