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

Unified Diff: net/cert/internal/parse_name_unittest.cc

Issue 2865603002: X509NameAttribute::ValueAsString: Decode TeletexString as Latin1. (Closed)
Patch Set: add comment/todo about nacl difference Created 3 years, 7 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 | « net/cert/internal/parse_name.cc ('k') | net/cert/x509_certificate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/parse_name_unittest.cc
diff --git a/net/cert/internal/parse_name_unittest.cc b/net/cert/internal/parse_name_unittest.cc
index 2d876161111cfa8cbb3f44338f4a94b1bcb9ebc4..dab04212f6e8cab3bdf8f409009a8b469bcdc038 100644
--- a/net/cert/internal/parse_name_unittest.cc
+++ b/net/cert/internal/parse_name_unittest.cc
@@ -94,16 +94,17 @@ TEST(ParseNameTest, TeletexSafeStringValue) {
ASSERT_EQ("Foo bar", result);
}
-TEST(ParseNameTest, TeletexUnsafeStringValue) {
+TEST(ParseNameTest, TeletexLatin1StringValue) {
const uint8_t der[] = {
- 0x46, 0x6f, 0x1F, 0x20, 0x62, 0x61, 0x72,
+ 0x46, 0x6f, 0xd6, 0x20, 0x62, 0x61, 0x72,
};
X509NameAttribute value(der::Input(), der::kTeletexString, der::Input(der));
std::string result_unsafe;
ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe));
- ASSERT_EQ("Fo\037 bar", result_unsafe);
+ ASSERT_EQ("Fo\xd6 bar", result_unsafe);
std::string result;
- ASSERT_FALSE(value.ValueAsString(&result));
+ ASSERT_TRUE(value.ValueAsString(&result));
+ ASSERT_EQ("FoÖ bar", result);
}
TEST(ParseNameTest, ConvertBmpString) {
« no previous file with comments | « net/cert/internal/parse_name.cc ('k') | net/cert/x509_certificate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698