diff options
author | Stef Walter <stefw@gnome.org> | 2013-04-02 16:33:24 +0200 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-04-03 15:48:29 +0200 |
commit | 032fbd8806333bdaf0201cfd9d7bcaac8ec75184 (patch) | |
tree | 34030297398a803bb760252a8896334085e188d9 /common/tests | |
parent | 8c69e467527c5ee484c9a921e9b5fd18c0c49b12 (diff) |
Update to MurmurHash3
This should also fix problems with accessing memory in a non-aligned
fashion on platforms where this causes problems.
https://bugs.freedesktop.org/show_bug.cgi?id=62819
Diffstat (limited to 'common/tests')
-rw-r--r-- | common/tests/test-hash.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/common/tests/test-hash.c b/common/tests/test-hash.c index a1cb917..eecf09b 100644 --- a/common/tests/test-hash.c +++ b/common/tests/test-hash.c @@ -137,14 +137,14 @@ test_murmur2 (CuTest *cu) { uint32_t one, two, four, seven, eleven, split; - assert (sizeof (one) == P11_HASH_MURMUR2_LEN); + assert (sizeof (one) == P11_HASH_MURMUR3_LEN); - p11_hash_murmur2 ((unsigned char *)&one, "one", 3, NULL); - p11_hash_murmur2 ((unsigned char *)&two, "two", 3, NULL); - p11_hash_murmur2 ((unsigned char *)&four, "four", 4, NULL); - p11_hash_murmur2 ((unsigned char *)&seven, "seven", 5, NULL); - p11_hash_murmur2 ((unsigned char *)&eleven, "eleven", 6, NULL); - p11_hash_murmur2 ((unsigned char *)&split, "ele", 3, "ven", 3, NULL); + p11_hash_murmur3 ((unsigned char *)&one, "one", 3, NULL); + p11_hash_murmur3 ((unsigned char *)&two, "two", 3, NULL); + p11_hash_murmur3 ((unsigned char *)&four, "four", 4, NULL); + p11_hash_murmur3 ((unsigned char *)&seven, "seven", 5, NULL); + p11_hash_murmur3 ((unsigned char *)&eleven, "eleven", 6, NULL); + p11_hash_murmur3 ((unsigned char *)&split, "ele", 3, "ven", 3, NULL); CuAssertTrue (cu, one != two); CuAssertTrue (cu, one != four); @@ -166,11 +166,11 @@ test_murmur2_incr (CuTest *cu) { uint32_t first, second; - p11_hash_murmur2 ((unsigned char *)&first, + p11_hash_murmur3 ((unsigned char *)&first, "this is the long input!", (size_t)23, NULL); - p11_hash_murmur2 ((unsigned char *)&second, + p11_hash_murmur3 ((unsigned char *)&second, "this", (size_t)4, " ", (size_t)1, "is ", (size_t)3, |