55 const char *file,
unsigned int line ) {
60 okx ( iobuf !=
NULL, file, line );
61 DBGC ( &iobuf_test,
"IOBUF %p (%#08lx+%#zx) for %#zx align %#zx " 62 "offset %#zx\n", iobuf, virt_to_phys ( iobuf->
data ),
66 okx ( ( ( (
intptr_t ) iobuf ) & ( __alignof__ ( *iobuf ) - 1 ) ) == 0,
69 okx ( ( ( align == 0 ) ||
70 ( ( virt_to_phys ( iobuf->data ) & ( align - 1 ) ) ==
71 (
offset & ( align - 1 ) ) ) ), file, line );
85 #define alloc_iob_ok( len, align, offset ) \ 86 alloc_iob_okx ( len, align, offset, __FILE__, __LINE__ ) 98 const char *file,
unsigned int line ) {
103 okx ( iobuf ==
NULL, file, line );
105 #define alloc_iob_fail_ok( len, align, offset ) \ 106 alloc_iob_fail_okx ( len, align, offset, __FILE__, __LINE__ )
#define iob_put(iobuf, len)
static void iobuf_test_exec(void)
Perform I/O buffer self-tests.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob_raw(size_t len, size_t align, size_t offset)
Allocate I/O buffer with specified alignment and offset.
Self-test infrastructure.
const char * name
Test set name.
#define okx(success, file, line)
Report test result.
#define alloc_iob_fail_ok(len, align, offset)
static size_t iob_tailroom(struct io_buffer *iobuf)
Calculate available space at end of an I/O buffer.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static void alloc_iob_fail_okx(size_t len, size_t align, size_t offset, const char *file, unsigned int line)
Report I/O buffer allocation failure test result.
#define IOB_ZLEN
Minimum I/O buffer length and alignment.
void * data
Start of data.
uint16_t offset
Offset to command line.
static void alloc_iob_okx(size_t len, size_t align, size_t offset, const char *file, unsigned int line)
Report I/O buffer allocation test result.
struct self_test iobuf_test __self_test
I/O buffer self-test.
#define NULL
NULL pointer (VOID *)
#define alloc_iob_ok(len, align, offset)
void * memset(void *dest, int character, size_t len) __nonnull