X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-prioq.c;h=cdb1e4ad52df3768253b957373ff9954b5f7f3ba;hb=c9fdc26e96493175668fbde61a04fc70abff300d;hp=73c640840aa3a6ffb4b4cadf8e94e551e145f99a;hpb=30bdd695250eeecbf0b36c1e3c90d67ca03953ed;p=elogind.git diff --git a/src/test/test-prioq.c b/src/test/test-prioq.c index 73c640840..cdb1e4ad5 100644 --- a/src/test/test-prioq.c +++ b/src/test/test-prioq.c @@ -24,6 +24,7 @@ #include "util.h" #include "set.h" #include "prioq.h" +#include "siphash24.h" #define SET_SIZE 1024*4 @@ -88,10 +89,13 @@ static int test_compare(const void *a, const void *b) { return 0; } -static unsigned test_hash(const void *a) { +static unsigned long test_hash(const void *a, const uint8_t hash_key[HASH_KEY_SIZE]) { const struct test *x = a; + uint64_t u; - return x->value; + siphash24((uint8_t*) &u, &x->value, sizeof(x->value), hash_key); + + return (unsigned long) u; } static void test_struct(void) { @@ -119,7 +123,7 @@ static void test_struct(void) { assert_se(r >= 0); if (i % 4 == 0) { - r = set_put(s, t); + r = set_consume(s, t); assert_se(r >= 0); } }