iPXE
gzip_test.c File Reference

gzip image tests More...

#include <ipxe/gzip.h>
#include <ipxe/test.h>
#include "archive_test.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 ARCHIVE_TEST (hello_world, &gzip_image_type, "hw.gz", NULL, "hw", BINFILE(0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0x01, 0x00, 0x52, 0x9e, 0xd6, 0x8b, 0x0b, 0x00, 0x00, 0x00), TEXTFILE("Hello world"))
 "Hello world"
 ARCHIVE_TEST (hello_filename, &gzip_image_type, "hwname.gz", NULL, "hwname", BINFILE(0x1f, 0x8b, 0x08, 0x08, 0xeb, 0x5b, 0x96, 0x60, 0x00, 0x03, 0x68, 0x77, 0x2e, 0x74, 0x78, 0x74, 0x00, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x57, 0x48, 0xcb, 0xcc, 0x49, 0xcd, 0x4b, 0xcc, 0x4d, 0x05, 0x00, 0x69, 0x37, 0x25, 0x3c, 0x0e, 0x00, 0x00, 0x00), TEXTFILE("Hello filename"))
 "Hello filename"
 ARCHIVE_TEST (hello_headers, &gzip_image_type, "hwhdrs.gz", NULL, "hwhdrs", BINFILE(0x1f, 0x8b, 0x08, 0x1c, 0x11, 0x5c, 0x96, 0x60, 0x00, 0x03, 0x05, 0x00, 0x41, 0x70, 0x01, 0x00, 0x0d, 0x68, 0x77, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x2f, 0x2f, 0x77, 0x68, 0x79, 0x3f, 0x00, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x57, 0x48, 0x2c, 0x2e, 0xce, 0x2f, 0x2a, 0x49, 0x4d, 0x51, 0xc8, 0x48, 0x4d, 0x4c, 0x49, 0x2d, 0x2a, 0x06, 0x00, 0x59, 0xa4, 0x19, 0x61, 0x16, 0x00, 0x00, 0x00), TEXTFILE("Hello assorted headers"))
 "Hello assorted headers"
static void gzip_test_exec (void)
 Perform gzip self-test.

Variables

struct self_test gzip_test __self_test
 gzip self-test

Detailed Description

gzip image tests

Definition in file gzip_test.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ ARCHIVE_TEST() [1/3]

ARCHIVE_TEST ( hello_world ,
& gzip_image_type,
"hw.gz" ,
NULL ,
"hw" ,
BINFILE(0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0x01, 0x00, 0x52, 0x9e, 0xd6, 0x8b, 0x0b, 0x00, 0x00, 0x00) ,
TEXTFILE("Hello world")  )

"Hello world"

References BINFILE, NULL, and TEXTFILE.

◆ ARCHIVE_TEST() [2/3]

ARCHIVE_TEST ( hello_filename ,
& gzip_image_type,
"hwname.gz" ,
NULL ,
"hwname" ,
BINFILE(0x1f, 0x8b, 0x08, 0x08, 0xeb, 0x5b, 0x96, 0x60, 0x00, 0x03, 0x68, 0x77, 0x2e, 0x74, 0x78, 0x74, 0x00, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x57, 0x48, 0xcb, 0xcc, 0x49, 0xcd, 0x4b, 0xcc, 0x4d, 0x05, 0x00, 0x69, 0x37, 0x25, 0x3c, 0x0e, 0x00, 0x00, 0x00) ,
TEXTFILE("Hello filename")  )

"Hello filename"

References BINFILE, NULL, and TEXTFILE.

◆ ARCHIVE_TEST() [3/3]

ARCHIVE_TEST ( hello_headers ,
& gzip_image_type,
"hwhdrs.gz" ,
NULL ,
"hwhdrs" ,
BINFILE(0x1f, 0x8b, 0x08, 0x1c, 0x11, 0x5c, 0x96, 0x60, 0x00, 0x03, 0x05, 0x00, 0x41, 0x70, 0x01, 0x00, 0x0d, 0x68, 0x77, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x2f, 0x2f, 0x77, 0x68, 0x79, 0x3f, 0x00, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x57, 0x48, 0x2c, 0x2e, 0xce, 0x2f, 0x2a, 0x49, 0x4d, 0x51, 0xc8, 0x48, 0x4d, 0x4c, 0x49, 0x2d, 0x2a, 0x06, 0x00, 0x59, 0xa4, 0x19, 0x61, 0x16, 0x00, 0x00, 0x00) ,
TEXTFILE("Hello assorted headers")  )

"Hello assorted headers"

References BINFILE, NULL, and TEXTFILE.

◆ gzip_test_exec()

void gzip_test_exec ( void )
static

Perform gzip self-test.

Definition at line 71 of file gzip_test.c.

71 {
72
73 archive_ok ( &hello_world );
74 archive_ok ( &hello_filename );
75 archive_ok ( &hello_headers );
76}
#define archive_ok(test)
Report an archive extraction test result.

References archive_ok.

Variable Documentation

◆ __self_test

struct self_test gzip_test __self_test
Initial value:
= {
.name = "gzip",
.exec = gzip_test_exec,
}
static void gzip_test_exec(void)
Perform gzip self-test.
Definition gzip_test.c:71

gzip self-test

Definition at line 79 of file gzip_test.c.

79 {
80 .name = "gzip",
81 .exec = gzip_test_exec,
82};