File: test-pe-util.c

package info (click to toggle)
shim 15.8-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,096 kB
  • sloc: ansic: 168,639; asm: 1,802; sh: 1,284; makefile: 1,151
file content (30 lines) | stat: -rw-r--r-- 570 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
}