Add files

This commit is contained in:
Alex Kotov 2022-01-13 18:50:51 +05:00
parent 2dccdc7d1f
commit bf9f635c83
6 changed files with 64 additions and 0 deletions

2
.gitignore vendored
View File

@ -50,6 +50,8 @@
/tests/test_elf
/tests/test_itoa
/tests/test_multiboot2_header_helpers
/tests/test_multiboot2_header_print
/tests/test_multiboot2_header_validation
/tests/test_multiboot2_info_helpers
/tests/test_multiboot2_info_print
/tests/test_multiboot2_info_validation

View File

@ -57,11 +57,15 @@ endif
if WITH_MULTIBOOT2
libkernaux_a_SOURCES += \
src/multiboot2/header_helpers.c \
src/multiboot2/header_is_valid.c \
src/multiboot2/header_print.c \
src/multiboot2/info_helpers.c \
src/multiboot2/info_is_valid.c \
src/multiboot2/info_print.c
TESTS += \
tests/test_multiboot2_header_helpers \
tests/test_multiboot2_header_print \
tests/test_multiboot2_header_validation \
tests/test_multiboot2_info_helpers \
tests/test_multiboot2_info_print \
tests/test_multiboot2_info_validation
@ -153,6 +157,16 @@ tests_test_multiboot2_header_helpers_SOURCES = \
tests/multiboot2_header_example1.h \
tests/multiboot2_header_example2.h
tests_test_multiboot2_header_print_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/test_multiboot2_header_print.c
tests_test_multiboot2_header_validation_SOURCES = \
$(libkernaux_a_SOURCES) \
tests/test_multiboot2_header_validation.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

View File

View File

@ -0,0 +1,40 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#define __USE_POSIX2
#include <stdio.h>
static const char output1[] = "";
static const char output2[] = "";
int main()
{
{
FILE *const fd = popen("tests/multiboot2_header_print1", "r");
assert(fd != NULL);
for (const char *ch = output1; *ch; ++ch) {
assert(fgetc(fd) == *ch);
}
const int status = pclose(fd);
assert(status == 0);
}
{
FILE *const fd = popen("tests/multiboot2_header_print2", "r");
assert(fd != NULL);
for (const char *ch = output2; *ch; ++ch) {
assert(fgetc(fd) == *ch);
}
const int status = pclose(fd);
assert(status == 0);
}
return 0;
}

View File

@ -0,0 +1,8 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
int main()
{
return 0;
}