Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "absl/container/internal/hash_policy_testing.h"
00016
00017 #include "gtest/gtest.h"
00018
00019 namespace absl {
00020 namespace container_internal {
00021 namespace {
00022
00023 TEST(_, Hash) {
00024 StatefulTestingHash h1;
00025 EXPECT_EQ(1, h1.id());
00026 StatefulTestingHash h2;
00027 EXPECT_EQ(2, h2.id());
00028 StatefulTestingHash h1c(h1);
00029 EXPECT_EQ(1, h1c.id());
00030 StatefulTestingHash h2m(std::move(h2));
00031 EXPECT_EQ(2, h2m.id());
00032 EXPECT_EQ(0, h2.id());
00033 StatefulTestingHash h3;
00034 EXPECT_EQ(3, h3.id());
00035 h3 = StatefulTestingHash();
00036 EXPECT_EQ(4, h3.id());
00037 h3 = std::move(h1);
00038 EXPECT_EQ(1, h3.id());
00039 }
00040
00041 }
00042 }
00043 }