Add some test and example stubs

This commit is contained in:
Alex Kotov 2022-01-13 18:31:06 +05:00
parent 8dc690d139
commit 3688a47968
6 changed files with 44 additions and 1 deletions

1
.gitignore vendored
View File

@ -47,6 +47,7 @@
/tests/test_cmdline
/tests/test_elf
/tests/test_itoa
/tests/test_multiboot2_header_helpers
/tests/test_multiboot2_info_helpers
/tests/test_multiboot2_info_print
/tests/test_multiboot2_info_validation

View File

@ -61,6 +61,7 @@ libkernaux_a_SOURCES += \
src/multiboot2/info_is_valid.c \
src/multiboot2/info_print.c
TESTS += \
tests/test_multiboot2_header_helpers \
tests/test_multiboot2_info_helpers \
tests/test_multiboot2_info_print \
tests/test_multiboot2_info_validation
@ -134,6 +135,12 @@ tests_test_itoa_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/test_itoa.c
tests_test_multiboot2_header_helpers_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/test_multiboot2_header_helpers.c \
tests/multiboot2_header_example1.h \
tests/multiboot2_header_example2.h
tests_test_multiboot2_info_helpers_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/test_multiboot2_info_helpers.c \

View File

@ -0,0 +1 @@
static const uint8_t multiboot2_header_example1[1] = { 0 };

View File

@ -0,0 +1,21 @@
static const struct {
struct KernAux_Multiboot2_Header multiboot2_header;
struct KernAux_Multiboot2_HTag_None tag_none;
} multiboot2_header_example2 = {
.multiboot2_header = {
.magic = KERNAUX_MULTIBOOT2_MAGIC,
.arch = KERNAUX_MULTIBOOT2_ARCH_I386,
.total_size = sizeof(multiboot2_header_example2),
.checksum = KERNAUX_MULTIBOOT2_CHECKSUM(
KERNAUX_MULTIBOOT2_ARCH_I386,
sizeof(multiboot2_header_example2)
),
},
.tag_none = {
.base = {
.type = KERNAUX_MULTIBOOT2_HTAG_NONE,
.size = sizeof(multiboot2_header_example2.tag_none),
},
},
};

View File

@ -1,4 +1,4 @@
static const unsigned char multiboot2_info_example1[864] = {
static const uint8_t multiboot2_info_example1[864] = {
96, 3, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 12, 0, 0, 0,
0, 0, 64, 0, 0, 0, 232, 133, 1, 0, 0, 0, 21, 0, 0, 0,
104, 101, 108, 108, 111, 32, 107, 101, 114, 110, 101, 108, 0, 139, 69, 228,

View File

@ -0,0 +1,13 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <kernaux/multiboot2.h>
#include "multiboot2_header_example1.h"
#include "multiboot2_header_example2.h"
int main()
{
return 0;
}