chromium/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc

// Copyright 2018 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "absl/container/flat_hash_map.h"

#include <cstddef>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/base/config.h"
#include "absl/container/internal/hash_generator_testing.h"
#include "absl/container/internal/hash_policy_testing.h"
#include "absl/container/internal/test_allocator.h"
#include "absl/container/internal/unordered_map_constructor_test.h"
#include "absl/container/internal/unordered_map_lookup_test.h"
#include "absl/container/internal/unordered_map_members_test.h"
#include "absl/container/internal/unordered_map_modifiers_test.h"
#include "absl/log/check.h"
#include "absl/meta/type_traits.h"
#include "absl/types/any.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
namespace {
Enum;
EnumClass;
_;
IsEmpty;
Pair;
UnorderedElementsAre;
UnorderedElementsAreArray;

// Check that absl::flat_hash_map works in a global constructor.
struct BeforeMain {};
const BeforeMain before_main;

Map;

static_assert;

MapTypes;

INSTANTIATE_TYPED_TEST_SUITE_P();
INSTANTIATE_TYPED_TEST_SUITE_P();
INSTANTIATE_TYPED_TEST_SUITE_P();
INSTANTIATE_TYPED_TEST_SUITE_P();

UniquePtrMapTypes;

INSTANTIATE_TYPED_TEST_SUITE_P();

TEST(FlatHashMap, StandardLayout) {}

TEST(FlatHashMap, Relocatability) {}

// gcc becomes unhappy if this is inside the method, so pull it out here.
struct balast {};

TEST(FlatHashMap, IteratesMsan) {}

// Demonstration of the "Lazy Key" pattern.  This uses heterogeneous insert to
// avoid creating expensive key elements when the item is already present in the
// map.
struct LazyInt {};

struct Hash {};

struct Eq {};

TEST(FlatHashMap, LazyKeyPattern) {}

TEST(FlatHashMap, BitfieldArgument) {}

TEST(FlatHashMap, MergeExtractInsert) {}

bool FirstIsEven(std::pair<const int, int> p) {}

TEST(FlatHashMap, EraseIf) {}

TEST(FlatHashMap, CForEach) {}

TEST(FlatHashMap, CForEachMutate) {}

// This test requires std::launder for mutable key access in node handles.
#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606
TEST(FlatHashMap, NodeHandleMutableKeyAccess) {}
#endif

TEST(FlatHashMap, Reserve) {}

TEST(FlatHashMap, RecursiveTypeCompiles) {}

TEST(FlatHashMap, FlatHashMapPolicyDestroyReturnsTrue) {}

struct InconsistentHashEqType {};

TEST(Iterator, InconsistentHashEqFunctorsValidation) {}

}  // namespace
}  // namespace container_internal
ABSL_NAMESPACE_END
}  // namespace absl