Go to the documentation of this file.
57 void *(*Alloc)(
unsigned int),
void (*Free)(
void *))
66 static void *StorageTestAlloc(
unsigned int size)
71 static void StorageTestFree(
void *x)
77 static int IPPairStorageTest01(
void)
95 memset(&a, 0x00,
sizeof(a));
96 memset(&b, 0x00,
sizeof(b));
97 a.addr_data32[0] = 0x01020304;
98 b.addr_data32[0] = 0x04030201;
131 static int IPPairStorageTest02(
void)
144 memset(&a, 0x00,
sizeof(a));
145 memset(&b, 0x00,
sizeof(b));
146 a.addr_data32[0] = 0x01020304;
147 b.addr_data32[0] = 0x04030201;
170 static int IPPairStorageTest03(
void)
187 memset(&a, 0x00,
sizeof(a));
188 memset(&b, 0x00,
sizeof(b));
189 a.addr_data32[0] = 0x01020304;
190 b.addr_data32[0] = 0x04030201;
IPPairStorageId IPPairStorageRegister(const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
void StorageFreeAll(Storage *storage, StorageEnum type)
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
void IPPairInitConfig(bool quiet)
initialize the configuration
void IPPairRelease(IPPair *h)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
void StorageCleanup(void)
int IPPairSetStorageById(IPPair *h, IPPairStorageId id, void *ptr)
unsigned int IPPairStorageSize(void)
void IPPairShutdown(void)
shutdown the flow engine
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
#define PASS
Pass the test.
IPPair * IPPairGetIPPairFromHash(Address *a, Address *b)
void * IPPairAllocStorageById(IPPair *h, IPPairStorageId id)
int StorageFinalize(void)
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
void RegisterIPPairStorageTests(void)
int StorageSetById(Storage *storage, const StorageEnum type, const int id, void *ptr)
set storage for id
void * StorageAllocByIdPrealloc(Storage *storage, StorageEnum type, int id)
AllocById func for prealloc'd base storage (storage ptrs are part of another memory block)
void * IPPairGetStorageById(IPPair *h, IPPairStorageId id)
void IPPairFreeStorage(IPPair *h)
void * StorageGetById(const Storage *storage, const StorageEnum type, const int id)
get storage for id
unsigned int StorageGetSize(StorageEnum type)
get the size of the void array used to store the pointers
int StorageRegister(const StorageEnum type, const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
Register new storage.