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

Side by Side Diff: net/quic/quic_arena_scoped_ptr_test.cc

Issue 1670863002: QUIC - minor cleanup changes to keep code in sync with the internal source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0204
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/quic/crypto/crypto_handshake.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "net/quic/quic_arena_scoped_ptr.h" 4 #include "net/quic/quic_arena_scoped_ptr.h"
5 5
6 #include "net/quic/quic_one_block_arena.h" 6 #include "net/quic/quic_one_block_arena.h"
7 #include "testing/gmock/include/gmock/gmock.h" 7 #include "testing/gmock/include/gmock/gmock.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 // #include "testing/base/public/gunit.h"
10 9
11 namespace net { 10 namespace net {
12 namespace { 11 namespace {
13 12
14 enum class TestParam { kFromHeap, kFromArena }; 13 enum class TestParam { kFromHeap, kFromArena };
15 14
16 struct TestObject { 15 struct TestObject {
17 explicit TestObject(uintptr_t value) : value(value) { buffer.resize(1024); } 16 explicit TestObject(uintptr_t value) : value(value) { buffer.resize(1024); }
18 uintptr_t value; 17 uintptr_t value;
19 18
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 TEST_P(QuicArenaScopedPtrParamTest, Swap) { 93 TEST_P(QuicArenaScopedPtrParamTest, Swap) {
95 QuicArenaScopedPtr<TestObject> ptr1 = CreateObject(12345); 94 QuicArenaScopedPtr<TestObject> ptr1 = CreateObject(12345);
96 QuicArenaScopedPtr<TestObject> ptr2 = CreateObject(54321); 95 QuicArenaScopedPtr<TestObject> ptr2 = CreateObject(54321);
97 ptr1.swap(ptr2); 96 ptr1.swap(ptr2);
98 EXPECT_EQ(12345u, ptr2->value); 97 EXPECT_EQ(12345u, ptr2->value);
99 EXPECT_EQ(54321u, ptr1->value); 98 EXPECT_EQ(54321u, ptr1->value);
100 } 99 }
101 100
102 } // namespace 101 } // namespace
103 } // namespace net 102 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_handshake.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698