summaryrefslogtreecommitdiff
path: root/test-pe-util.c
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2024-02-17 17:35:37 +0000
committerSteve McIntyre <steve@einval.com>2024-02-17 17:35:37 +0000
commita075e58606b9affb6dfb176c71caab816737a981 (patch)
treecb517fcf059f8d9d9dd7f6860a2d77d75ddc4142 /test-pe-util.c
parent2dd2f7600d41253fe621b8d040ab57f0c202d71b (diff)
downloadefi-boot-shim-upstream.tar.gz
efi-boot-shim-upstream.zip
New upstream version 15.8upstream/15.8upstream
Diffstat (limited to 'test-pe-util.c')
-rw-r--r--test-pe-util.c30
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;
+}