mirror of
https://github.com/tailix/libkernaux.git
synced 2025-04-21 17:42:26 -04:00
Add test "arch_i386_paging"
This commit is contained in:
parent
f659e2af97
commit
fbfd178f59
3 changed files with 38 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -44,6 +44,7 @@
|
|||
|
||||
/tests/multiboot2_print1
|
||||
/tests/multiboot2_print2
|
||||
/tests/test_arch_i386_paging
|
||||
/tests/test_cmdline
|
||||
/tests/test_elf
|
||||
/tests/test_itoa
|
||||
|
|
|
@ -30,6 +30,7 @@ if ARCH_I386
|
|||
libkernaux_a_SOURCES += src/arch/i386/asm.S
|
||||
endif
|
||||
libkernaux_a_SOURCES += src/arch/i386/paging.c
|
||||
TESTS += tests/test_arch_i386_paging
|
||||
endif
|
||||
|
||||
if WITH_ARCH_X86_64
|
||||
|
@ -111,6 +112,10 @@ examples_units_human_SOURCES = \
|
|||
$(libkernaux_a_SOURCES) \
|
||||
examples/units_human.c
|
||||
|
||||
tests_test_arch_i386_paging_SOURCES = \
|
||||
$(libkernaux_a_SOURCES) \
|
||||
tests/test_arch_i386_paging.c
|
||||
|
||||
tests_multiboot2_print1_SOURCES = \
|
||||
$(libkernaux_a_SOURCES) \
|
||||
tests/multiboot2_print1.c
|
||||
|
|
32
tests/test_arch_i386_paging.c
Normal file
32
tests/test_arch_i386_paging.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <kernaux/arch/i386.h>
|
||||
|
||||
// TODO: There are some static asserts just for example.
|
||||
|
||||
__attribute__((unused))
|
||||
static const int assert0[
|
||||
sizeof(struct KernAux_Arch_I386_PDE) == sizeof(uint32_t) ? 1 : -1
|
||||
];
|
||||
|
||||
__attribute__((unused))
|
||||
static const int assert1[
|
||||
sizeof(struct KernAux_Arch_I386_PTE) == sizeof(uint32_t) ? 1 : -1
|
||||
];
|
||||
|
||||
__attribute__((unused))
|
||||
static const int assert1[
|
||||
sizeof(struct KernAux_Arch_I386_PageDir) == 1024 * sizeof(uint32_t) ? 1 : -1
|
||||
];
|
||||
|
||||
__attribute__((unused))
|
||||
static const int assert1[
|
||||
sizeof(struct KernAux_Arch_I386_PageTable) == 1024 * sizeof(uint32_t) ? 1 : -1
|
||||
];
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue