sw/qa/extras/odfexport/odfexport.cxx | 66 +++++++++++++++++++++++++++++ sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 52 ---------------------- sw/qa/extras/rtfexport/rtfexport3.cxx | 13 ----- 3 files changed, 66 insertions(+), 65 deletions(-)
New commits: commit 0659bdb7f713a897e8e104d9ff992c2b43ddc9a4 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Oct 17 09:41:00 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Oct 17 13:24:28 2024 +0200 sw: move these tests where they belong Since they use DECLARE_ODFEXPORT_TEST they should be inside sw/qa/extras/odfexport/ Change-Id: Ia080f006c08ecf584232428563ec2aa94f6a4ce2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175067 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx b/sw/qa/extras/odfexport/data/arabic-zero-numbering.docx similarity index 100% rename from sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx rename to sw/qa/extras/odfexport/data/arabic-zero-numbering.docx diff --git a/sw/qa/extras/rtfexport/data/arabic-zero-numbering.rtf b/sw/qa/extras/odfexport/data/arabic-zero-numbering.rtf similarity index 100% rename from sw/qa/extras/rtfexport/data/arabic-zero-numbering.rtf rename to sw/qa/extras/odfexport/data/arabic-zero-numbering.rtf diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero3-numbering.docx b/sw/qa/extras/odfexport/data/arabic-zero3-numbering.docx similarity index 100% rename from sw/qa/extras/ooxmlexport/data/arabic-zero3-numbering.docx rename to sw/qa/extras/odfexport/data/arabic-zero3-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx b/sw/qa/extras/odfexport/data/arabic-zero4-numbering.docx similarity index 100% rename from sw/qa/extras/ooxmlexport/data/arabic-zero4-numbering.docx rename to sw/qa/extras/odfexport/data/arabic-zero4-numbering.docx diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx b/sw/qa/extras/odfexport/data/arabic-zero5-numbering.docx similarity index 100% rename from sw/qa/extras/ooxmlexport/data/arabic-zero5-numbering.docx rename to sw/qa/extras/odfexport/data/arabic-zero5-numbering.docx diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 70bea5e1b890..cbb9cec9e644 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -2737,6 +2737,72 @@ DECLARE_ODFEXPORT_TEST(testTdf132642_keepWithNextTable, "tdf132642_keepWithNextT CPPUNIT_ASSERT_EQUAL_MESSAGE("Row splits over 2 pages", 2, getPages()); } +DECLARE_ODFEXPORT_TEST(testArabicZeroNumberingRTF, "arabic-zero-numbering.rtf") +{ + auto xNumberingRules = getProperty<uno::Reference<container::XIndexAccess>>( + getParagraph(1), u"NumberingRules"_ustr); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 64 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO. + CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO), + aMap[u"NumberingType"_ustr].get<sal_uInt16>()); +} + + +DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 64 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO. + CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO), + aMap[u"NumberingType"_ustr].get<sal_uInt16>()); +} + +DECLARE_ODFEXPORT_TEST(testArabicZero3Numbering, "arabic-zero3-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 65 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO3. + CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO3), + aMap[u"NumberingType"_ustr].get<sal_uInt16>()); +} + +DECLARE_ODFEXPORT_TEST(testArabicZero4Numbering, "arabic-zero4-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 66 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO4. + CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO4), + aMap[u"NumberingType"_ustr].get<sal_uInt16>()); +} + +DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, "arabic-zero5-numbering.docx") +{ + auto xNumberingRules + = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); + comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 67 + // - Actual : 4 + // i.e. numbering type was ARABIC, not ARABIC_ZERO5. + CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO5), + aMap[u"NumberingType"_ustr].get<sal_uInt16>()); +} + CPPUNIT_TEST_FIXTURE(Test, testImageMimetype) { loadAndReload("image-mimetype.odt"); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index b0a65122bafb..cc6cce590287 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -373,58 +373,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf134260, "tdf134260.docx") .get<sal_Int32>()); } -DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.docx") -{ - auto xNumberingRules - = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); - comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 64 - // - Actual : 4 - // i.e. numbering type was ARABIC, not ARABIC_ZERO. - CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO), - aMap[u"NumberingType"_ustr].get<sal_uInt16>()); -} - -DECLARE_ODFEXPORT_TEST(testArabicZero3Numbering, "arabic-zero3-numbering.docx") -{ - auto xNumberingRules - = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); - comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 65 - // - Actual : 4 - // i.e. numbering type was ARABIC, not ARABIC_ZERO3. - CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO3), - aMap[u"NumberingType"_ustr].get<sal_uInt16>()); -} - -DECLARE_ODFEXPORT_TEST(testArabicZero4Numbering, "arabic-zero4-numbering.docx") -{ - auto xNumberingRules - = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); - comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 66 - // - Actual : 4 - // i.e. numbering type was ARABIC, not ARABIC_ZERO4. - CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO4), - aMap[u"NumberingType"_ustr].get<sal_uInt16>()); -} - -DECLARE_ODFEXPORT_TEST(testArabicZero5Numbering, "arabic-zero5-numbering.docx") -{ - auto xNumberingRules - = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), u"NumberingRules"_ustr); - comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 67 - // - Actual : 4 - // i.e. numbering type was ARABIC, not ARABIC_ZERO5. - CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO5), - aMap[u"NumberingType"_ustr].get<sal_uInt16>()); -} - CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote) { // Create a document, set footnote numbering type to ARABIC_ZERO. diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 5dd0b9af4ad5..f78ee4d51fcc 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -289,19 +289,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115180) verify(); } -DECLARE_ODFEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.rtf") -{ - auto xNumberingRules = getProperty<uno::Reference<container::XIndexAccess>>( - getParagraph(1), u"NumberingRules"_ustr); - comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0)); - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 64 - // - Actual : 4 - // i.e. numbering type was ARABIC, not ARABIC_ZERO. - CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(style::NumberingType::ARABIC_ZERO), - aMap[u"NumberingType"_ustr].get<sal_uInt16>()); -} - CPPUNIT_TEST_FIXTURE(Test, testTdf116841) { auto verify = [this]() {