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

Unified Diff: base/string_split_unittest.cc

Issue 6930047: wstring: remove wstring version of SplitString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_split.cc ('k') | views/controls/label.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_split_unittest.cc
diff --git a/base/string_split_unittest.cc b/base/string_split_unittest.cc
index 749d56662b7e25ee4c0f1dddbc1f31e424d0b5d4..ee5877bc47a67898be430332f734fe39be56f5f4 100644
--- a/base/string_split_unittest.cc
+++ b/base/string_split_unittest.cc
@@ -1,8 +1,10 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/string_split.h"
+
+#include "base/utf_string_conversions.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -10,6 +12,23 @@ using ::testing::ElementsAre;
namespace base {
+namespace {
+
+#if !defined(WCHAR_T_IS_UTF16)
+// Overload SplitString with a wide-char version to make it easier to
+// test the string16 version with wide character literals.
+void SplitString(const std::wstring& str,
+ wchar_t c,
+ std::vector<std::wstring>* result) {
+ std::vector<string16> result16;
+ SplitString(WideToUTF16(str), c, &result16);
+ for (size_t i = 0; i < result16.size(); ++i)
+ result->push_back(UTF16ToWide(result16[i]));
+}
+#endif
+
+} // anonymous namespace
+
class SplitStringIntoKeyValuesTest : public testing::Test {
protected:
std::string key;
« no previous file with comments | « base/string_split.cc ('k') | views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698