Avoid potential negative array index access to cached text.
[LibreOffice.git] / writerperfect / qa / unit / WpftWriterFilterTest.cxx
blob78d24dc99b1734839256e8a879f030185a5dbf1b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "WpftFilterTestBase.hxx"
12 namespace
14 class WpftWriterFilterTest : public writerperfect::test::WpftFilterTestBase
16 public:
17 WpftWriterFilterTest();
19 void test();
21 CPPUNIT_TEST_SUITE(WpftWriterFilterTest);
22 CPPUNIT_TEST(test);
23 CPPUNIT_TEST_SUITE_END();
26 WpftWriterFilterTest::WpftWriterFilterTest()
27 : writerperfect::test::WpftFilterTestBase("private:factory/swriter")
31 void WpftWriterFilterTest::test()
33 const writerperfect::test::WpftOptionalMap_t aEBookOptional{
34 { "FictionBook2.fb2.zip", REQUIRE_EBOOK_VERSION(0, 1, 1) },
36 const writerperfect::test::WpftOptionalMap_t aEtonyekOptional{
37 { "Pages_4.pages", REQUIRE_ETONYEK_VERSION(0, 1, 2) },
38 { "Pages_5.pages", REQUIRE_ETONYEK_VERSION(0, 1, 8) },
40 const writerperfect::test::WpftOptionalMap_t aMWAWOptional{
41 { "JazzLotus.hqx", REQUIRE_MWAW_VERSION(0, 3, 17) },
42 { "MaxWrite_1.hqx", REQUIRE_MWAW_VERSION(0, 3, 8) },
43 { "MouseWrite_1.hqx", REQUIRE_MWAW_VERSION(0, 3, 8) },
44 { "RagTime_2.1.hqx", REQUIRE_MWAW_VERSION(0, 3, 2) },
45 { "RagTime_3.2.hqx", REQUIRE_MWAW_VERSION(0, 3, 2) },
46 { "RagTime_5.5.rag", REQUIRE_MWAW_VERSION(0, 3, 6) },
47 { "ScriptWriter", REQUIRE_MWAW_VERSION(0, 3, 21) },
48 { "StudentWritingCenter", REQUIRE_MWAW_VERSION(0, 3, 20) },
49 { "WordMaker", REQUIRE_MWAW_VERSION(0, 3, 20) },
51 const writerperfect::test::WpftOptionalMap_t aStarOfficeOptional{
52 { "Writer_3.1.sdw", REQUIRE_STAROFFICE_VERSION(0, 0, 2) },
54 const writerperfect::test::WpftOptionalMap_t aWpsOptional{
55 { "PocketWord.psw", REQUIRE_WPS_VERSION(0, 4, 12) },
56 { "Word_5.0_DOS.doc", REQUIRE_WPS_VERSION(0, 4, 3) },
57 { "Write_3.1.wri", REQUIRE_WPS_VERSION(0, 4, 2) },
60 doTest("com.sun.star.comp.Writer.AbiWordImportFilter",
61 u"/writerperfect/qa/unit/data/writer/libabw/");
62 doTest("org.libreoffice.comp.Writer.EBookImportFilter",
63 u"/writerperfect/qa/unit/data/writer/libe-book/", aEBookOptional);
64 doTest("com.sun.star.comp.Writer.MSWorksImportFilter",
65 u"/writerperfect/qa/unit/data/writer/libwps/", aWpsOptional);
66 doTest("com.sun.star.comp.Writer.MWAWImportFilter",
67 u"/writerperfect/qa/unit/data/writer/libmwaw/", aMWAWOptional);
68 doTest("org.libreoffice.comp.Writer.PagesImportFilter",
69 u"/writerperfect/qa/unit/data/writer/libetonyek/", aEtonyekOptional);
70 doTest("org.libreoffice.comp.Writer.StarOfficeWriterImportFilter",
71 u"/writerperfect/qa/unit/data/writer/libstaroffice/", aStarOfficeOptional);
72 doTest("com.sun.star.comp.Writer.WordPerfectImportFilter",
73 u"/writerperfect/qa/unit/data/writer/libwpd/");
76 CPPUNIT_TEST_SUITE_REGISTRATION(WpftWriterFilterTest);
79 CPPUNIT_PLUGIN_IMPLEMENT();
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */