mirror of
https://github.com/tailix/libkernaux.git
synced 2025-03-31 17:25:22 -04:00
Add files
This commit is contained in:
parent
2dccdc7d1f
commit
bf9f635c83
6 changed files with 64 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -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
|
||||
|
|
14
Makefile.am
14
Makefile.am
|
@ -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 \
|
||||
|
|
0
src/multiboot2/header_is_valid.c
Normal file
0
src/multiboot2/header_is_valid.c
Normal file
0
src/multiboot2/header_print.c
Normal file
0
src/multiboot2/header_print.c
Normal file
40
tests/test_multiboot2_header_print.c
Normal file
40
tests/test_multiboot2_header_print.c
Normal 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;
|
||||
}
|
8
tests/test_multiboot2_header_validation.c
Normal file
8
tests/test_multiboot2_header_validation.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue