1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-27 11:14:42 -05:00
libkernaux/tests/test_arch_i386.c
Alex Kotov 971b2f4803
Add i386 stuff (#116)
* Add struct KernAux_Arch_I386_IDTE
* Add struct KernAux_Arch_I386_DTR
* Remove unnecessary static check
* Add func KernAux_Arch_I386_IDTE_set_offset
2022-11-28 15:00:34 +04:00

33 lines
715 B
C

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <kernaux/arch/i386.h>
#include <assert.h>
#include <string.h>
static void test_idte_set_offset();
void test_main()
{
test_idte_set_offset();
}
void test_idte_set_offset()
{
struct KernAux_Arch_I386_IDTE idte;
memset(&idte, 0, sizeof(idte));
KernAux_Arch_I386_IDTE_set_offset(&idte, 0);
assert(idte.offset_high == 0);
assert(idte.offset_low == 0);
KernAux_Arch_I386_IDTE_set_offset(&idte, 0xFFFFFFFF);
assert(idte.offset_high == 0xFFFF);
assert(idte.offset_low == 0xFFFF);
KernAux_Arch_I386_IDTE_set_offset(&idte, 0x12345678);
assert(idte.offset_high == 0x1234);
assert(idte.offset_low == 0x5678);
}