proxygen
|
#include <folly/hash/Hash.h>
#include <stdint.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <folly/MapUtil.h>
#include <folly/Range.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
Classes | |
struct | std::hash< TestEnum > |
struct | std::hash< TestStruct > |
class | TestHasher |
struct | FNVTestParam |
class | FNVTest |
Enumerations | |
enum | TestEnum |
enum | TestBigEnum : uint64_t |
Functions | |
TEST (Hash, Fnv32) | |
TEST (Hash, Fnv64) | |
TEST (Hash, Hsieh32) | |
TEST (Hash, TWang_Mix64) | |
TEST (Hash, TWang_Unmix64) | |
TEST (Hash, TWang_32From64) | |
TEST (Hash, Jenkins_Rev_Mix32) | |
TEST (Hash, Jenkins_Rev_Unmix32) | |
TEST (Hash, hasher) | |
TEST (Hash, integral_types) | |
TEST (Hash, noCachedHashCode) | |
TEST (Hash, integer_conversion) | |
TEST (Hash, float_types) | |
template<typename T , typename... Ts> | |
size_t | hash_combine_test (const T &t, const Ts &...ts) |
TEST (Hash, pair) | |
TEST (Hash, hash_combine) | |
TEST (Hash, hash_bool) | |
TEST (Hash, hash_bool10) | |
TEST (Hash, std_tuple) | |
TEST (Hash, enum_type) | |
TEST (Hash, pair_folly_hash) | |
TEST (Hash, tuple_folly_hash) | |
TEST (Hash, hash_range) | |
TEST (Hash, commutative_hash_combine) | |
TEST (Hash, std_tuple_different_hash) | |
TEST (Hash, Strings) | |
TEST_P (FNVTest, Fnva64Buf) | |
TEST_P (FNVTest, Fnva64) | |
TEST_P (FNVTest, Fnva64Partial) | |
INSTANTIATE_TEST_CASE_P (FNVTesting, FNVTest,::testing::Values(FNVTestParam{"foobar", 0x85944171f73967e8}, FNVTestParam{"chongo was here!\n", 0x46810940eff5f915}, FNVTestParam{"127.0.0.3", 0xaabafc7104d91158}, FNVTestParam{"http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash", 0xd9b957fb7fe794c5}, FNVTestParam{"http://norvig.com/21-days.html", 0x07aaa640476e0b9a})) | |
TEST (Traits, stdHashPairAvalances) | |
TEST (Traits, stdHashTuple2Avalances) | |
TEST (Traits, stdHashStringAvalances) | |
TEST (Traits, follyHashUint64Avalances) | |
TEST (Traits, follyHasherInt64Avalances) | |
TEST (Traits, follyHasherFloatAvalanches) | |
TEST (Traits, follyHasherDoubleAvalanches) | |
Variables | |
static constexpr bool | k32Bit = sizeof(std::size_t) == 4 |
|
strong |
Definition at line 234 of file HashTest.cpp.
|
strong |
Definition at line 228 of file HashTest.cpp.
size_t hash_combine_test | ( | const T & | t, |
const Ts &... | ts | ||
) |
Definition at line 419 of file HashTest.cpp.
References folly::hash::hash_combine_generic(), and folly::pushmi::detail::t.
Referenced by TEST().
INSTANTIATE_TEST_CASE_P | ( | FNVTesting | , |
FNVTest | , | ||
::testing::Values(FNVTestParam{"foobar", 0x85944171f73967e8}, FNVTestParam{"chongo was here!\n", 0x46810940eff5f915}, FNVTestParam{"127.0.0.3", 0xaabafc7104d91158}, FNVTestParam{"http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash", 0xd9b957fb7fe794c5}, FNVTestParam{"http://norvig.com/21-days.html", 0x07aaa640476e0b9a}) | |||
) |
Referenced by TEST_P().
TEST | ( | Hash | , |
Fnv32 | |||
) |
Definition at line 32 of file HashTest.cpp.
References EXPECT_EQ, folly::hash::fnv32(), folly::hash::fnv32_buf(), uint32_t, and uint8_t.
TEST | ( | Hash | , |
Fnv64 | |||
) |
Definition at line 55 of file HashTest.cpp.
References EXPECT_EQ, EXPECT_NE, folly::hash::fnv64(), folly::hash::fnv64_buf(), int32_t, int64_t, uint64_t, and uint8_t.
TEST | ( | Hash | , |
Hsieh32 | |||
) |
Definition at line 99 of file HashTest.cpp.
References EXPECT_EQ, folly::hash::hsieh_hash32(), folly::hash::hsieh_hash32_buf(), and uint32_t.
TEST | ( | Hash | , |
TWang_Mix64 | |||
) |
Definition at line 116 of file HashTest.cpp.
References EXPECT_EQ, folly::hash::twang_mix64(), folly::hash::twang_unmix64(), and uint64_t.
TEST | ( | Hash | , |
TWang_Unmix64 | |||
) |
Definition at line 135 of file HashTest.cpp.
TEST | ( | Hash | , |
TWang_32From64 | |||
) |
Definition at line 144 of file HashTest.cpp.
References EXPECT_EQ, folly::hash::twang_32from64(), uint32_t, and uint64_t.
TEST | ( | Hash | , |
Jenkins_Rev_Mix32 | |||
) |
Definition at line 154 of file HashTest.cpp.
References EXPECT_EQ, folly::hash::jenkins_rev_mix32(), folly::hash::jenkins_rev_unmix32(), and uint32_t.
TEST | ( | Hash | , |
Jenkins_Rev_Unmix32 | |||
) |
Definition at line 173 of file HashTest.cpp.
References i.
Definition at line 182 of file HashTest.cpp.
References EXPECT_EQ, folly::get_default(), and m.
TEST | ( | Hash | , |
integral_types | |||
) |
Definition at line 189 of file HashTest.cpp.
References EXPECT_EQ, int16_t, int32_t, int64_t, int8_t, uint16_t, uint32_t, uint64_t, and uint8_t.
TEST | ( | Hash | , |
noCachedHashCode | |||
) |
Definition at line 360 of file HashTest.cpp.
TEST | ( | Hash | , |
integer_conversion | |||
) |
Definition at line 372 of file HashTest.cpp.
References EXPECT_EQ, h, k, s, folly::TEST(), and uint64_t.
TEST | ( | Hash | , |
float_types | |||
) |
Definition at line 392 of file HashTest.cpp.
Definition at line 423 of file HashTest.cpp.
References a, b, c, EXPECT_EQ, EXPECT_NE, folly::hash::hash_combine(), and hash_combine_test().
TEST | ( | Hash | , |
hash_combine | |||
) |
Definition at line 451 of file HashTest.cpp.
References EXPECT_NE, EXPECT_TRUE, folly::hash::hash_combine(), and folly::pushmi::__adl::noexcept().
TEST | ( | Hash | , |
hash_bool | |||
) |
TEST | ( | Hash | , |
hash_bool10 | |||
) |
Definition at line 461 of file HashTest.cpp.
References EXPECT_EQ, and values().
TEST | ( | Hash | , |
std_tuple | |||
) |
TEST | ( | Hash | , |
enum_type | |||
) |
Definition at line 498 of file HashTest.cpp.
References EXPECT_EQ, EXPECT_NE, int32_t, and int64_t.
TEST | ( | Hash | , |
pair_folly_hash | |||
) |
Definition at line 520 of file HashTest.cpp.
TEST | ( | Hash | , |
tuple_folly_hash | |||
) |
Definition at line 529 of file HashTest.cpp.
References EXPECT_EQ, folly::hash::hash_range(), m, and folly::pushmi::detail::t.
TEST | ( | Hash | , |
hash_range | |||
) |
TEST | ( | Hash | , |
commutative_hash_combine | |||
) |
Definition at line 551 of file HashTest.cpp.
References folly::hash::commutative_hash_combine(), folly::hash::commutative_hash_combine_range(), folly::hash::commutative_hash_combine_range_generic(), folly::hash::commutative_hash_combine_value_generic(), EXPECT_EQ, EXPECT_NE, g(), h, i, and rd.
TEST | ( | Hash | , |
std_tuple_different_hash | |||
) |
TEST | ( | Hash | , |
Strings | |||
) |
Definition at line 591 of file HashTest.cpp.
References EXPECT_EQ, EXPECT_NE, folly::range(), and folly::Range< Iter >::str().
TEST | ( | Traits | , |
stdHashPairAvalances | |||
) |
TEST | ( | Traits | , |
stdHashTuple2Avalances | |||
) |
TEST | ( | Traits | , |
stdHashStringAvalances | |||
) |
Definition at line 910 of file HashTest.cpp.
TEST | ( | Traits | , |
follyHashUint64Avalances | |||
) |
Definition at line 922 of file HashTest.cpp.
TEST | ( | Traits | , |
follyHasherInt64Avalances | |||
) |
Definition at line 926 of file HashTest.cpp.
TEST | ( | Traits | , |
follyHasherFloatAvalanches | |||
) |
TEST | ( | Traits | , |
follyHasherDoubleAvalanches | |||
) |
TEST_P | ( | FNVTest | , |
Fnva64Buf | |||
) |
Definition at line 626 of file HashTest.cpp.
References EXPECT_EQ, and folly::hash::fnva64_buf().
TEST_P | ( | FNVTest | , |
Fnva64 | |||
) |
Definition at line 631 of file HashTest.cpp.
References EXPECT_EQ, and folly::hash::fnva64().
TEST_P | ( | FNVTest | , |
Fnva64Partial | |||
) |
Definition at line 635 of file HashTest.cpp.
References folly::data(), EXPECT_EQ, folly::hash::fnva64_buf(), INSTANTIATE_TEST_CASE_P(), and folly::partial().
|
static |
Definition at line 663 of file HashTest.cpp.