]>
git.proxmox.com Git - efi-boot-shim.git/blob - test-pe-relocate.c
1 // SPDX-License-Identifier: BSD-2-Clause-Patent
3 * test-pe-reloc.c - attempt to test relocate_coff()
4 * Copyright Peter Jones <pjones@redhat.com>
13 test_image_address(void)
18 assert_equal_return(ImageAddress(image
, sizeof(image
), 0), &image
[0], -1, "got %p expected %p\n");
19 assert_equal_return(ImageAddress(image
, sizeof(image
), 4), NULL
, -1, "got %p expected %p\n");
20 assert_equal_return(ImageAddress((void *)1, 2, 3), NULL
, -1, "got %p expected %p\n");
21 assert_equal_return(ImageAddress((void *)-1ull, UINT64_MAX
, UINT64_MAX
), NULL
, -1, "got %p expected %p\n");
22 assert_equal_return(ImageAddress((void *)0, UINT64_MAX
, UINT64_MAX
), NULL
, -1, "got %p expected %p\n");
23 assert_equal_return(ImageAddress((void *)1, UINT64_MAX
, UINT64_MAX
), NULL
, -1, "got %p expected %p\n");
24 assert_equal_return(ImageAddress((void *)2, UINT64_MAX
, UINT64_MAX
), NULL
, -1, "got %p expected %p\n");
25 assert_equal_return(ImageAddress((void *)3, UINT64_MAX
, UINT64_MAX
), NULL
, -1, "got %p expected %p\n");
34 test(test_image_address
);
39 // vim:fenc=utf-8:tw=75:noet