chromium/net/base/priority_queue_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "net/base/priority_queue.h"

#include <cstddef>

#include "base/functional/bind.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace net {

namespace {

Priority;
// Queue 0 has empty lists for first and last priorities.
// Queue 1 has multiple empty lists in a row, and occupied first and last
// priorities.
// Queue 2 has multiple empty lists in a row at the first and last priorities.
//             Queue 0    Queue 1   Queue 2
// Priority 0: {}         {3, 7}    {}
// Priority 1: {2, 3, 7}  {2}       {}
// Priority 2: {1, 5}     {1, 5}    {1, 2, 3, 5, 7}
// Priority 3: {0}        {}        {0, 4, 6}
// Priority 4: {}         {}        {}
// Priority 5: {4, 6}     {6}       {}
// Priority 6: {}         {0, 4}    {}
constexpr Priority kNumPriorities =;
constexpr size_t kNumElements =;
constexpr size_t kNumQueues =;
constexpr Priority kPriorities[kNumQueues][kNumElements] =;
constexpr int kFirstMinOrder[kNumQueues][kNumElements] =;
constexpr int kLastMaxOrderErase[kNumQueues][kNumElements] =;
constexpr int kFirstMaxOrder[kNumQueues][kNumElements] =;
constexpr int kLastMinOrder[kNumQueues][kNumElements] =;

class PriorityQueueTest : public testing::TestWithParam<size_t> {};

TEST_P(PriorityQueueTest, AddAndClear) {}

TEST_P(PriorityQueueTest, PointerComparison) {}

TEST_P(PriorityQueueTest, FirstMinOrder) {}

TEST_P(PriorityQueueTest, LastMinOrder) {}

TEST_P(PriorityQueueTest, FirstMaxOrder) {}

TEST_P(PriorityQueueTest, GetNextTowardsLastMinAndErase) {}

TEST_P(PriorityQueueTest, GetPreviousTowardsFirstMaxAndErase) {}

TEST_P(PriorityQueueTest, FirstMaxOrderErase) {}

TEST_P(PriorityQueueTest, LastMaxOrderErase) {}

TEST_P(PriorityQueueTest, EraseFromMiddle) {}

TEST_P(PriorityQueueTest, InsertAtFront) {}

TEST_P(PriorityQueueTest, FindIf) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace

}  // namespace net