]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw_escape: add JSON + utf-8 test
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 13 Jul 2011 18:47:24 +0000 (11:47 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 13 Jul 2011 18:47:24 +0000 (11:47 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/test/rgw_escape.cc

index 45c26a4106b87049ddbfe05d9ee1615a1b40eb6a..16eb26188f1101e5ee51a452a52aaac351211b89 100644 (file)
@@ -88,3 +88,8 @@ TEST(EscapeJson, ControlChars) {
   uint8_t cc2[] = { 0x61, 0x62, 0x63, 0x7f, 0x0 };
   ASSERT_EQ(escape_json_attrs((char*)cc2), "abc\\007f");
 }
+
+TEST(EscapeJson, Utf8) {
+  uint8_t cc1[] = { 0xe6, 0xb1, 0x89, 0xe5, 0xad, 0x97, 0x0a, 0x0 };
+  ASSERT_EQ(escape_xml_attrs((const char*)cc1), (const char*)cc1);
+}