cudd  3.0.0
The University of Colorado Decision Diagram Package
Data Structures | Typedefs | Functions
testst.c File Reference

Simple test program of the st library. More...

#include "util.h"
#include "st.h"
Include dependency graph for testst.c:

Data Structures

struct  mys
 Just some struct type. More...
 

Typedefs

typedef struct mys mys_t
 Just some struct type.
 

Functions

int main (void)
 Main program. More...
 
static int testString (void)
 Tests a table that stores C strings. More...
 
static int testStruct (void)
 Tests a table that maps user-defined structs to uintptr_t. More...
 
static int testUintPtr (void)
 Tests a table that maps values of type uintptr_t to strings. More...
 
static int testInt (void)
 Tests a table that maps ints to ints. More...
 
static int testArg (void)
 Tests a table of arrays of ints. More...
 
static int mys_cmp (void const *key1, void const *key2)
 Compares two items of type mys_t. More...
 
static int mys_hash (void const *key, int size)
 Hashes one item of type mys_t. More...
 
static enum st_retval mys_accm (void *key, void *value, void *arg)
 Accumulates the values associated to items of type mys_t. More...
 
static int array_cmp (void const *key1, void const *key2, void const *arg)
 Compares two arrays of ints. More...
 
static int array_hash (void const *key, int modulus, void const *arg)
 Hashes one array of ints. More...
 

Detailed Description

Simple test program of the st library.

Function Documentation

static int array_cmp ( void const *  key1,
void const *  key2,
void const *  arg 
)
static

Compares two arrays of ints.

The length of the two arrays is in arg.

Returns
0 if they compare equal and 1 otherwise.
static int array_hash ( void const *  key,
int  modulus,
void const *  arg 
)
static

Hashes one array of ints.

Returns
the hash value.
int main ( void  )

Main program.

Returns
the number of failed tests.

Uses TAP (Test Anything Protocol) to report results.

static enum st_retval mys_accm ( void *  key,
void *  value,
void *  arg 
)
static

Accumulates the values associated to items of type mys_t.

Returns
ST_CONTINUE
static int mys_cmp ( void const *  key1,
void const *  key2 
)
static

Compares two items of type mys_t.

Returns
0 if they compare equal and 1 otherwise.
static int mys_hash ( void const *  key,
int  size 
)
static

Hashes one item of type mys_t.

Returns
the hash value.
static int testArg ( void  )
static

Tests a table of arrays of ints.

Returns
0 if successful; 1 otherwise.
static int testInt ( void  )
static

Tests a table that maps ints to ints.

Returns
0 if successful; the number of errors otherwise.
static int testString ( void  )
static

Tests a table that stores C strings.

Returns
0 if successful; the number of errors otherwise.
static int testStruct ( void  )
static

Tests a table that maps user-defined structs to uintptr_t.

Returns
0 if successful; the number of errors otherwise.
static int testUintPtr ( void  )
static

Tests a table that maps values of type uintptr_t to strings.

Returns
0 if successful; the number of errors otherwise.