Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
fuzz_helpers.h File Reference
#include "debug.h"
#include "fuzz.h"
#include "xxhash.h"
#include "zstd.h"
#include "fuzz_data_producer.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define MIN(a, b)
 
#define MAX(a, b)
 
#define FUZZ_QUOTE_IMPL(str)
 
#define FUZZ_QUOTE(str)
 
#define FUZZ_ASSERT_MSG(cond, msg)
 
#define FUZZ_ASSERT(cond)
 
#define FUZZ_ZASSERT(code)
 
#define FUZZ_STATIC   static
 

Functions

void * FUZZ_malloc (size_t size)
 
void * FUZZ_malloc_rand (size_t size, FUZZ_dataProducer_t *producer)
 
int FUZZ_memcmp (void const *lhs, void const *rhs, size_t size)
 

Macro Definition Documentation

◆ FUZZ_ASSERT

#define FUZZ_ASSERT ( cond)
Value:
FUZZ_ASSERT_MSG((cond), "");
#define FUZZ_ASSERT_MSG(cond, msg)
Definition fuzz_helpers.h:42

◆ FUZZ_ASSERT_MSG

#define FUZZ_ASSERT_MSG ( cond,
msg )
Value:
((cond) ? (void)0 \
: (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
__LINE__, FUZZ_QUOTE(cond), (msg)), \
abort()))
#define FUZZ_QUOTE(str)
Definition fuzz_helpers.h:37

Asserts for fuzzing that are always enabled.

◆ FUZZ_QUOTE

#define FUZZ_QUOTE ( str)
Value:
#define FUZZ_QUOTE_IMPL(str)
Definition fuzz_helpers.h:36
const char * str
Table column heading string.
Definition list.c:109

◆ FUZZ_QUOTE_IMPL

#define FUZZ_QUOTE_IMPL ( str)
Value:
#str

◆ FUZZ_STATIC

#define FUZZ_STATIC   static

◆ FUZZ_ZASSERT

#define FUZZ_ZASSERT ( code)
Value:
Definition inftrees.h:24
const char * ZSTD_getErrorName(size_t code)
Definition zstd_common.c:41
#define ZSTD_isError
Definition zstd_internal.h:49

◆ MAX

#define MAX ( a,
b )
Value:
((a) > (b) ? (a) : (b))
#define b(i)
Definition sha256.c:42
#define a(i)
Definition sha256.c:41

◆ MIN

#define MIN ( a,
b )
Value:
((a) < (b) ? (a) : (b))

Helper functions for fuzzing.

Function Documentation

◆ FUZZ_malloc()

void * FUZZ_malloc ( size_t size)

malloc except return NULL for zero sized data and FUZZ_ASSERT that malloc doesn't fail.

◆ FUZZ_malloc_rand()

void * FUZZ_malloc_rand ( size_t size,
FUZZ_dataProducer_t * producer )

malloc except returns random pointer for zero sized data and FUZZ_ASSERT that malloc doesn't fail.

◆ FUZZ_memcmp()

int FUZZ_memcmp ( void const * lhs,
void const * rhs,
size_t size )

memcmp but accepts NULL.