diff options
author | Mihai Varga <mihai.varga@collabora.com> | 2015-02-27 14:32:11 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-27 14:48:25 +0100 |
commit | 3a8a08caebd5c8fbbc28ff34b0d7d0979662a56a (patch) | |
tree | 5eefb620ee104046ff6d05a50fba74f6d34f0e84 /src/test | |
parent | 9686192d63bd208df1c6b53c892ba5a680cdc4b6 (diff) |
More metadata extracted from VSD/VSDX files
Template, language, company and category metadata are extracted from
VSD/VSDX files. Company and category are set as custom properties.
I've also added unit tests for those 4 new document properties.
Change-Id: Ic14bfa11a2a8253c79dd4c4466afc7f6b2ce4ea9
Signed-off-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/Makefile.am | 2 | ||||
-rw-r--r-- | src/test/data/dwg.vsd | bin | 0 -> 41984 bytes | |||
-rw-r--r-- | src/test/data/dwg.vsdx | bin | 0 -> 24469 bytes | |||
-rw-r--r-- | src/test/importtest.cpp | 21 |
4 files changed, 23 insertions, 0 deletions
diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 9285cbf..619302a 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -23,6 +23,8 @@ EXTRA_DIST = \ data/fdo86664.vsdx \ data/fdo86729-ms1252.vsd \ data/fdo86729-utf8.vsd \ + data/dwg.vsd \ + data/dwg.vsdx \ $(test_SOURCES) TESTS = test diff --git a/src/test/data/dwg.vsd b/src/test/data/dwg.vsd Binary files differnew file mode 100644 index 0000000..bea1075 --- /dev/null +++ b/src/test/data/dwg.vsd diff --git a/src/test/data/dwg.vsdx b/src/test/data/dwg.vsdx Binary files differnew file mode 100644 index 0000000..6642f8c --- /dev/null +++ b/src/test/data/dwg.vsdx diff --git a/src/test/importtest.cpp b/src/test/importtest.cpp index 29b99fd..7aba7bc 100644 --- a/src/test/importtest.cpp +++ b/src/test/importtest.cpp @@ -124,11 +124,15 @@ class ImportTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST(testVsdxMetadataTitle); CPPUNIT_TEST(testVsdMetadataTitleMs1252); CPPUNIT_TEST(testVsdMetadataTitleUtf8); + CPPUNIT_TEST(testVsdUserDefinedMetadata); + CPPUNIT_TEST(testVsdxUserDefinedMetadata); CPPUNIT_TEST_SUITE_END(); void testVsdxMetadataTitle(); void testVsdMetadataTitleMs1252(); void testVsdMetadataTitleUtf8(); + void testVsdUserDefinedMetadata(); + void testVsdxUserDefinedMetadata(); xmlBufferPtr m_buffer; xmlDocPtr m_doc; @@ -203,6 +207,23 @@ void ImportTest::testVsdMetadataTitleUtf8() assertXPath(m_doc, "/document/setDocumentMetaData", "date", "2014-11-26T09:24:56Z"); } +void ImportTest::testVsdUserDefinedMetadata() +{ + m_doc = parse("dwg.vsd", m_buffer); + assertXPath(m_doc, "/document/setDocumentMetaData", "category", "Category test"); + assertXPath(m_doc, "/document/setDocumentMetaData", "company", "Company test"); + assertXPath(m_doc, "/document/setDocumentMetaData", "template", "BASICD_M.VSTX"); +} + +void ImportTest::testVsdxUserDefinedMetadata() +{ + m_doc = parse("dwg.vsdx", m_buffer); + assertXPath(m_doc, "/document/setDocumentMetaData", "category", "Category test"); + assertXPath(m_doc, "/document/setDocumentMetaData", "company", "Company test"); + assertXPath(m_doc, "/document/setDocumentMetaData", "language", "en-US"); + assertXPath(m_doc, "/document/setDocumentMetaData", "template", "BASICD_M.VSTX"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ImportTest); /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |