[Libreoffice-commits] core.git: sw/qa

Andreas Heinisch (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 13 20:11:01 UTC 2021


 sw/qa/extras/htmlexport/data/tdf126879.odt |binary
 sw/qa/extras/htmlexport/htmlexport.cxx     |   12 ++++++++++++
 2 files changed, 12 insertions(+)

New commits:
commit a7084f156a75ab363d2562b485b240bd350563fc
Author:     Andreas Heinisch <andreas.heinisch at yahoo.de>
AuthorDate: Mon Sep 13 21:12:02 2021 +0200
Commit:     Andreas Heinisch <andreas.heinisch at yahoo.de>
CommitDate: Mon Sep 13 22:10:28 2021 +0200

    tdf#126879: sw_htmlexport: Add unittest
    
    Change-Id: Id3abc7cf73756255d408f01cef47d02f89b79190
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122051
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heinisch at yahoo.de>

diff --git a/sw/qa/extras/htmlexport/data/tdf126879.odt b/sw/qa/extras/htmlexport/data/tdf126879.odt
new file mode 100644
index 000000000000..8002e93da7ae
Binary files /dev/null and b/sw/qa/extras/htmlexport/data/tdf126879.odt differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index cd680b1ad12b..5a2ea84292ac 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -1047,6 +1047,18 @@ DECLARE_HTMLEXPORT_TEST(testFieldShadeReqIf, "field-shade-reqif.odt")
     assertXPath(pDoc, "/html/body/div/p[1]/sdfield", 0);
 }
 
+DECLARE_HTMLEXPORT_TEST(testTdf126879, "tdf126879.odt")
+{
+    const OString aExpected("<!DOCTYPE html>");
+    SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
+    CPPUNIT_ASSERT(pStream);
+    const OString aActual(read_uInt8s_ToOString(*pStream, aExpected.getLength()));
+    // Without the fix in place, this test would have failed with
+    // - Expected: <!DOCTYPE html>
+    // - Actual  : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+    CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+}
+
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testBlockQuoteReqIf)
 {
     // Build a document model that uses the Quotations paragraph style.


More information about the Libreoffice-commits mailing list