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

Unified Diff: base/string_split_unittest.cc

Issue 8008003: wstring: remove SplitStringAlongWhitespace for wchar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 9 years, 3 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') | chrome/browser/themes/theme_service.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 ee5877bc47a67898be430332f734fe39be56f5f4..83e4d7449d83034a2450e4db000189005792e99e 100644
--- a/base/string_split_unittest.cc
+++ b/base/string_split_unittest.cc
@@ -283,27 +283,27 @@ TEST(StringSplitTest, StringSplitDontTrim) {
TEST(StringSplitTest, SplitStringAlongWhitespace) {
struct TestData {
- const std::wstring input;
+ const char* input;
const size_t expected_result_count;
- const std::wstring output1;
- const std::wstring output2;
+ const char* output1;
+ const char* output2;
} data[] = {
- { L"a", 1, L"a", L"" },
- { L" ", 0, L"", L"" },
- { L" a", 1, L"a", L"" },
- { L" ab ", 1, L"ab", L"" },
- { L" ab c", 2, L"ab", L"c" },
- { L" ab c ", 2, L"ab", L"c" },
- { L" ab cd", 2, L"ab", L"cd" },
- { L" ab cd ", 2, L"ab", L"cd" },
- { L" \ta\t", 1, L"a", L"" },
- { L" b\ta\t", 2, L"b", L"a" },
- { L" b\tat", 2, L"b", L"at" },
- { L"b\tat", 2, L"b", L"at" },
- { L"b\t at", 2, L"b", L"at" },
+ { "a", 1, "a", "" },
+ { " ", 0, "", "" },
+ { " a", 1, "a", "" },
+ { " ab ", 1, "ab", "" },
+ { " ab c", 2, "ab", "c" },
+ { " ab c ", 2, "ab", "c" },
+ { " ab cd", 2, "ab", "cd" },
+ { " ab cd ", 2, "ab", "cd" },
+ { " \ta\t", 1, "a", "" },
+ { " b\ta\t", 2, "b", "a" },
+ { " b\tat", 2, "b", "at" },
+ { "b\tat", 2, "b", "at" },
+ { "b\t at", 2, "b", "at" },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
- std::vector<std::wstring> results;
+ std::vector<std::string> results;
SplitStringAlongWhitespace(data[i].input, &results);
ASSERT_EQ(data[i].expected_result_count, results.size());
if (data[i].expected_result_count > 0)
« no previous file with comments | « base/string_split.cc ('k') | chrome/browser/themes/theme_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698