chromium/components/media_router/common/providers/cast/channel/enum_table_unittest.cc

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

#include "components/media_router/common/providers/cast/channel/enum_table.h"

#include <optional>

#include "base/test/gtest_util.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cast_util {
namespace {

enum class MyEnum {};

const EnumTable<MyEnum> kSorted({},
                                MyEnum::kMaxValue);

const EnumTable<MyEnum> kUnsorted({},
                                  NonConsecutiveEnumTable);

const EnumTable<MyEnum> kSortedMissing({},
                                       MyEnum::kMaxValue);

const EnumTable<MyEnum> kUnsortedMissing({},
                                         NonConsecutiveEnumTable);

}  // namespace

template <>
const EnumTable<MyEnum>& EnumTable<MyEnum>::GetInstance() {}

namespace {

TEST(EnumTableTest, TestGetString) {}

TEST(EnumTableTest, TestGetStringUnsorted) {}

TEST(EnumTableTest, TestGetMissingString) {}

TEST(EnumTableTest, TestGetMissingStringUnsorted) {}

TEST(EnumTableTest, TestEnumToStringGlobal) {}

TEST(EnumTableTest, TestStaticGetString) {}

TEST(EnumTableTest, TestStaticEnumToStringGlobal) {}

TEST(EnumTableTest, TestGetEnum) {}

TEST(EnumTableTest, TestStringToEnumGlobal) {}

// See note in enum_table.h for details of why these tests have to be compiled
// out when NDEBUG is defined.
#ifndef NDEBUG

TEST(EnumTableDeathTest, MaxValueTooSmall) {}

TEST(EnumTableDeathTest, MaxValueTooLarge) {}

TEST(EnumTableDeathTest, Sorted) {}

TEST(EnumTableDeathTest, Unsorted) {}

TEST(EnumTableDeathTest, DuplicateEnums) {}

TEST(EnumTableDeathTest, DuplicateStrings) {}

constexpr MyEnum kInvalid =;

TEST(EnumTableDeathTest, EnumToString) {}

TEST(EnumTableDeathTest, StaticEnumToString) {}

enum class HugeEnum {};

TEST(EnumTableDeathTest, HugeEnum) {}

#endif  // NDEBUG

}  // namespace
}  // namespace cast_util