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

Side by Side Diff: base/string_piece_unittest.cc

Issue 9167008: Resolve an ambiguous function call by casting to StringPiece::size_type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change the cast to the "U" suffix Created 8 years, 11 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 6
7 #include "base/string16.h" 7 #include "base/string16.h"
8 #include "base/string_piece.h" 8 #include "base/string_piece.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 657 }
658 658
659 TYPED_TEST(CommonStringPieceTest, CheckConstructors) { 659 TYPED_TEST(CommonStringPieceTest, CheckConstructors) {
660 TypeParam str(TestFixture::as_string("hello world")); 660 TypeParam str(TestFixture::as_string("hello world"));
661 TypeParam empty; 661 TypeParam empty;
662 662
663 ASSERT_TRUE(str == BasicStringPiece<TypeParam>(str)); 663 ASSERT_TRUE(str == BasicStringPiece<TypeParam>(str));
664 ASSERT_TRUE(str == BasicStringPiece<TypeParam>(str.c_str())); 664 ASSERT_TRUE(str == BasicStringPiece<TypeParam>(str.c_str()));
665 ASSERT_TRUE(TestFixture::as_string("hello") == 665 ASSERT_TRUE(TestFixture::as_string("hello") ==
666 BasicStringPiece<TypeParam>(str.c_str(), 5)); 666 BasicStringPiece<TypeParam>(str.c_str(), 5));
667 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(str.c_str(), 0)); 667 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(str.c_str(), 0U));
668 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(NULL)); 668 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(NULL));
669 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(NULL, 0)); 669 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(NULL, 0U));
670 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>()); 670 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>());
671 ASSERT_TRUE(str == BasicStringPiece<TypeParam>(str.begin(), str.end())); 671 ASSERT_TRUE(str == BasicStringPiece<TypeParam>(str.begin(), str.end()));
672 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(str.begin(), str.begin())); 672 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(str.begin(), str.begin()));
673 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(empty)); 673 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(empty));
674 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(empty.begin(), empty.end())); 674 ASSERT_TRUE(empty == BasicStringPiece<TypeParam>(empty.begin(), empty.end()));
675 } 675 }
676 676
677 } // namespace base 677 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698