1
0
Fork 0
mirror of https://github.com/tailix/libclayer.git synced 2024-11-20 11:06:24 -05:00
libclayer/tests/test_multiboot2_info_print.c.in

61 lines
1.6 KiB
C

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#ifndef __USE_POSIX2
#define __USE_POSIX2
#endif
#include <stdio.h>
void test_main()
{
{
FILE *const print_file =
popen("@abs_top_builddir@/tests/multiboot2_info_print0", "r");
FILE *const text_file =
fopen("@abs_top_srcdir@/fixtures/multiboot2_info_example0.txt", "r");
assert(print_file != NULL);
assert(text_file != NULL);
while (!feof(text_file)) {
assert(fgetc(print_file) == fgetc(text_file));
}
assert(pclose(print_file) == 0);
assert(fclose(text_file) == 0);
}
{
FILE *const print_file =
popen("@abs_top_builddir@/tests/multiboot2_info_print1", "r");
FILE *const text_file =
fopen("@abs_top_srcdir@/fixtures/multiboot2_info_example1.txt", "r");
assert(print_file != NULL);
assert(text_file != NULL);
while (!feof(text_file)) {
assert(fgetc(print_file) == fgetc(text_file));
}
assert(pclose(print_file) == 0);
assert(fclose(text_file) == 0);
}
{
FILE *const print_file =
popen("@abs_top_builddir@/tests/multiboot2_info_print2", "r");
FILE *const text_file =
fopen("@abs_top_srcdir@/fixtures/multiboot2_info_example2.txt", "r");
assert(print_file != NULL);
assert(text_file != NULL);
while (!feof(text_file)) {
assert(fgetc(print_file) == fgetc(text_file));
}
assert(pclose(print_file) == 0);
assert(fclose(text_file) == 0);
}
}