diff options
author | Rene Meusel <[email protected]> | 2017-10-28 18:40:57 +0200 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-11-09 16:05:17 -0500 |
commit | cb4977cf9396485d8a133aea1802e4bd57988e55 (patch) | |
tree | fe03065e87cab6e2e31c29810f04844b1a8c56d9 /src/tests | |
parent | 2349f20fdb312a74b2705bf7f0e298be13e3d7a0 (diff) |
add conversion from UCS-2/4 to UTF-8
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test_asn1.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tests/test_asn1.cpp b/src/tests/test_asn1.cpp index eae1d96f8..f28093e4b 100644 --- a/src/tests/test_asn1.cpp +++ b/src/tests/test_asn1.cpp @@ -58,13 +58,14 @@ Test::Result test_asn1_utf8_ascii_parsing() // ... - UTF-8 encoded (ASCII chars only) word 'Moscow' const std::string moscow = "\x13\x06\x4D\x6F\x73\x63\x6F\x77"; + const std::string moscow_plain = "Moscow"; Botan::DataSource_Memory input(moscow.data()); Botan::BER_Decoder dec(input); Botan::ASN1_String str; str.decode_from(dec); - result.test_success("No crash"); + result.test_eq("value()", str.value(), moscow_plain); } catch(const Botan::Decoding_Error &ex) { @@ -85,13 +86,15 @@ Test::Result test_asn1_utf8_parsing() // ... - UTF-8 encoded russian word for Moscow in cyrillic script const std::string moscow = "\x0C\x0C\xD0\x9C\xD0\xBE\xD1\x81\xD0\xBA\xD0\xB2\xD0\xB0"; + const std::string moscow_plain = + "\xD0\x9C\xD0\xBE\xD1\x81\xD0\xBA\xD0\xB2\xD0\xB0"; Botan::DataSource_Memory input(moscow.data()); Botan::BER_Decoder dec(input); Botan::ASN1_String str; str.decode_from(dec); - result.test_success("No crash"); + result.test_eq("value()", str.value(), moscow_plain); } catch(const Botan::Decoding_Error &ex) { |