diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-17 22:10:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-17 22:15:26 +0100 |
commit | c1ed56802e640b52674c62426b1e7507d09ddbf1 (patch) | |
tree | bfe2540e67ae448abc12cef39e2092fc7595da5c /src/test/importtest.cpp | |
parent | c31e6cf3618f40ab4d1ec655e4e6f7c7590834ab (diff) |
VSD: test metadata import
Only title as a start.
Change-Id: Ic7a4cc8ddd1f781466d7a113bf3a925ae112e874
Diffstat (limited to 'src/test/importtest.cpp')
-rw-r--r-- | src/test/importtest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/importtest.cpp b/src/test/importtest.cpp index d9100bc..d25380d 100644 --- a/src/test/importtest.cpp +++ b/src/test/importtest.cpp @@ -94,9 +94,13 @@ class ImportTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(ImportTest); CPPUNIT_TEST(testVsdxMetadataTitle); + CPPUNIT_TEST(testVsdMetadataTitleMs1252); + CPPUNIT_TEST(testVsdMetadataTitleUtf8); CPPUNIT_TEST_SUITE_END(); void testVsdxMetadataTitle(); + void testVsdMetadataTitleMs1252(); + void testVsdMetadataTitleUtf8(); xmlBufferPtr m_buffer; xmlDocPtr m_doc; @@ -141,6 +145,20 @@ void ImportTest::testVsdxMetadataTitle() assertXPath(m_doc, "/document/setDocumentMetaData", "date", "2014-11-24T10:41:22Z"); } +void ImportTest::testVsdMetadataTitleMs1252() +{ + m_doc = parse("fdo86729-ms1252.vsd", m_buffer); + // Test windows-1252 -> UTF-8 conversion, provided by ICU. + assertXPath(m_doc, "/document/setDocumentMetaData", "title", "mytitle\xC3\xA9\xC3\xA1"); +} + +void ImportTest::testVsdMetadataTitleUtf8() +{ + m_doc = parse("fdo86729-utf8.vsd", m_buffer); + // Test the case when the string is UTF-8 encoded already in the file. + assertXPath(m_doc, "/document/setDocumentMetaData", "title", "mytitle\xC3\xA9\xC3\xA1\xC5\x91\xC5\xB1"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ImportTest); /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |