X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_urcu_hash.h;h=47b2ae3ea5f3523c06a5a67fb835b823ebe78fcf;hb=014775106c60f02818ca755b331f887030bd440f;hp=023ae1c4a06fe4aeb24338e59bd11a905cdabd9a;hpb=447c9339d4f21fe5bba1aa77eccc9f94745e6447;p=urcu.git diff --git a/tests/benchmark/test_urcu_hash.h b/tests/benchmark/test_urcu_hash.h index 023ae1c..47b2ae3 100644 --- a/tests/benchmark/test_urcu_hash.h +++ b/tests/benchmark/test_urcu_hash.h @@ -31,13 +31,12 @@ #include #include #include -#include #include #include +#include #include #include -#include "cpuset.h" #include "thread-id.h" #include "../common/debug-yield.h" @@ -249,10 +248,11 @@ uint32_t hash_u32( /*----------------------------------- handle the last 3 uint32_t's */ switch (length) { /* all the case statements fall through */ - case 3: c += k[2]; - case 2: b += k[1]; + case 3: c += k[2]; /* fall through */ + case 2: b += k[1]; /* fall through */ case 1: a += k[0]; final(a, b, c); + /* fall through */ case 0: /* case 0: nothing left to add */ break; } @@ -304,7 +304,7 @@ unsigned long test_hash_mix(const void *_key, size_t length, unsigned long seed) { unsigned int key = (unsigned int) _key; - assert(length == sizeof(unsigned int)); + urcu_posix_assert(length == sizeof(unsigned int)); return hash_u32(&key, 1, seed); } #else @@ -320,7 +320,7 @@ unsigned long test_hash_mix(const void *_key, size_t length, unsigned long seed) uint32_t v32[2]; } key; - assert(length == sizeof(unsigned long)); + urcu_posix_assert(length == sizeof(unsigned long)); v.v64 = (uint64_t) seed; key.v64 = (uint64_t) _key; hashword2(key.v32, 2, &v.v32[0], &v.v32[1]); @@ -345,7 +345,7 @@ unsigned long test_hash(const void *_key, size_t length, } else { unsigned long v; - assert(length == sizeof(unsigned long)); + urcu_posix_assert(length == sizeof(unsigned long)); v = (unsigned long) _key; return v % nr_hash_chains; } @@ -367,7 +367,7 @@ static inline void cds_lfht_test_lookup(struct cds_lfht *ht, void *key, size_t key_len, struct cds_lfht_iter *iter) { - assert(key_len == sizeof(unsigned long)); + urcu_posix_assert(key_len == sizeof(unsigned long)); cds_lfht_lookup(ht, test_hash(key, key_len, TEST_HASH_SEED), test_match, key, iter);