mirror of
https://github.com/tailix/libkernaux.git
synced 2025-02-17 15:45:32 -05:00
Add some test and example stubs
This commit is contained in:
parent
8dc690d139
commit
3688a47968
6 changed files with 44 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
1
tests/multiboot2_header_example1.h
Normal file
1
tests/multiboot2_header_example1.h
Normal file
|
@ -0,0 +1 @@
|
|||
static const uint8_t multiboot2_header_example1[1] = { 0 };
|
21
tests/multiboot2_header_example2.h
Normal file
21
tests/multiboot2_header_example2.h
Normal 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),
|
||||
},
|
||||
},
|
||||
};
|
|
@ -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,
|
||||
|
|
13
tests/test_multiboot2_header_helpers.c
Normal file
13
tests/test_multiboot2_header_helpers.c
Normal 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue