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

MdePkg/GoogleTest: Add GetTime() RT service mock interface #607

Merged
Show file tree
Hide file tree
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
Flickdm marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -6,15 +6,15 @@
**/
#include <GoogleTest/Library/MockUefiRuntimeServicesTableLib.h>

MOCK_INTERFACE_DEFINITION(MockUefiRuntimeServicesTableLib);
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_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

NULL, // EFI_GET_TIME
static EFI_RUNTIME_SERVICES localRt = {
{ 0 }, // EFI_TABLE_HEADER
gRT_GetTime, // EFI_GET_TIME
NULL, // EFI_SET_TIME
NULL, // EFI_GET_WAKEUP_TIME
NULL, // EFI_SET_WAKEUP_TIME
Expand All @@ -36,5 +36,5 @@ static EFI_RUNTIME_SERVICES localRt = {
};

extern "C" {
EFI_RUNTIME_SERVICES* gRT = &localRt;
EFI_RUNTIME_SERVICES *gRT = &localRt;
Flickdm marked this conversation as resolved.
Show resolved Hide resolved
}