test/test_hash_key.cpp

changeset 603
c49104015a6b
parent 596
52fcaf3c9154
child 604
056e5f592d84
equal deleted inserted replaced
602:3b071ea0e9cf 603:c49104015a6b
35 auto len = 1 + strlen(str); 35 auto len = 1 + strlen(str);
36 36
37 auto str_key = cx_hash_key_str(str); 37 auto str_key = cx_hash_key_str(str);
38 auto bytes_key = cx_hash_key_bytes( 38 auto bytes_key = cx_hash_key_bytes(
39 reinterpret_cast<unsigned char const *>(str), len); 39 reinterpret_cast<unsigned char const *>(str), len);
40 auto obj_key = cx_hash_key((void *) str, len); 40 auto obj_key = cx_hash_key(
41 reinterpret_cast<void const *>(str), len);
41 42
42 EXPECT_EQ(str_key.hash, bytes_key.hash); 43 EXPECT_EQ(str_key.hash, bytes_key.hash);
43 EXPECT_EQ(obj_key.hash, bytes_key.hash); 44 EXPECT_EQ(obj_key.hash, bytes_key.hash);
44 EXPECT_EQ(str_key.len, len); 45 EXPECT_EQ(str_key.len, len);
45 EXPECT_EQ(bytes_key.len, len); 46 EXPECT_EQ(bytes_key.len, len);

mercurial