mirror of https://github.com/tailix/libkernaux.git
Add test "arch_i386_paging"
This commit is contained in:
parent
f659e2af97
commit
fbfd178f59
|
@ -44,6 +44,7 @@
|
||||||
|
|
||||||
/tests/multiboot2_print1
|
/tests/multiboot2_print1
|
||||||
/tests/multiboot2_print2
|
/tests/multiboot2_print2
|
||||||
|
/tests/test_arch_i386_paging
|
||||||
/tests/test_cmdline
|
/tests/test_cmdline
|
||||||
/tests/test_elf
|
/tests/test_elf
|
||||||
/tests/test_itoa
|
/tests/test_itoa
|
||||||
|
|
|
@ -30,6 +30,7 @@ if ARCH_I386
|
||||||
libkernaux_a_SOURCES += src/arch/i386/asm.S
|
libkernaux_a_SOURCES += src/arch/i386/asm.S
|
||||||
endif
|
endif
|
||||||
libkernaux_a_SOURCES += src/arch/i386/paging.c
|
libkernaux_a_SOURCES += src/arch/i386/paging.c
|
||||||
|
TESTS += tests/test_arch_i386_paging
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if WITH_ARCH_X86_64
|
if WITH_ARCH_X86_64
|
||||||
|
@ -111,6 +112,10 @@ examples_units_human_SOURCES = \
|
||||||
$(libkernaux_a_SOURCES) \
|
$(libkernaux_a_SOURCES) \
|
||||||
examples/units_human.c
|
examples/units_human.c
|
||||||
|
|
||||||
|
tests_test_arch_i386_paging_SOURCES = \
|
||||||
|
$(libkernaux_a_SOURCES) \
|
||||||
|
tests/test_arch_i386_paging.c
|
||||||
|
|
||||||
tests_multiboot2_print1_SOURCES = \
|
tests_multiboot2_print1_SOURCES = \
|
||||||
$(libkernaux_a_SOURCES) \
|
$(libkernaux_a_SOURCES) \
|
||||||
tests/multiboot2_print1.c
|
tests/multiboot2_print1.c
|
||||||
|
|
|
@ -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…
Reference in New Issue