chromium/third_party/webrtc/rtc_base/containers/flat_map_unittest.cc

/*
 *  Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

// This implementation is borrowed from Chromium.

#include "rtc_base/containers/flat_map.h"

#include <algorithm>
#include <string>
#include <type_traits>
#include <vector>

#include "rtc_base/containers/move_only_int.h"
#include "test/gmock.h"
#include "test/gtest.h"

// A flat_map is basically a interface to flat_tree. So several basic
// operations are tested to make sure things are set up properly, but the bulk
// of the tests are in flat_tree_unittests.cc.

ElementsAre;

namespace webrtc {

namespace {

struct Unsortable {};

bool operator==(const Unsortable& lhs, const Unsortable& rhs) {}

bool operator<(const Unsortable& lhs, const Unsortable& rhs) = delete;
bool operator<=(const Unsortable& lhs, const Unsortable& rhs) = delete;
bool operator>(const Unsortable& lhs, const Unsortable& rhs) = delete;
bool operator>=(const Unsortable& lhs, const Unsortable& rhs) = delete;

TEST(FlatMap, IncompleteType) {}

TEST(FlatMap, RangeConstructor) {}

TEST(FlatMap, MoveConstructor) {}

TEST(FlatMap, VectorConstructor) {}

TEST(FlatMap, InitializerListConstructor) {}

TEST(FlatMap, SortedRangeConstructor) {}

TEST(FlatMap, SortedCopyFromVectorConstructor) {}

TEST(FlatMap, SortedMoveFromVectorConstructor) {}

TEST(FlatMap, SortedInitializerListConstructor) {}

TEST(FlatMap, InitializerListAssignment) {}

TEST(FlatMap, InsertFindSize) {}

TEST(FlatMap, CopySwap) {}

// operator[](const Key&)
TEST(FlatMap, SubscriptConstKey) {}

// operator[](Key&&)
TEST(FlatMap, SubscriptMoveOnlyKey) {}

// Mapped& at(const Key&)
// const Mapped& at(const Key&) const
TEST(FlatMap, AtFunction) {}

// insert_or_assign(K&&, M&&)
TEST(FlatMap, InsertOrAssignMoveOnlyKey) {}

// insert_or_assign(const_iterator hint, K&&, M&&)
TEST(FlatMap, InsertOrAssignMoveOnlyKeyWithHint) {}

// try_emplace(K&&, Args&&...)
TEST(FlatMap, TryEmplaceMoveOnlyKey) {}

// try_emplace(const_iterator hint, K&&, Args&&...)
TEST(FlatMap, TryEmplaceMoveOnlyKeyWithHint) {}

TEST(FlatMap, UsingTransparentCompare) {}

TEST(FlatMap, SupportsEraseIf) {}

}  // namespace
}  // namespace webrtc