@@ -42,6 +42,19 @@ static void test_hash_algorithms(void) {
4242 /* refer to libmemcached tests/hash_results.h */
4343 expect_same_uint32_t (2297466611U , hash_one_at_a_time ("apple" , 5 ), "should have expected one_at_a_time hash for key \"apple\"" );
4444 expect_same_uint32_t (3195025439U , hash_md5 ("apple" , 5 ), "should have expected md5 hash for key \"apple\"" );
45+
46+ expect_same_uint32_t (3662830516U , hash_crc16 ("apple" , 5 ), "should have expected crc16 hash for key \"apple\"" );
47+ expect_same_uint32_t (10542U , hash_crc32 ("apple" , 5 ), "should have expected crc32 hash for key \"apple\"" );
48+ expect_same_uint32_t (2838417488U , hash_crc32a ("apple" , 5 ), "should have expected crc32a hash for key \"apple\"" );
49+ expect_same_uint32_t (67176023U , hash_fnv1_32 ("apple" , 5 ), "should have expected fnv1_32 hash for key \"apple\"" );
50+ expect_same_uint32_t (280767167U , hash_fnv1a_32 ("apple" , 5 ), "should have expected fnv1a_32 hash for key \"apple\"" );
51+ expect_same_uint32_t (473199127U , hash_fnv1_64 ("apple" , 5 ), "should have expected fnv1_64 hash for key \"apple\"" );
52+ expect_same_uint32_t (1488911807U , hash_fnv1a_64 ("apple" , 5 ), "should have expected fnv1a_64 hash for key \"apple\"" );
53+ expect_same_uint32_t (3738850110U , hash_hsieh ("apple" , 5 ), "should have expected hsieh hash for key \"apple\"" );
54+ expect_same_uint32_t (1442444624U , hash_jenkins ("apple" , 5 ), "should have expected jenkins hash for key \"apple\"" );
55+ expect_same_uint32_t (4142305122U , hash_murmur ("apple" , 5 ), "should have expected murmur hash for key \"apple\"" );
56+ /* The above have exactly the same result as libmemcached/tests/hash_results.h */
57+
4558 expect_same_uint32_t (3853726576U , ketama_hash ("server1-8" , strlen ("server1-8" ), 0 ), "should have expected ketama_hash for server1-8 index 0" );
4659 expect_same_uint32_t (2667054752U , ketama_hash ("server1-8" , strlen ("server1-8" ), 3 ), "should have expected ketama_hash for server1-8 index 3" );
4760}
0 commit comments