diff options
| author | Steve McIntyre <steve@einval.com> | 2024-02-17 17:35:37 +0000 |
|---|---|---|
| committer | Steve McIntyre <steve@einval.com> | 2024-05-03 14:36:51 +0100 |
| commit | f898e219b4b06cf2bb7af18b5cc7a00754d3d274 (patch) | |
| tree | c535b3ff1b13388dbaa7072c7f5ec78f5d73ee53 /test-pe-util.c | |
| parent | 3cf4042d82ef314f19e9f7bd4f86c4b59efd8233 (diff) | |
| download | efi-boot-shim-f898e219b4b06cf2bb7af18b5cc7a00754d3d274.tar.gz efi-boot-shim-f898e219b4b06cf2bb7af18b5cc7a00754d3d274.zip | |
New upstream version 15.8
Diffstat (limited to 'test-pe-util.c')
| -rw-r--r-- | test-pe-util.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test-pe-util.c b/test-pe-util.c new file mode 100644 index 00000000..d5765488 --- /dev/null +++ b/test-pe-util.c @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: BSD-2-Clause-Patent +/* + * test-pe-util.c - test PE utilities + */ + +#ifndef SHIM_UNIT_TEST +#define SHIM_UNIT_TEST +#endif +#include "shim.h" + +static int +test_is_page_aligned(void) +{ + assert_true_return(IS_PAGE_ALIGNED(0), -1, "\n"); + assert_false_return(IS_PAGE_ALIGNED(1), -1, "\n"); + assert_false_return(IS_PAGE_ALIGNED(4095), -1, "\n"); + assert_true_return(IS_PAGE_ALIGNED(4096), -1, "\n"); + assert_false_return(IS_PAGE_ALIGNED(4097), -1, "\n"); + + return 0; +} + +int +main(void) +{ + int status = 0; + test(test_is_page_aligned); + + return status; +} |
