tdf#159101: sw_layoutwriter: Add unittest
Change-Id: I1034e3fdf5f5f5cb4537a980bac704429b4fed30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162194
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/qa/extras/layout/data/tdf159101.odt b/sw/qa/extras/layout/data/tdf159101.odt
new file mode 100644
index 0000000..e28bf65
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf159101.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 668f61f..0e7049d 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3675,6 +3675,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611)
assertXPathContent(pXmlDoc, "//tab/row/cell[1]/txt"_ostr, "Abcd efghijkl");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf159101)
{
createSwDoc("tdf159101.odt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
CPPUNIT_ASSERT(pXmlDoc);
assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFieldPortion"_ostr,
"expand"_ostr, "One");
// Without the fix in place, this test would have failed with
// - Expected: two
// - Actual : two
assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]/SwFieldPortion"_ostr,
"expand"_ostr, "two");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf142694)
{
createSwDoc("tdf142694-1.odt");