summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_simple_buffer_allocator_test.cc
blob: 3129b9608c8044592eafa576cac127601b37eb08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 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.

#include "net/quic/quic_simple_buffer_allocator.h"

#include "net/quic/quic_protocol.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

using ::testing::Eq;

namespace net {
namespace {

TEST(SimpleBufferAllocatorTest, NewDelete) {
  SimpleBufferAllocator alloc;
  char* buf = alloc.New(4);
  EXPECT_NE(nullptr, buf);
  alloc.Delete(buf);
}

TEST(SimpleBufferAllocatorTest, DeleteNull) {
  SimpleBufferAllocator alloc;
  alloc.Delete(nullptr);
}

TEST(SimpleBufferAllocatorTest, StoreInUniqueStreamBuffer) {
  SimpleBufferAllocator alloc;
  UniqueStreamBuffer buf = NewStreamBuffer(&alloc, 4);
  buf.reset();
}

}  // namespace
}  // namespace net