#include <stdio.h>
#include <string.h>
-#if 1
+#if 0
/* TEST 1: integers */
log(L_INFO, "OK");
}
-#elif 0
+#elif 1
/* TEST 2: external strings */
#define HASH_PREFIX(x) test_##x
#define HASH_KEY_STRING key
#define HASH_NOCASE
+#define HASH_AUTO_POOL 4096
#define HASH_WANT_FIND
#define HASH_WANT_NEW
{
char x[32];
sprintf(x, "abc%d", i);
- test_new(stralloc(x));
+ test_new(xstrdup(x));
}
for (i=0; i<1024; i++)
{
log(L_INFO, "OK");
}
-#elif 0
+#elif 1
/* TEST 3: internal strings + pools */
-#include "lib/pools.h"
+#include "lib/mempool.h"
static struct mempool *pool;
pool = mp_new(16384);
test_init();
- for (i=0; i<1024; i+=2)
+ for (i=0; i<1048576; i+=2)
{
char x[32];
sprintf(x, "abc%d", i);
test_new(x);
}
- for (i=0; i<1024; i++)
+ for (i=0; i<1048576; i++)
{
char x[32];
struct node *n;