hash_policy_testing_test.cc
Go to the documentation of this file.
00001 // Copyright 2018 The Abseil Authors.
00002 //
00003 // Licensed under the Apache License, Version 2.0 (the "License");
00004 // you may not use this file except in compliance with the License.
00005 // You may obtain a copy of the License at
00006 //
00007 //      https://www.apache.org/licenses/LICENSE-2.0
00008 //
00009 // Unless required by applicable law or agreed to in writing, software
00010 // distributed under the License is distributed on an "AS IS" BASIS,
00011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012 // See the License for the specific language governing permissions and
00013 // limitations under the License.
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 }  // namespace
00042 }  // namespace container_internal
00043 }  // namespace absl


abseil_cpp
Author(s):
autogenerated on Wed Jun 19 2019 19:42:14