#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "qset.h"
#include "mem.h"
Go to the source code of this file.
Defines | |
#define | FOREACHint4_(ints) FOREACHsetelement_( i2T, ints, i4) |
#define | FOREACHint_(ints) FOREACHsetelement_( i2T, ints, i2) |
#define | FOREACHint_i_(ints) FOREACHsetelement_i_( i2T, ints, i2) |
#define | FOREACHintreverse12_(ints) FOREACHsetelementreverse12_( i2T, ints, i2) |
#define | FOREACHintreverse_(ints) FOREACHsetelementreverse_( i2T, ints, i2) |
#define | MAXerrorCount 100 |
#define | qh_MEMalign ((int)(sizeof(void *))) |
#define | qh_MEMbufsize 0x10000 |
#define | qh_MEMinitbuf 0x20000 |
Typedefs | |
typedef int | i2T |
Enumerations | |
enum | { MAXint = 0x7fffffff } |
Functions | |
void | checkSetContents (const char *name, setT *set, int count, int rangeA, int rangeB, int rangeC) |
int | log_i (setT *set, const char *s, int i, int numInts, int checkEvery) |
int | main (int argc, char **argv) |
void | qh_errexit (int exitcode, void *f, void *r) |
void | qh_exit (int exitcode) |
void | qh_fprintf (FILE *fp, int msgcode, const char *fmt,...) |
void | qh_free (void *mem) |
void * | qh_malloc (size_t size) |
void | readOptions (int argc, char **argv, const char *promptstr, int *numInts, int *checkEvery) |
void | setupMemory (int tracelevel, int numInts, int **intarray) |
void | testSetappendSet (int numInts, int *intarray, int checkEvery) |
void | testSetappendSettruncate (int numInts, int *intarray, int checkEvery) |
void | testSetcompactCopy (int numInts, int *intarray, int checkEvery) |
void | testSetdelSetadd (int numInts, int *intarray, int checkEvery) |
void | testSetdelsortedEtc (int numInts, int *intarray, int checkEvery) |
void | testSetequalInEtc (int numInts, int *intarray, int checkEvery) |
void | testSetlastEtc (int numInts, int *intarray, int checkEvery) |
void | testSettemp (int numInts, int *intarray, int checkEvery) |
Variables | |
int | error_count = 0 |
char | prompt [] |
#define FOREACHint4_ | ( | ints | ) | FOREACHsetelement_( i2T, ints, i4) |
Definition at line 82 of file testqset.c.
#define FOREACHint_ | ( | ints | ) | FOREACHsetelement_( i2T, ints, i2) |
Definition at line 81 of file testqset.c.
#define FOREACHint_i_ | ( | ints | ) | FOREACHsetelement_i_( i2T, ints, i2) |
Definition at line 83 of file testqset.c.
#define FOREACHintreverse12_ | ( | ints | ) | FOREACHsetelementreverse12_( i2T, ints, i2) |
Definition at line 85 of file testqset.c.
#define FOREACHintreverse_ | ( | ints | ) | FOREACHsetelementreverse_( i2T, ints, i2) |
Definition at line 84 of file testqset.c.
#define MAXerrorCount 100 |
Definition at line 79 of file testqset.c.
#define qh_MEMalign ((int)(sizeof(void *))) |
Definition at line 102 of file testqset.c.
#define qh_MEMbufsize 0x10000 |
Definition at line 103 of file testqset.c.
#define qh_MEMinitbuf 0x20000 |
Definition at line 104 of file testqset.c.
typedef int i2T |
Definition at line 78 of file testqset.c.
anonymous enum |
Definition at line 87 of file testqset.c.
void checkSetContents | ( | const char * | name, | |
setT * | set, | |||
int | count, | |||
int | rangeA, | |||
int | rangeB, | |||
int | rangeC | |||
) |
Definition at line 733 of file testqset.c.
int log_i | ( | setT * | set, | |
const char * | s, | |||
int | i, | |||
int | numInts, | |||
int | checkEvery | |||
) |
Definition at line 690 of file testqset.c.
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 175 of file testqset.c.
void qh_errexit | ( | int | exitcode, | |
void * | f, | |||
void * | r | |||
) |
Definition at line 123 of file testqset.c.
void qh_exit | ( | int | exitcode | ) |
Definition at line 111 of file testqset.c.
void qh_fprintf | ( | FILE * | fp, | |
int | msgcode, | |||
const char * | fmt, | |||
... | ||||
) |
Definition at line 129 of file testqset.c.
void qh_free | ( | void * | mem | ) |
Definition at line 115 of file testqset.c.
void* qh_malloc | ( | size_t | size | ) |
Definition at line 119 of file testqset.c.
void readOptions | ( | int | argc, | |
char ** | argv, | |||
const char * | promptstr, | |||
int * | numInts, | |||
int * | checkEvery | |||
) |
Definition at line 210 of file testqset.c.
void setupMemory | ( | int | tracelevel, | |
int | numInts, | |||
int ** | intarray | |||
) |
Definition at line 245 of file testqset.c.
void testSetappendSet | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 346 of file testqset.c.
void testSetappendSettruncate | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 272 of file testqset.c.
void testSetcompactCopy | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 384 of file testqset.c.
void testSetdelSetadd | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 320 of file testqset.c.
void testSetdelsortedEtc | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 413 of file testqset.c.
void testSetequalInEtc | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 468 of file testqset.c.
void testSetlastEtc | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 578 of file testqset.c.
void testSettemp | ( | int | numInts, | |
int * | intarray, | |||
int | checkEvery | |||
) |
Definition at line 648 of file testqset.c.
int error_count = 0 |
Definition at line 98 of file testqset.c.
char prompt[] |
"testqset N [M] -- Test qset.c and mem.c\n\ Test qsets of 0..N integers with a check every M iterations (default ~log10)\n\ Additional checking and logging if M is 1\n\ For example:\n\ testqset 10000\n\ "
Definition at line 91 of file testqset.c.