#include "hindex.h"
#include <string.h>
#include "hash.h"
+#include "random.h"
#include "util.h"
#undef NDEBUG
shuffle(int *p, size_t n)
{
for (; n > 1; n--, p++) {
- int *q = &p[rand() % n];
+ int *q = &p[random_range(n)];
int tmp = *p;
*p = *q;
*q = tmp;
return value % 2;
}
+static size_t
+multipart_hash(int value)
+{
+ return (mod4_hash(value) << 16) | (constant_hash(value) & 0xFFFF);
+}
+
/* Tests basic hindex insertion and deletion. */
static void
test_hindex_insert_delete(hash_func *hash)
mod4_hash,
mod3_hash,
mod2_hash,
+ multipart_hash,
};
size_t i;