* the COPYING file in the parent directory for full text.
*/
+#include "config.h"
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
static test_return_t murmur_run (hashkit_st *hashk __attribute__((unused)))
{
-#ifdef __sparc
+#ifdef WORDS_BIGENDIAN
return TEST_SKIPPED;
#else
uint32_t x;
case HASHKIT_HASH_MAX:
default:
list= NULL;
- test_fail("We ended up on a non-existent hash");
+ break;
}
// Now we make sure we did set the hash correctly.
- for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
+ if (list)
{
- uint32_t hash_val;
+ for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
+ {
+ uint32_t hash_val;
- hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr));
- test_true(list[x] == hash_val);
+ hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr));
+ test_true(list[x] == hash_val);
+ }
+ }
+ else
+ {
+ return TEST_FAILURE;
}
}
clone= hashkit_clone(NULL, hashk);
test_true(hashkit_compare(clone, hashk));
+ hashkit_free(clone);
return TEST_SUCCESS;
}