Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: net/quic/quic_one_block_arena_test.cc

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_one_block_arena.h ('k') | net/quic/quic_packet_creator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_one_block_arena_test.cc
diff --git a/net/quic/quic_one_block_arena_test.cc b/net/quic/quic_one_block_arena_test.cc
deleted file mode 100644
index 39e7767c3567c5318884cae984fb794378993829..0000000000000000000000000000000000000000
--- a/net/quic/quic_one_block_arena_test.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2016 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_one_block_arena.h"
-
-#include "net/quic/interval_set.h"
-#include "net/quic/quic_flags.h"
-#include "net/quic/quic_utils.h"
-#include "net/test/gtest_util.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace net {
-namespace {
-
-static const uint32_t kMaxAlign = 8;
-
-struct TestObject {
- uint32_t value;
-};
-
-TEST(QuicOneBlockArenaTest, AllocateSuccess) {
- QuicOneBlockArena<1024> arena;
- QuicArenaScopedPtr<TestObject> ptr = arena.New<TestObject>();
- EXPECT_TRUE(ptr.is_from_arena());
-}
-
-TEST(QuicOneBlockArenaTest, Exhaust) {
- QuicOneBlockArena<1024> arena;
- for (size_t i = 0; i < 1024 / kMaxAlign; ++i) {
- QuicArenaScopedPtr<TestObject> ptr = arena.New<TestObject>();
- EXPECT_TRUE(ptr.is_from_arena());
- }
- QuicArenaScopedPtr<TestObject> ptr;
- EXPECT_DFATAL(ptr = arena.New<TestObject>(),
- "Ran out of space in QuicOneBlockArena");
- EXPECT_FALSE(ptr.is_from_arena());
-}
-
-TEST(QuicOneBlockArenaTest, NoOverlaps) {
- QuicOneBlockArena<1024> arena;
- std::vector<QuicArenaScopedPtr<TestObject>> objects;
- IntervalSet<uintptr_t> used;
- for (size_t i = 0; i < 1024 / kMaxAlign; ++i) {
- QuicArenaScopedPtr<TestObject> ptr = arena.New<TestObject>();
- EXPECT_TRUE(ptr.is_from_arena());
-
- uintptr_t begin = reinterpret_cast<uintptr_t>(ptr.get());
- uintptr_t end = begin + sizeof(TestObject);
- EXPECT_FALSE(used.Contains(begin));
- EXPECT_FALSE(used.Contains(end - 1));
- used.Add(begin, end);
- }
-}
-
-} // namespace
-} // namespace net
« no previous file with comments | « net/quic/quic_one_block_arena.h ('k') | net/quic/quic_packet_creator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698