Skip to content

Commit

Permalink
MdePkg: Test: Add gRT_GetTime Google Test Mock
Browse files Browse the repository at this point in the history
This adds support for GetTime Google Test Mock

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
  • Loading branch information
Doug Flick via groups.io authored and lgao4 committed Feb 6, 2024
1 parent 543c8a0 commit b777a4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ struct MockUefiRuntimeServicesTableLib {
IN UINTN DataSize,
IN VOID *Data)
);

MOCK_FUNCTION_DECLARATION (
EFI_STATUS,
gRT_GetTime,
(OUT EFI_TIME *Time,
OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL)
);
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ MOCK_INTERFACE_DEFINITION (MockUefiRuntimeServicesTableLib);

MOCK_FUNCTION_DEFINITION (MockUefiRuntimeServicesTableLib, gRT_GetVariable, 5, EFIAPI);
MOCK_FUNCTION_DEFINITION (MockUefiRuntimeServicesTableLib, gRT_SetVariable, 5, EFIAPI);
MOCK_FUNCTION_DEFINITION (MockUefiRuntimeServicesTableLib, gRT_GetTime, 2, EFIAPI);

static EFI_RUNTIME_SERVICES localRt = {
{ 0 }, // EFI_TABLE_HEADER
{ 0 }, // EFI_TABLE_HEADER

NULL, // EFI_GET_TIME
gRT_GetTime, // EFI_GET_TIME
NULL, // EFI_SET_TIME
NULL, // EFI_GET_WAKEUP_TIME
NULL, // EFI_SET_WAKEUP_TIME
Expand Down

0 comments on commit b777a4f

Please sign in to comment.