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

Side by Side Diff: net/quic/crypto/crypto_handshake_message_test.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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_message.cc ('k') | net/quic/crypto/crypto_protocol.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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/crypto/crypto_handshake_message.h" 5 #include "net/quic/crypto/crypto_handshake_message.h"
6 6
7 #include "net/quic/crypto/crypto_handshake.h" 7 #include "net/quic/crypto/crypto_handshake.h"
8 #include "net/quic/crypto/crypto_protocol.h" 8 #include "net/quic/crypto/crypto_protocol.h"
9 #include "net/test/gtest_util.h" 9 #include "net/test/gtest_util.h"
10 10
11 namespace net { 11 namespace net {
12 namespace test { 12 namespace test {
13 namespace { 13 namespace {
14 14
15 TEST(CryptoHandshakeMessageTest, DebugString) { 15 TEST(CryptoHandshakeMessageTest, DebugString) {
16 CryptoHandshakeMessage message; 16 CryptoHandshakeMessage message;
17 message.set_tag(kSHLO); 17 message.set_tag(kSHLO);
18 EXPECT_EQ("SHLO<\n>", message.DebugString()); 18 EXPECT_EQ("SHLO<\n>", message.DebugString());
19 } 19 }
20 20
21 TEST(CryptoHandshakeMessageTest, DebugStringWithUintVector) { 21 TEST(CryptoHandshakeMessageTest, DebugStringWithUintVector) {
22 CryptoHandshakeMessage message; 22 CryptoHandshakeMessage message;
23 message.set_tag(kREJ); 23 message.set_tag(kREJ);
24 std::vector<uint32> reasons = { 24 std::vector<uint32_t> reasons = {
25 SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE, 25 SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE,
26 CLIENT_NONCE_NOT_UNIQUE_FAILURE}; 26 CLIENT_NONCE_NOT_UNIQUE_FAILURE};
27 message.SetVector(kRREJ, reasons); 27 message.SetVector(kRREJ, reasons);
28 EXPECT_EQ( 28 EXPECT_EQ(
29 "REJ <\n RREJ: " 29 "REJ <\n RREJ: "
30 "SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE," 30 "SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE,"
31 "CLIENT_NONCE_NOT_UNIQUE_FAILURE\n>", 31 "CLIENT_NONCE_NOT_UNIQUE_FAILURE\n>",
32 message.DebugString()); 32 message.DebugString());
33 } 33 }
34 34
35 TEST(CryptoHandshakeMessageTest, DebugStringWithTagVector) { 35 TEST(CryptoHandshakeMessageTest, DebugStringWithTagVector) {
36 CryptoHandshakeMessage message; 36 CryptoHandshakeMessage message;
37 message.set_tag(kCHLO); 37 message.set_tag(kCHLO);
38 message.SetTaglist(kCOPT, kTBBR, kPAD, kBYTE, 0); 38 message.SetTaglist(kCOPT, kTBBR, kPAD, kBYTE, 0);
39 EXPECT_EQ("CHLO<\n COPT: 'TBBR','PAD ','BYTE'\n>", message.DebugString()); 39 EXPECT_EQ("CHLO<\n COPT: 'TBBR','PAD ','BYTE'\n>", message.DebugString());
40 } 40 }
41 41
42 } // namespace 42 } // namespace
43 } // namespace test 43 } // namespace test
44 } // namespace net 44 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_handshake_message.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698