1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-10-30 11:54:01 -04:00

Add example

This commit is contained in:
Alex Kotov 2022-01-14 11:35:20 +05:00
parent afe3556467
commit 377ba05c95
2 changed files with 18 additions and 9 deletions

View file

@ -1 +1,15 @@
static const uint8_t multiboot2_header_example1[1] = { 0 };
// TODO: do we really need this?
static const uint8_t multiboot2_header_example1[] = {
214, 80, 82, 232, 0, 0, 0, 0, 16, 1, 0, 0, 26, 174, 173, 23, 1, 0, 0, 0, 96,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0,
0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0,
0, 12, 0, 0, 0, 13, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 17, 0,
0, 0, 18, 0, 0, 0, 19, 0, 0, 0, 20, 0, 0, 0, 21, 0, 0, 0, 2, 0, 0, 0, 24, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 12, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 12, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
0, 0, 0, 8, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0,
};

View file

@ -7,10 +7,7 @@
#define __USE_POSIX2
#include <stdio.h>
// static const char output1[] = "";
// TODO: add more tags
static const char output2[] =
static const char output[] =
"Multiboot 2 header\n"
" magic: 3897708758\n"
" arch: 0 (i386)\n"
@ -63,25 +60,23 @@ 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) {
for (const char *ch = output; *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) {
for (const char *ch = output; *ch; ++ch) {
assert(fgetc(fd) == *ch);
}