desktop/qa/desktop_lib/test_desktop_lib.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
New commits: commit edb9ef41f29bf3477b8985ee409ce2d22214e63f Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Sep 25 09:06:28 2015 +0200 Add lok::Office::getFilterTypes() testcase Change-Id: I9fa710288729b904f2f1c5b3c575212ef21c8a79 diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 0cd88ce..d7b9347 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -51,11 +51,13 @@ public: void testGetStyles(); void testGetFonts(); void testCreateView(); + void testGetFilterTypes(); CPPUNIT_TEST_SUITE(DesktopLOKTest); CPPUNIT_TEST(testGetStyles); CPPUNIT_TEST(testGetFonts); CPPUNIT_TEST(testCreateView); + CPPUNIT_TEST(testGetFilterTypes); CPPUNIT_TEST_SUITE_END(); uno::Reference<lang::XComponent> mxComponent; @@ -150,6 +152,20 @@ void DesktopLOKTest::testCreateView() closeDoc(); } +void DesktopLOKTest::testGetFilterTypes() +{ + LibLibreOffice_Impl aOffice; + char* pJSON = aOffice.m_pOfficeClass->getFilterTypes(&aOffice); + + std::stringstream aStream(pJSON); + boost::property_tree::ptree aTree; + boost::property_tree::read_json(aStream, aTree); + + CPPUNIT_ASSERT(aTree.size() > 0); + CPPUNIT_ASSERT_EQUAL(std::string("application/vnd.oasis.opendocument.text"), aTree.get_child("writer8").get_child("MediaType").get_value<std::string>()); + free(pJSON); +} + CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); CPPUNIT_PLUGIN_IMPLEMENT(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits