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

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

Issue 14287009: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with Tot Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_data_writer.cc ('k') | net/quic/quic_framer.h » ('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) 2012 The Chromium Authors. All rights reserved. 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 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 4
5 #include "net/quic/quic_data_writer.h" 5 #include "net/quic/quic_data_writer.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace net { 9 namespace net {
10 namespace test { 10 namespace test {
11 namespace { 11 namespace {
12 12
13 TEST(QuicDataWriterTest, WriteUint8ToOffset) { 13 TEST(QuicDataWriterTest, WriteUint8ToOffset) {
14 QuicDataWriter writer(4); 14 QuicDataWriter writer(4);
15 15
16 writer.WriteUInt32(0xfefdfcfb);
16 EXPECT_TRUE(writer.WriteUInt8ToOffset(1, 0)); 17 EXPECT_TRUE(writer.WriteUInt8ToOffset(1, 0));
17 EXPECT_TRUE(writer.WriteUInt8ToOffset(2, 1)); 18 EXPECT_TRUE(writer.WriteUInt8ToOffset(2, 1));
18 EXPECT_TRUE(writer.WriteUInt8ToOffset(3, 2)); 19 EXPECT_TRUE(writer.WriteUInt8ToOffset(3, 2));
19 EXPECT_TRUE(writer.WriteUInt8ToOffset(4, 3)); 20 EXPECT_TRUE(writer.WriteUInt8ToOffset(4, 3));
20 21
21 char* data = writer.take(); 22 char* data = writer.take();
22 23
23 EXPECT_EQ(1, data[0]); 24 EXPECT_EQ(1, data[0]);
24 EXPECT_EQ(2, data[1]); 25 EXPECT_EQ(2, data[1]);
25 EXPECT_EQ(3, data[2]); 26 EXPECT_EQ(3, data[2]);
(...skipping 10 matching lines...) Expand all
36 EXPECT_DEBUG_DEATH(writer.WriteUInt8ToOffset(5, 4), "Check failed"); 37 EXPECT_DEBUG_DEATH(writer.WriteUInt8ToOffset(5, 4), "Check failed");
37 #else 38 #else
38 EXPECT_DEATH(writer.WriteUInt8ToOffset(5, 4), "Check failed"); 39 EXPECT_DEATH(writer.WriteUInt8ToOffset(5, 4), "Check failed");
39 #endif 40 #endif
40 #endif 41 #endif
41 } 42 }
42 43
43 } // namespace 44 } // namespace
44 } // namespace test 45 } // namespace test
45 } // namespace net 46 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_data_writer.cc ('k') | net/quic/quic_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698