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>
  • Loading branch information
Douglas Flick [MSFT] committed Jan 25, 2024
1 parent 7ac1c91 commit 16a4096
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 16a4096

Please sign in to comment.