1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2025-03-17 17:14:00 -04:00
libkernaux/tests/multiboot2_info_print2.c

44 lines
820 B
C
Raw Permalink Normal View History

2020-12-07 09:47:53 +05:00
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define KERNAUX_ACCESS_PROTECTED
#include <kernaux/generic/display.h>
#include <kernaux/macro.h>
2020-11-29 17:57:34 +05:00
#include <kernaux/multiboot2.h>
#include <assert.h>
2022-02-02 08:09:54 +05:00
#include <stdarg.h>
2020-11-29 17:57:34 +05:00
#include <stdio.h>
2022-12-17 16:26:20 +04:00
#include "../fixtures/multiboot2_info_example2.h"
2020-11-29 17:57:34 +05:00
static void my_putc(void *display KERNAUX_UNUSED, char c)
{
putchar(c);
}
static
void my_vprintf(void *display KERNAUX_UNUSED, const char *format, va_list va)
2022-02-02 08:09:54 +05:00
{
vprintf(format, va);
}
static const struct KernAux_Display display = {
.putc = my_putc,
.vprintf = my_vprintf,
};
2022-06-20 21:01:56 +03:00
void test_main()
2020-11-29 17:57:34 +05:00
{
2022-01-13 08:59:52 +05:00
assert(KernAux_Multiboot2_Info_is_valid(
2022-01-13 09:05:34 +05:00
&multiboot2_info_example2.multiboot2_info
2022-01-13 08:59:52 +05:00
));
2020-11-29 17:57:34 +05:00
2022-01-13 08:59:52 +05:00
KernAux_Multiboot2_Info_print(
2022-01-13 09:05:34 +05:00
&multiboot2_info_example2.multiboot2_info,
&display
2020-11-29 17:57:34 +05:00
);
}