tests/testhashkit
tests/testplus
tests/udptest
+tests/hashplus
+patch
+patch2
* the COPYING file in the parent directory for full text.
*/
-/**
- * @file
- * @brief System Include Files
- */
-
#ifndef HASHKIT_COMMON_H
#define HASHKIT_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "config.h"
#include <assert.h>
HASHKIT_LOCAL
int update_continuum(hashkit_st *hashkit);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HASHKIT_COMMON_H */
--- /dev/null
+/* HashKit
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ */
+
+#include "common.h"
+
+uint32_t hashkit_digest(const hashkit_st *self, const char *key, size_t key_length)
+{
+ return self->base_hash.function(key, key_length, self->base_hash.context);
+}
+
+uint32_t libhashkit_digest(const char *key, size_t key_length, hashkit_hash_algorithm_t hash_algorithm)
+{
+ switch (hash_algorithm)
+ {
+ case HASHKIT_HASH_DEFAULT:
+ return libhashkit_one_at_a_time(key, key_length);
+ case HASHKIT_HASH_MD5:
+ return libhashkit_md5(key, key_length);
+ case HASHKIT_HASH_CRC:
+ return libhashkit_crc32(key, key_length);
+ case HASHKIT_HASH_FNV1_64:
+ return libhashkit_fnv1_64(key, key_length);
+ case HASHKIT_HASH_FNV1A_64:
+ return libhashkit_fnv1a_64(key, key_length);
+ case HASHKIT_HASH_FNV1_32:
+ return libhashkit_fnv1_32(key, key_length);
+ case HASHKIT_HASH_FNV1A_32:
+ return libhashkit_fnv1a_32(key, key_length);
+ case HASHKIT_HASH_HSIEH:
+#ifdef HAVE_HSIEH_HASH
+ return libhashkit_hsieh(key, key_length);
+#else
+ return 1;
+#endif
+ case HASHKIT_HASH_MURMUR:
+ return libhashkit_murmur(key, key_length);
+ case HASHKIT_HASH_JENKINS:
+ return libhashkit_jenkins(key, key_length);
+ case HASHKIT_HASH_CUSTOM:
+ case HASHKIT_HASH_MAX:
+ default:
+#ifdef HAVE_DEBUG
+ fprintf(stderr, "hashkit_hash_t was extended but libhashkit_generate_value was not updated\n");
+ fflush(stderr);
+ assert(0);
+#endif
+ break;
+ }
+
+ return 1;
+}
--- /dev/null
+/* HashKit
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ */
+
+#ifndef HASHKIT_DIGEST_H
+#define HASHKIT_DIGEST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HASHKIT_API
+uint32_t hashkit_digest(const hashkit_st *self, const char *key, size_t key_length);
+
+/**
+ This is a utilitly function provided so that you can directly access hashes with a hashkit_st.
+*/
+
+HASHKIT_API
+uint32_t libhashkit_digest(const char *key, size_t key_length, hashkit_hash_algorithm_t hash_algorithm);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HASHKIT_DIGEST_H */
#include "common.h"
-uint32_t hashkit_generate_value(const hashkit_st *self, const char *key, size_t key_length)
-{
- return self->base_hash.function(key, key_length, self->base_hash.context);
-}
-
static hashkit_return_t _set_function(struct hashkit_function_st *self, hashkit_hash_algorithm_t hash_algorithm)
{
switch (hash_algorithm)
{
return get_function_type(self->distribution_hash.function);
}
-
-uint32_t libhashkit_generate_value(const char *key, size_t key_length, hashkit_hash_algorithm_t hash_algorithm)
-{
- switch (hash_algorithm)
- {
- case HASHKIT_HASH_DEFAULT:
- return libhashkit_one_at_a_time(key, key_length);
- case HASHKIT_HASH_MD5:
- return libhashkit_md5(key, key_length);
- case HASHKIT_HASH_CRC:
- return libhashkit_crc32(key, key_length);
- case HASHKIT_HASH_FNV1_64:
- return libhashkit_fnv1_64(key, key_length);
- case HASHKIT_HASH_FNV1A_64:
- return libhashkit_fnv1a_64(key, key_length);
- case HASHKIT_HASH_FNV1_32:
- return libhashkit_fnv1_32(key, key_length);
- case HASHKIT_HASH_FNV1A_32:
- return libhashkit_fnv1a_32(key, key_length);
- case HASHKIT_HASH_HSIEH:
-#ifdef HAVE_HSIEH_HASH
- return libhashkit_hsieh(key, key_length);
-#else
- return 1;
-#endif
- case HASHKIT_HASH_MURMUR:
- return libhashkit_murmur(key, key_length);
- case HASHKIT_HASH_JENKINS:
- return libhashkit_jenkins(key, key_length);
- case HASHKIT_HASH_CUSTOM:
- case HASHKIT_HASH_MAX:
- default:
-#ifdef HAVE_DEBUG
- fprintf(stderr, "hashkit_hash_t was extended but libhashkit_generate_value was not updated\n");
- fflush(stderr);
- assert(0);
-#endif
- break;
- }
-
- return 1;
-}
extern "C" {
#endif
-HASHKIT_API
-uint32_t hashkit_generate_value(const hashkit_st *self, const char *key, size_t key_length);
-
/**
This sets/gets the default function we will be using.
*/
HASHKIT_API
hashkit_hash_algorithm_t hashkit_get_distribution_function(const hashkit_st *self);
-/**
- This is a utilitly function provided so that you can directly access hashes with a hashkit_st.
-*/
-
-HASHKIT_API
-uint32_t libhashkit_generate_value(const char *key, size_t key_length, hashkit_hash_algorithm_t hash_algorithm);
-
#ifdef __cplusplus
}
#endif
return false;
}
+
+#ifdef __cplusplus
+hashkit_st operator=(const hashkit_st& source)
+{
+ hashkit_clone(this, &source);
+
+ return *this;
+}
+#endif
/* HashKit
- * Copyright (C) 2009 Brian Aker
+ * Copyright (C) 2009-2010 Brian Aker
* All rights reserved.
*
* Use and distribution licensed under the BSD license. See
#ifndef HASHKIT_H
#define HASHKIT_H
+
#if !defined(__cplusplus)
# include <stdbool.h>
#endif
#include <libhashkit/types.h>
#include <libhashkit/algorithm.h>
#include <libhashkit/behavior.h>
+#include <libhashkit/digest.h>
#include <libhashkit/function.h>
#include <libhashkit/strerror.h>
#ifdef __cplusplus
+
+#include <string>
+
extern "C" {
#endif
+HASHKIT_API
+hashkit_st *hashkit_create(hashkit_st *hash);
+
+HASHKIT_API
+hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
+
+HASHKIT_API
+bool hashkit_compare(const hashkit_st *first, const hashkit_st *second);
+
+HASHKIT_API
+void hashkit_free(hashkit_st *hash);
+
+#define hashkit_is_allocated(__object) ((__object)->options.is_allocated)
+#define hashkit_is_initialized(__object) ((__object)->options.is_initialized)
+
struct hashkit_st
{
struct hashkit_function_st {
struct {
bool is_allocated:1;
} options;
-};
-HASHKIT_API
-hashkit_st *hashkit_create(hashkit_st *hash);
+#ifdef __cplusplus
-HASHKIT_API
-hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
+ hashkit_st() :
+ base_hash(),
+ distribution_hash(),
+ flags(),
+ options()
+ {
+ hashkit_create(this);
+ }
-HASHKIT_API
-bool hashkit_compare(const hashkit_st *first, const hashkit_st *second);
+ hashkit_st(const hashkit_st& source) :
+ base_hash(),
+ distribution_hash(),
+ flags(),
+ options()
+ {
+ hashkit_clone(this, &source);
+ }
-HASHKIT_API
-void hashkit_free(hashkit_st *hash);
+ hashkit_st& operator=(const hashkit_st& source)
+ {
+ hashkit_clone(this, &source);
-#define hashkit_is_allocated(__object) ((__object)->options.is_allocated)
-#define hashkit_is_initialized(__object) ((__object)->options.is_initialized)
+ return *this;
+ }
+
+ friend bool operator==(const hashkit_st &left, const hashkit_st &right)
+ {
+ return hashkit_compare(&left, &right);
+ }
+
+ uint32_t digest(std::string& str)
+ {
+ return hashkit_digest(this, str.c_str(), str.length());
+ }
+
+ uint32_t digest(const char *key, size_t key_length)
+ {
+ return hashkit_digest(this, key, key_length);
+ }
+
+ hashkit_return_t set_function(hashkit_hash_algorithm_t hash_algorithm)
+ {
+ return hashkit_set_function(this, hash_algorithm);
+ }
-/** @} */
+ hashkit_return_t set_distribution_function(hashkit_hash_algorithm_t hash_algorithm)
+ {
+ return hashkit_set_function(this, hash_algorithm);
+ }
+
+ ~hashkit_st()
+ {
+ hashkit_free(this);
+ }
+#endif
+};
#ifdef __cplusplus
-}
+} // extern "C"
#endif
+
#endif /* HASHKIT_H */
lib_LTLIBRARIES+= libhashkit/libhashkit.la
nobase_include_HEADERS+= \
- libhashkit/algorithm.h \
- libhashkit/behavior.h \
- libhashkit/function.h \
- libhashkit/hashkit.h \
- libhashkit/strerror.h \
- libhashkit/types.h \
- libhashkit/visibility.h
+ libhashkit/algorithm.h \
+ libhashkit/behavior.h \
+ libhashkit/digest.h \
+ libhashkit/function.h \
+ libhashkit/hashkit.h \
+ libhashkit/strerror.h \
+ libhashkit/types.h \
+ libhashkit/visibility.h
noinst_HEADERS+= \
libhashkit/common.h
libhashkit/behavior.c \
libhashkit/crc32.c \
libhashkit/fnv.c \
+ libhashkit/digest.c \
libhashkit/function.c \
libhashkit/hashkit.c \
libhashkit/jenkins.c \
#define HASHKIT_TYPES_H
#ifdef __cplusplus
+
+typedef struct hashkit_st Hashkit;
+
extern "C" {
#endif
typedef struct hashkit_st hashkit_st;
+
typedef uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, void *context);
#ifdef __cplusplus
uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm)
{
- return libhashkit_generate_value(key, key_length, (hashkit_hash_algorithm_t)hash_algorithm);
+ return libhashkit_digest(key, key_length, (hashkit_hash_algorithm_t)hash_algorithm);
}
uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length)
if (memcached_server_count(ptr) == 1)
return 0;
- hash= hashkit_generate_value(&ptr->hashkit, key, key_length);
+ hash= hashkit_digest(&ptr->hashkit, key, key_length);
WATCHPOINT_ASSERT(hash);
return hash;
}
else
{
- value= hashkit_generate_value(&ptr->distribution_hashkit, sort_host, sort_host_length);
+ value= hashkit_digest(&ptr->distribution_hashkit, sort_host, sort_host_length);
ptr->continuum[continuum_index].index= host_index;
ptr->continuum[continuum_index++].value= value;
}
}
else
{
- value= hashkit_generate_value(&ptr->distribution_hashkit, sort_host, sort_host_length);
+ value= hashkit_digest(&ptr->distribution_hashkit, sort_host, sort_host_length);
ptr->continuum[continuum_index].index= host_index;
ptr->continuum[continuum_index++].value= value;
}
If source is NULL the call is the same as if a memcached_create() was
called.
*/
-memcached_st *memcached_clone(memcached_st *clone, memcached_st *source)
+memcached_st *memcached_clone(memcached_st *clone, const memcached_st *source)
{
memcached_return_t rc= MEMCACHED_SUCCESS;
memcached_st *new_clone;
}
if (source->on_clone)
- source->on_clone(source, new_clone);
+ source->on_clone(new_clone, source);
return new_clone;
}
extern "C" {
#endif
+LIBMEMCACHED_API
+void memcached_servers_reset(memcached_st *ptr);
+
+LIBMEMCACHED_API
+memcached_st *memcached_create(memcached_st *ptr);
+
+LIBMEMCACHED_API
+void memcached_free(memcached_st *ptr);
+
+LIBMEMCACHED_API
+memcached_st *memcached_clone(memcached_st *clone, const memcached_st *ptr);
+
+LIBMEMCACHED_API
+void *memcached_get_user_data(const memcached_st *ptr);
+
+LIBMEMCACHED_API
+void *memcached_set_user_data(memcached_st *ptr, void *data);
+
+
struct memcached_st {
/**
@note these are static and should not change without a call to behavior.
struct {
bool is_allocated:1;
} options;
-};
-LIBMEMCACHED_API
-void memcached_servers_reset(memcached_st *ptr);
+#ifdef __cplusplus
+ memcached_st() :
+ state(),
+ flags(),
+ distribution(),
+ hashkit(),
+ continuum_points_counter(),
+ number_of_hosts(),
+ servers(),
+ last_disconnected_server(),
+ snd_timeout(),
+ rcv_timeout(),
+ server_failure_limit(),
+ io_msg_watermark(),
+ io_bytes_watermark(),
+ io_key_prefetch(),
+ cached_errno(),
+ poll_timeout(),
+ connect_timeout(),
+ retry_timeout(),
+ continuum_count(),
+ send_size(),
+ recv_size(),
+ user_data(),
+ next_distribution_rebuild(),
+ prefix_key_length(),
+ number_of_replicas(),
+ distribution_hashkit(),
+ result(),
+ continuum(),
+ allocators(),
+ on_clone(),
+ on_cleanup(),
+ get_key_failure(),
+ delete_trigger(),
+ callbacks(),
+ prefix_key(),
+ options()
+ {
+ memcached_create(this);
+ }
-/* Public API */
+ ~memcached_st()
+ {
+ memcached_free(this);
+ }
-LIBMEMCACHED_API
-memcached_st *memcached_create(memcached_st *ptr);
+ memcached_st(const memcached_st& source) :
+ state(),
+ flags(),
+ distribution(),
+ hashkit(),
+ continuum_points_counter(),
+ number_of_hosts(),
+ servers(),
+ last_disconnected_server(),
+ snd_timeout(),
+ rcv_timeout(),
+ server_failure_limit(),
+ io_msg_watermark(),
+ io_bytes_watermark(),
+ io_key_prefetch(),
+ cached_errno(),
+ poll_timeout(),
+ connect_timeout(),
+ retry_timeout(),
+ continuum_count(),
+ send_size(),
+ recv_size(),
+ user_data(),
+ next_distribution_rebuild(),
+ prefix_key_length(),
+ number_of_replicas(),
+ distribution_hashkit(),
+ result(),
+ continuum(),
+ allocators(),
+ on_clone(),
+ on_cleanup(),
+ get_key_failure(),
+ delete_trigger(),
+ callbacks(),
+ prefix_key(),
+ options()
+ {
+ memcached_clone(this, &source);
+ }
-LIBMEMCACHED_API
-void memcached_free(memcached_st *ptr);
+ memcached_st& operator=(const memcached_st& source)
+ {
+ memcached_clone(this, &source);
-LIBMEMCACHED_API
-memcached_st *memcached_clone(memcached_st *clone, memcached_st *ptr);
+ return *this;
+ }
-LIBMEMCACHED_API
-void *memcached_get_user_data(const memcached_st *ptr);
-
-LIBMEMCACHED_API
-void *memcached_set_user_data(memcached_st *ptr, void *data);
+#endif
+};
// Local Only Inline
static inline memcached_server_st *memcached_server_instance_fetch(memcached_st *ptr, uint32_t server_key)
#ifdef __cplusplus
-}
+} // extern "C"
#endif
typedef struct memcached_server_st memcached_server_st;
typedef struct memcached_continuum_item_st memcached_continuum_item_st;
-typedef memcached_return_t (*memcached_clone_fn)(memcached_st *parent, memcached_st *clone);
+typedef memcached_return_t (*memcached_clone_fn)(memcached_st *destination, const memcached_st *source);
typedef memcached_return_t (*memcached_cleanup_fn)(const memcached_st *ptr);
/**
--- /dev/null
+/*
+ C++ to libhashkit
+*/
+#include "test.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <libhashkit/hashkit.h>
+
+#include "hash_results.h"
+
+static test_return_t exists_test(void *obj __attribute__((unused)))
+{
+ Hashkit hashk;
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t new_test(void *obj __attribute__((unused)))
+{
+ Hashkit *hashk= new Hashkit;
+
+ (void)hashk;
+
+ delete hashk;
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t copy_test(void *obj __attribute__((unused)))
+{
+ Hashkit *hashk= new Hashkit;
+ Hashkit *copy(hashk);
+
+ (void)copy;
+
+ delete hashk;
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t assign_test(void *obj __attribute__((unused)))
+{
+ Hashkit hashk;
+ Hashkit copy;
+
+ copy= hashk;
+
+ (void)copy;
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t digest_test(void *obj __attribute__((unused)))
+{
+ Hashkit hashk;
+ uint32_t value;
+
+ value= hashk.digest("Foo", sizeof("Foo"));
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t set_function_test(void *obj __attribute__((unused)))
+{
+ Hashkit hashk;
+ hashkit_hash_algorithm_t algo_list[]= {
+ HASHKIT_HASH_DEFAULT,
+ HASHKIT_HASH_MD5,
+ HASHKIT_HASH_CRC,
+ HASHKIT_HASH_FNV1_64,
+ HASHKIT_HASH_FNV1A_64,
+ HASHKIT_HASH_FNV1_32,
+ HASHKIT_HASH_FNV1A_32,
+ HASHKIT_HASH_MURMUR,
+ HASHKIT_HASH_JENKINS,
+ HASHKIT_HASH_MAX
+ };
+ hashkit_hash_algorithm_t *algo;
+
+
+ for (algo= algo_list; *algo != HASHKIT_HASH_MAX; algo++)
+ {
+ hashkit_return_t rc;
+ uint32_t x;
+ const char **ptr;
+ uint32_t *list;
+
+ rc= hashk.set_function(*algo);
+
+ test_true(rc == HASHKIT_SUCCESS);
+
+ switch (*algo)
+ {
+ case HASHKIT_HASH_DEFAULT:
+ list= one_at_a_time_values;
+ break;
+ case HASHKIT_HASH_MD5:
+ list= md5_values;
+ break;
+ case HASHKIT_HASH_CRC:
+ list= crc_values;
+ break;
+ case HASHKIT_HASH_FNV1_64:
+ list= fnv1_64_values;
+ break;
+ case HASHKIT_HASH_FNV1A_64:
+ list= fnv1a_64_values;
+ break;
+ case HASHKIT_HASH_FNV1_32:
+ list= fnv1_32_values;
+ break;
+ case HASHKIT_HASH_FNV1A_32:
+ list= fnv1a_32_values;
+ break;
+ case HASHKIT_HASH_HSIEH:
+ list= hsieh_values;
+ break;
+ case HASHKIT_HASH_MURMUR:
+ list= murmur_values;
+ break;
+ case HASHKIT_HASH_JENKINS:
+ list= jenkins_values;
+ break;
+ case HASHKIT_HASH_CUSTOM:
+ case HASHKIT_HASH_MAX:
+ default:
+ list= NULL;
+ test_fail("We ended up on a non-existent hash");
+ }
+
+ // Now we make sure we did set the hash correctly.
+ for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
+ {
+ uint32_t hash_val;
+
+ hash_val= hashk.digest(*ptr, strlen(*ptr));
+ test_true(list[x] == hash_val);
+ }
+ }
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t set_distribution_function_test(void *obj __attribute__((unused)))
+{
+ Hashkit hashk;
+ hashkit_return_t rc;
+
+ rc= hashk.set_distribution_function(HASHKIT_HASH_CUSTOM);
+ test_true(rc == HASHKIT_FAILURE);
+
+ rc= hashk.set_distribution_function(HASHKIT_HASH_JENKINS);
+ test_true(rc == HASHKIT_SUCCESS);
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t compare_function_test(void *obj __attribute__((unused)))
+{
+ Hashkit a, b;
+
+ b= a;
+
+ test_true(a == b);
+
+ b.set_function(HASHKIT_HASH_MURMUR);
+
+ test_false(a == b);
+ test_true(b == b);
+ test_true(a == a);
+
+ return TEST_SUCCESS;
+}
+
+test_st basic[] ={
+ { "exists", 0, exists_test },
+ { "new", 0, new_test },
+ { "copy", 0, copy_test },
+ { "assign", 0, assign_test },
+ { "digest", 0, digest_test },
+ { "set_function", 0, set_function_test },
+ { "set_distribution_function", 0, set_distribution_function_test },
+ { "compare", 0, compare_function_test },
+ { 0, 0, 0}
+};
+
+collection_st collection[] ={
+ {"basic", 0, 0, basic},
+ {0, 0, 0, 0}
+};
+
+void get_world(world_st *world)
+{
+ world->collections= collection;
+}
{0, 0, 0}
};
-static test_return_t hashkit_generate_value_test(hashkit_st *hashk)
+static test_return_t hashkit_digest_test(hashkit_st *hashk)
{
uint32_t value;
- value= hashkit_generate_value(hashk, "a", sizeof("a"));
+ value= hashkit_digest(hashk, "a", sizeof("a"));
return TEST_SUCCESS;
}
{
uint32_t hash_val;
- hash_val= hashkit_generate_value(hashk, *ptr, strlen(*ptr));
+ hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr));
test_true(list[x] == hash_val);
}
}
{
uint32_t hash_val;
- hash_val= hashkit_generate_value(hashk, *ptr, strlen(*ptr));
+ hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr));
test_true(md5_values[x] == hash_val);
}
}
test_st hashkit_st_functions[] ={
- {"hashkit_generate_value", 0, (test_callback_fn)hashkit_generate_value_test},
+ {"hashkit_digest", 0, (test_callback_fn)hashkit_digest_test},
{"hashkit_set_function", 0, (test_callback_fn)hashkit_set_function_test},
{"hashkit_set_custom_function", 0, (test_callback_fn)hashkit_set_custom_function_test},
{"hashkit_get_function", 0, (test_callback_fn)hashkit_get_function_test},
{0, 0, 0}
};
-static test_return_t libhashkit_generate_value_test(hashkit_st *hashk)
+static test_return_t libhashkit_digest_test(hashkit_st *hashk)
{
uint32_t value;
(void)hashk;
- value= libhashkit_generate_value("a", sizeof("a"), HASHKIT_HASH_DEFAULT);
+ value= libhashkit_digest("a", sizeof("a"), HASHKIT_HASH_DEFAULT);
return TEST_SUCCESS;
}
test_st library_functions[] ={
- {"libhashkit_generate_value", 0, (test_callback_fn)libhashkit_generate_value_test},
+ {"libhashkit_digest", 0, (test_callback_fn)libhashkit_digest_test},
{0, 0, 0}
};
noinst_PROGRAMS+= \
tests/atomsmasher \
+ tests/hashplus \
tests/startservers \
tests/testapp \
tests/testhashkit \
tests_testhashkit_LDADD = tests/libtest.la libhashkit/libhashkit.la
tests_testhashkit_DEPENDENCIES = $(tests_testhashkit_LDADD)
+tests_hashplus_SOURCES = tests/hash_plus.cc
+tests_hashplus_LDADD = $(tests_testhashkit_LDADD)
+tests_hashplus_DEPENDENCIES = $(tests_testhashkit_LDADD)
+
test: test-docs test-mem test-hash memcapable
echo "Tests completed"
MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
-PLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
+MEMPLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
+
+HASHPLUS_COMMAND= tests/hashplus $(COLLECTION) $(SUITE)
ATOM_COMMAND= tests/atomsmasher $(COLLECTION) $(SUITE)
$(ATOM_COMMAND)
test-plus: tests/testplus
- $(PLUS_COMMAND)
+ $(MEMPLUS_COMMAND)
test-hash: tests/testhashkit
$(HASH_COMMAND)
+test-hashplus: tests/hashplus
+ $(HASHPLUS_COMMAND)
+
pahole-mem: tests/testapp
$(PAHOLE_COMMAND) $(MEM_COMMAND)
-
gdb-mem: tests/testapp
$(DEBUG_COMMAND) $(MEM_COMMAND)
$(DEBUG_COMMAND) $(ATOM_COMMAND)
gdb-plus: tests/testplus
- $(DEBUG_COMMAND) $(PLUS_COMMAND)
+ $(DEBUG_COMMAND) $(MEMPLUS_COMMAND)
gdb-hash: tests/testhashkit
$(DEBUG_COMMAND) $(HASH_COMMAND)
+gdb-hashplus: tests/hashplus
+ $(DEBUG_COMMAND) $(HASHPLUS_COMMAND)
+
gdb-memslap: clients/memslap
$(DEBUG_COMMAND) $(MEMSLAP_COMMAND)
$(VALGRIND_COMMAND) $(ATOM_COMMAND)
valgrind-plus: tests/testplus
- $(VALGRIND_COMMAND) $(PLUS_COMMAND)
+ $(VALGRIND_COMMAND) $(MEMPLUS_COMMAND)
valgrind-hash: tests/testhashkit
$(VALGRIND_COMMAND) $(HASH_COMMAND)
+valgrind-hashplus: tests/hashplus
+ $(VALGRIND_COMMAND) $(HASHPLUS_COMMAND)
+
valgrind-memslap: clients/memslap
$(VALGRIND_COMMAND) $(MEMSLAP_COMMAND)