libpayload/tests: Remove unused test files

Change-Id: Id2cec6a56ba5ce98832aced6fc2cfd8ebda91f02
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86536
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes Haouas 2025-02-20 07:53:41 +01:00
commit 9c0edfa76b
2 changed files with 0 additions and 46 deletions

View file

@ -1,12 +0,0 @@
CC=gcc -g -m32
INCLUDES=-I. -I../include -I../include/x86
TARGETS=cbfs-x86-test
cbfs-x86-test: cbfs-x86-test.c ../arch/x86/rom_media.c ../libcbfs/ram_media.c ../libcbfs/cbfs.c
$(CC) -o $@ $^ $(INCLUDES)
all: $(TARGETS)
run: all
for i in $(TARGETS); do ./$$i; done

View file

@ -1,34 +0,0 @@
/* system headers */
#include <stdlib.h>
#include <stdio.h>
/* libpayload headers */
#include "cbfs.h"
int fail(const char* str)
{
fprintf(stderr, "%s", str);
exit(1);
}
int main(int argc, char** argv)
{
FILE *cbfs = fopen("data/cbfs-x86.bin", "rb");
if (!cbfs) fail("could not open test file\n");
if (fseek(cbfs, 0, SEEK_END) != 0) fail("seek to end failed\n");
long size = ftell(cbfs);
if (size == -1) fail("could not determine file size\n");
if (fseek(cbfs, 0, SEEK_SET) != 0) fail("seek to start failed\n");
void *data = malloc(size);
if (!data) fail("could not allocate buffer\n");
if (fread(data, size, 1, cbfs) != 1) fail("could not read data\n");
if (fclose(cbfs)) fail("could not close file\n");
if (setup_cbfs_from_ram(data, size) != 0) fail("could not setup CBFS in RAM\n");
struct cbfs_file *file = cbfs_find("foo");
if (file == NULL) fail("could not find file in CBFS\n");
exit(0);
}