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

Unified Diff: base/string_util_unittest.cc

Issue 18659: Simplify HexEncode. (Closed)
Patch Set: Add another test to make sure the shift is correct. Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util_unittest.cc
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc
index 0ca4438fad673c1f9a1d63e7ad7fb91f6481525a..a3ca7ee1aa7d1b072e8ffeb9cda489217bae6e8f 100644
--- a/base/string_util_unittest.cc
+++ b/base/string_util_unittest.cc
@@ -1455,7 +1455,7 @@ TEST(StringUtilTest, ElideString) {
TEST(StringUtilTest, HexEncode) {
std::string hex(HexEncode(NULL, 0));
EXPECT_EQ(hex.length(), 0U);
- unsigned char bytes[] = {0x01, 0xff, 0x02, 0xfe, 0x03};
+ unsigned char bytes[] = {0x01, 0xff, 0x02, 0xfe, 0x03, 0x80, 0x81};
hex = HexEncode(bytes, sizeof(bytes));
- EXPECT_EQ(hex.compare("01FF02FE03"), 0);
+ EXPECT_EQ(hex.compare("01FF02FE038081"), 0);
}
« no previous file with comments | « base/string_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698