chromium/v8/test/unittests/base/smallmap-unittest.cc

// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Copyright 2023 the V8 project authors. All rights reserved.
// This file is a clone of "base/containers/small_map_unittest.h" in chromium.
// Keep in sync, especially when fixing bugs.

#include <algorithm>
#include <unordered_map>

#include "src/base/small-map.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace v8 {
namespace base {

TEST(SmallMapTest, General) {}

TEST(SmallMapTest, PostFixIteratorIncrement) {}

// Based on the General testcase.
TEST(SmallMapTest, CopyConstructor) {}

template <class inner>
static bool SmallMapIsSubset(SmallMap<inner> const& a,
                             SmallMap<inner> const& b) {}

template <class inner>
static bool SmallMapEqual(SmallMap<inner> const& a, SmallMap<inner> const& b) {}

TEST(SmallMapTest, AssignmentOperator) {}

TEST(SmallMapTest, Insert) {}

TEST(SmallMapTest, InsertRange) {}

TEST(SmallMapTest, Erase) {}

TEST(SmallMapTest, EraseReturnsIteratorFollowingRemovedElement) {}

TEST(SmallMapTest, NonHashMap) {}

TEST(SmallMapTest, DefaultEqualKeyWorks) {}

namespace {

class unordered_map_add_item : public std::unordered_map<int, int> {};

void InitMap(unordered_map_add_item* map_ctor) {}

class unordered_map_add_item_initializer {};

}  // anonymous namespace

TEST(SmallMapTest, SubclassInitializationWithFunctionPointer) {}

TEST(SmallMapTest, SubclassInitializationWithFunctionObject) {}

namespace {

// This class acts as a basic implementation of a move-only type. The canonical
// example of such a type is scoped_ptr/unique_ptr.
template <typename V>
class MoveOnlyType {};

}  // namespace

TEST(SmallMapTest, MoveOnlyValueType) {}

TEST(SmallMapTest, Emplace) {}

}  // namespace base
}  // namespace v8