Skip to content

Commit

Permalink
[Cherry-Pick]MdePkg: Add Google Test Library and Protocol
Browse files Browse the repository at this point in the history
Mock Libraries:
 MdePkg\Test\Mock\Library\GoogleTest\MockCpuLib
 MdePkg\Test\Mock\Library\GoogleTest\MockPciSegmentLib
 MdePkg\Test\Mock\Library\GoogleTest\MockReportStatusCodeLib
 MdePkg\Test\Mock\Library\GoogleTest\MockSmmServicesTableLib

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

Signed-off-by: jack Hsieh <[email protected]>
Cc: Maintainer Shruti Gupta <[email protected]>
Cc: Reviewer   Shruti Gupta <[email protected]>
  • Loading branch information
v-chhsieh authored and apop5 committed Oct 22, 2024
1 parent be996c0 commit bf73b8a
Show file tree
Hide file tree
Showing 13 changed files with 863 additions and 32 deletions.
3 changes: 3 additions & 0 deletions MdePkg/Test/MdePkgHostTest.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@
MdePkg/Test/Mock/Library/GoogleTest/MockDxeServicesTableLib/MockDxeServicesTableLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockPciLib/MockPciLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockPcdLib/MockPcdLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockCpuLib/MockCpuLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockPciSegmentLib/MockPciSegmentLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockReportStatusCodeLib/MockReportStatusCodeLib.inf
# MU_CHANGE [END]
64 changes: 64 additions & 0 deletions MdePkg/Test/Mock/Include/GoogleTest/Library/MockCpuLib.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/** @file MockCpuLib.h
Google Test mocks for the CPU Library
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef MOCK_CPU_LIB_H_
#define MOCK_CPU_LIB_H_

#include <Library/GoogleTestLib.h>
#include <Library/FunctionMockLib.h>

extern "C" {
#include <Uefi.h>
}

struct MockCpuLib {
MOCK_INTERFACE_DECLARATION (MockCpuLib);

MOCK_FUNCTION_DECLARATION (
VOID,
CpuSleep,
(
)
);

MOCK_FUNCTION_DECLARATION (
VOID,
CpuFlushTlb,
(
)
);

MOCK_FUNCTION_DECLARATION (
VOID,
InitializeFloatingPointUnits,
(
)
);

MOCK_FUNCTION_DECLARATION (
BOOLEAN,
StandardSignatureIsAuthenticAMD,
(
)
);

MOCK_FUNCTION_DECLARATION (
UINT32,
GetCpuFamilyModel,
(
)
);

MOCK_FUNCTION_DECLARATION (
UINT8,
GetCpuSteppingId,
(
)
);
};

#endif
Loading

0 comments on commit bf73b8a

Please sign in to comment.