diff options
author | Steve McIntyre <steve@einval.com> | 2021-03-23 23:49:46 +0000 |
---|---|---|
committer | Steve McIntyre <steve@einval.com> | 2021-03-23 23:49:46 +0000 |
commit | 1251a7ba86fc40a6aad8b4fecdbca2b61808d9fa (patch) | |
tree | 2125fda549aaca55cb49a48d54be77dec7fbf3df /test.c | |
parent | 85b409232ce89b34626df9d72abedf5d4f5ccef6 (diff) | |
parent | 031e5cce385d3f96b1caa1d53495332a7eb03749 (diff) | |
download | efi-boot-shim-debian/15.3-1.tar.gz efi-boot-shim-debian/15.3-1.zip |
Update upstream source from tag 'upstream/15.3'debian/15.3-1
Update to upstream version '15.3'
with Debian dir 1b484f1c1ac270604a5a1451b34de4b0865c6211
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 67 |
1 files changed, 67 insertions, 0 deletions
@@ -0,0 +1,67 @@ +// SPDX-License-Identifier: BSD-2-Clause-Patent +/* + * test.c - stuff we need for test harnesses + * Copyright Peter Jones <pjones@redhat.com> + */ + +#ifndef SHIM_UNIT_TEST +#define SHIM_UNIT_TEST +#endif +#include "shim.h" + +UINT8 in_protocol = 0; +int debug = DEFAULT_DEBUG_PRINT_STATE; + +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-function" + +EFI_STATUS EFIAPI +LogError_(const char *file, int line, const char *func, const CHAR16 *fmt, ...) +{ + assert(0); + return EFI_SUCCESS; +} + +INTN +StrCmp(CONST CHAR16 *s1, CONST CHAR16 *s2) { + assert(s1 != NULL); + assert(s2 != NULL); + + int i; + for (i = 0; s1[i] && s2[i]; i++) { + if (s1[i] != s2[i]) + return s2[i] - s1[i]; + } + return 0; +} + +INTN +StrnCmp(CONST CHAR16 *s1, CONST CHAR16 *s2, UINTN len) { + assert(s1 != NULL); + assert(s2 != NULL); + + UINTN i; + for (i = 0; i < len && s1[i] && s2[i]; i++) { + if (s1[i] != s2[i]) + return s2[i] - s1[i]; + + } + return 0; +} + +EFI_STATUS +get_variable_attr(const CHAR16 * const var, UINT8 **data, UINTN *len, + EFI_GUID owner, UINT32 *attributes) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +get_variable(const CHAR16 * const var, UINT8 **data, UINTN *len, EFI_GUID owner) +{ + return get_variable_attr(var, data, len, owner, NULL); +} + +EFI_GUID SHIM_LOCK_GUID = {0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } }; + +// vim:fenc=utf-8:tw=75:noet |