diff options
| author | Peter Jones <pjones@redhat.com> | 2021-07-02 14:24:12 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2021-07-20 09:44:25 -0400 |
| commit | 8600b635624c52f24459c82848ae5907992571c7 (patch) | |
| tree | 3a2a39596a9b775b94ab16d7f364eb15e1acc022 /include | |
| parent | f1ef8dffd374048fbf8dd584923c42e5a784bbf2 (diff) | |
| download | efi-boot-shim-8600b635624c52f24459c82848ae5907992571c7.tar.gz efi-boot-shim-8600b635624c52f24459c82848ae5907992571c7.zip | |
test.c: add some simple mock functions for BS->{Allocate,Free}*
In some test cases, it may be useful to call libefi.a functions, such as
the device path parsing functions, which allocate pages via
BS->AllocatePool() or BS->AllocatePages.
This patch ads a simple mock implementation of those functions, as well
as the EFI_SYSTEM_TABLE, EFI_BOOT_SERVICES, and EFI_RUNTIME_SERVICES
variables *ST, *BS, and *RT (respectively), and initializes them before
the test cases run.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/test.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/test.h b/include/test.h index 811f92bf..9a4fdb1b 100644 --- a/include/test.h +++ b/include/test.h @@ -57,6 +57,10 @@ UINTN StrSize(IN CONST CHAR16 *s1); VOID StrCat(IN CHAR16 *Dest, IN CONST CHAR16 *Src); CHAR16 *DevicePathToStr(EFI_DEVICE_PATH *DevPath); +extern EFI_SYSTEM_TABLE *ST; +extern EFI_BOOT_SERVICES *BS; +extern EFI_RUNTIME_SERVICES *RT; + #define CompareGuid(a, b) memcmp(a, b, sizeof(a)) extern int debug; |
