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

Unified Diff: base/json/string_escape_unittest.cc

Issue 18648003: Let JsonDoubleQuote accept StringPiece (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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/json/string_escape.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/string_escape_unittest.cc
diff --git a/base/json/string_escape_unittest.cc b/base/json/string_escape_unittest.cc
index 8952ee76d287f73e2ba2e051b42aac7eec4549af..f92199437446681d418b35c6f7e38c9f764aa0c3 100644
--- a/base/json/string_escape_unittest.cc
+++ b/base/json/string_escape_unittest.cc
@@ -25,9 +25,13 @@ const struct json_narrow_test_data {
TEST(StringEscapeTest, JsonDoubleQuoteNarrow) {
for (size_t i = 0; i < arraysize(json_narrow_cases); ++i) {
- std::string in = json_narrow_cases[i].to_escape;
+ const char* in_ptr = json_narrow_cases[i].to_escape;
+ std::string in_str = in_ptr;
std::string out;
- JsonDoubleQuote(in, false, &out);
+ JsonDoubleQuote(in_ptr, false, &out);
+ EXPECT_EQ(std::string(json_narrow_cases[i].escaped), out);
+ out.erase();
+ JsonDoubleQuote(in_str, false, &out);
EXPECT_EQ(std::string(json_narrow_cases[i].escaped), out);
}
« no previous file with comments | « base/json/string_escape.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698