Add some test helper executables

This commit is contained in:
Alex Kotov 2022-01-13 18:37:37 +05:00
parent 3688a47968
commit 9941c8c715
4 changed files with 62 additions and 0 deletions

2
.gitignore vendored
View File

@ -42,6 +42,8 @@
/examples/printf_va
/examples/units_human
/tests/multiboot2_header_print1
/tests/multiboot2_header_print2
/tests/multiboot2_info_print1
/tests/multiboot2_info_print2
/tests/test_cmdline

View File

@ -66,6 +66,8 @@ TESTS += \
tests/test_multiboot2_info_print \
tests/test_multiboot2_info_validation
noinst_PROGRAMS += \
tests/multiboot2_header_print1 \
tests/multiboot2_header_print2 \
tests/multiboot2_info_print1 \
tests/multiboot2_info_print2
endif
@ -113,6 +115,16 @@ examples_units_human_SOURCES = \
$(libkernaux_a_SOURCES) \
examples/units_human.c
tests_multiboot2_header_print1_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/multiboot2_header_print1.c \
tests/multiboot2_header_example1.h
tests_multiboot2_header_print2_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/multiboot2_header_print2.c \
tests/multiboot2_header_example2.h
tests_multiboot2_info_print1_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/multiboot2_info_print1.c \

View File

@ -0,0 +1,24 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <kernaux/multiboot2.h>
#include <assert.h>
#include <stdio.h>
#include "multiboot2_header_example1.h"
int main()
{
assert(KernAux_Multiboot2_Header_is_valid(
(struct KernAux_Multiboot2_Header*)multiboot2_header_example1
));
KernAux_Multiboot2_Header_print(
(struct KernAux_Multiboot2_Header*)multiboot2_header_example1,
(void (*)(const char *format, ...))printf
);
return 0;
}

View File

@ -0,0 +1,24 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <kernaux/multiboot2.h>
#include <assert.h>
#include <stdio.h>
#include "multiboot2_header_example2.h"
int main()
{
assert(KernAux_Multiboot2_Header_is_valid(
&multiboot2_header_example2.multiboot2_header
));
KernAux_Multiboot2_Header_print(
&multiboot2_header_example2.multiboot2_header,
(void (*)(const char *format, ...))printf
);
return 0;
}