| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "net/quic/quic_simple_buffer_allocator.h" | |
| 6 | |
| 7 #include "net/quic/quic_protocol.h" | |
| 8 #include "testing/gmock/include/gmock/gmock.h" | |
| 9 #include "testing/gtest/include/gtest/gtest.h" | |
| 10 | |
| 11 using ::testing::Eq; | |
| 12 | |
| 13 namespace net { | |
| 14 namespace { | |
| 15 | |
| 16 TEST(SimpleBufferAllocatorTest, NewDelete) { | |
| 17 SimpleBufferAllocator alloc; | |
| 18 char* buf = alloc.New(4); | |
| 19 EXPECT_NE(nullptr, buf); | |
| 20 alloc.Delete(buf); | |
| 21 } | |
| 22 | |
| 23 TEST(SimpleBufferAllocatorTest, DeleteNull) { | |
| 24 SimpleBufferAllocator alloc; | |
| 25 alloc.Delete(nullptr); | |
| 26 } | |
| 27 | |
| 28 TEST(SimpleBufferAllocatorTest, StoreInUniqueStreamBuffer) { | |
| 29 SimpleBufferAllocator alloc; | |
| 30 UniqueStreamBuffer buf = NewStreamBuffer(&alloc, 4); | |
| 31 buf.reset(); | |
| 32 } | |
| 33 | |
| 34 } // namespace | |
| 35 } // namespace net | |
| OLD | NEW |