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

Side by Side Diff: net/quic/platform/api/quic_text_utils_test.cc

Issue 2691393002: Fix auto raw pointer deduction on linux (Closed)
Patch Set: rebase Created 3 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/core/quic_stream_sequencer_buffer_test.cc ('k') | net/spdy/spdy_framer_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 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 4
5 #include "net/quic/platform/api/quic_text_utils.h" 5 #include "net/quic/platform/api/quic_text_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 25 matching lines...) Expand all
36 EXPECT_EQ("lower", QuicTextUtils::ToLower("LOWER")); 36 EXPECT_EQ("lower", QuicTextUtils::ToLower("LOWER"));
37 EXPECT_EQ("lower", QuicTextUtils::ToLower("lower")); 37 EXPECT_EQ("lower", QuicTextUtils::ToLower("lower"));
38 EXPECT_EQ("lower", QuicTextUtils::ToLower("lOwEr")); 38 EXPECT_EQ("lower", QuicTextUtils::ToLower("lOwEr"));
39 EXPECT_EQ("123", QuicTextUtils::ToLower("123")); 39 EXPECT_EQ("123", QuicTextUtils::ToLower("123"));
40 EXPECT_EQ("", QuicTextUtils::ToLower("")); 40 EXPECT_EQ("", QuicTextUtils::ToLower(""));
41 } 41 }
42 42
43 TEST(QuicTextUtilsText, RemoveLeadingAndTrailingWhitespace) { 43 TEST(QuicTextUtilsText, RemoveLeadingAndTrailingWhitespace) {
44 string input; 44 string input;
45 45
46 for (auto input : {"text", " text", " text", "text ", "text ", " text ", 46 for (auto* input : {"text", " text", " text", "text ", "text ", " text ",
47 " text ", "\r\n\ttext", "text\n\r\t"}) { 47 " text ", "\r\n\ttext", "text\n\r\t"}) {
48 StringPiece piece(input); 48 StringPiece piece(input);
49 QuicTextUtils::RemoveLeadingAndTrailingWhitespace(&piece); 49 QuicTextUtils::RemoveLeadingAndTrailingWhitespace(&piece);
50 EXPECT_EQ("text", piece); 50 EXPECT_EQ("text", piece);
51 } 51 }
52 } 52 }
53 53
54 TEST(QuicTextUtilsText, StringToNumbers) { 54 TEST(QuicTextUtilsText, StringToNumbers) {
55 const string kMaxInt32Plus1 = "2147483648"; 55 const string kMaxInt32Plus1 = "2147483648";
56 const string kMinInt32Minus1 = "-2147483649"; 56 const string kMinInt32Minus1 = "-2147483649";
57 const string kMaxUint32Plus1 = "4294967296"; 57 const string kMaxUint32Plus1 = "4294967296";
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 EXPECT_EQ(std::vector<StringPiece>({"a", "b", "c"}), 193 EXPECT_EQ(std::vector<StringPiece>({"a", "b", "c"}),
194 QuicTextUtils::Split("a,b,c", ',')); 194 QuicTextUtils::Split("a,b,c", ','));
195 EXPECT_EQ(std::vector<StringPiece>({"a", "b", "c"}), 195 EXPECT_EQ(std::vector<StringPiece>({"a", "b", "c"}),
196 QuicTextUtils::Split("a:b:c", ':')); 196 QuicTextUtils::Split("a:b:c", ':'));
197 EXPECT_EQ(std::vector<StringPiece>({"a:b:c"}), 197 EXPECT_EQ(std::vector<StringPiece>({"a:b:c"}),
198 QuicTextUtils::Split("a:b:c", ',')); 198 QuicTextUtils::Split("a:b:c", ','));
199 } 199 }
200 200
201 } // namespace test 201 } // namespace test
202 } // namespace net 202 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_stream_sequencer_buffer_test.cc ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698