sw/qa: relax testTdf134146 in layout tests.
The old test case expects the number of //text to
be 14. I.e. the Y-axis title splits into exactly two
lines. But it splits into 3 lines in my environment
( Windows10 traditional Chinese version ). Considering
the result might be locale and font dependent, relax the
test case so that it passes as long as the title breaks
into two or more lines.
Change-Id: Ic1da3993c95ecaa7a58d09901a7ce05dd8a34235
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103900
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 6f2fea3..3c18aee 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3122,11 +3122,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134146)
MetafileXmlDump dumper;
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 14
// - Actual : 13
const sal_Int32 nTitleLines
= getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Horizontal\")])").toInt32();
// Without the accompanying fix in place, this test would have failed.
// i.e. the Y axis title didn't break to multiple lines.
assertXPath(pXmlDoc, "//textarray", 14);
CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(1), nTitleLines);
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf136061)