xdrpp
RFC4506 XDR compiler and message library
Classes | Namespaces | Macros
autocheck.h File Reference

Support for using the autocheck framework with XDR data types. More...

#include <autocheck/autocheck.hpp>
#include <xdrpp/types.h>
Include dependency graph for autocheck.h:

Go to the source code of this file.

Classes

struct  xdr::generator_t
 

Namespaces

 xdr
 Most of the xdrpp library is encapsulated in the xdr namespace.
 

Macros

#define XDR_AUTOCHECK_FUZZY_STRINGS   1
 

Detailed Description

Support for using the autocheck framework with XDR data types.

If you include this file (which requires the autocheck headers to be available), you can generate arbitrary instances of XDR types for testing your application. For example:

// g will generate arbitrary values of type my_xdr_type
autocheck::generator<my_xdr_type> g;
// For variable size objects (vectors, strings, linked lists),
// size indicates how big to make them. For numeric values,
// size affects how big the number is likely to be.
size_t size = 50;
my_xdr_type arbitrary_value = g(object_size);
fuzz_with(arbitrary_value);

Definition in file autocheck.h.