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

Detailed Description

Simple test program of the st library.

Copyright (c) 2015, Regents of the University of Colorado

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


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.
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 31 Dec 2015 for cudd by  doxygen 1.6.1