diff options
author | Vasily Melenchuk <Vasily.Melenchuk@cib.de> | 2017-06-20 16:42:14 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-06-21 09:53:34 +0200 |
commit | 8f2f277571091045fb57cec7f225a3391cc374b1 (patch) | |
tree | d515166017596d7d9342f6f3faee10e906afc912 /sw/qa | |
parent | 9752eccdd06f6695ec4f173ea93cada65063d1f0 (diff) |
sw_htmlimport::testTableBorder1px testcase simplified
Goal of this testcase is just to ensure that some table cell borders
exist while some others do not. There is no reason to do exact width
comparison which is causing errors on some MacOS configurations.
Change-Id: I574c29220696ae654dea2db0398790a440efd83b
Reviewed-on: https://gerrit.libreoffice.org/39015
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/htmlimport/htmlimport.cxx | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 19f51c1824ea..5e704b3f3be9 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -228,29 +228,47 @@ DECLARE_HTMLIMPORT_TEST(testTableBorder1px, "table_border_1px.html") CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + table::BorderLine2 aBorder; + uno::Reference<text::XTextRange> xCellA1(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA1,"TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellA1,"BottomBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA1,"LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA1,"RightBorder")); + aBorder = getProperty<table::BorderLine2>(xCellA1, "TopBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell top border", aBorder.InnerLineWidth > 0); + aBorder = getProperty<table::BorderLine2>(xCellA1, "BottomBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell bottom border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellA1, "LeftBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell left border", aBorder.InnerLineWidth > 0); + aBorder = getProperty<table::BorderLine2>(xCellA1, "RightBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell right border", aBorder.InnerLineWidth > 0); uno::Reference<text::XTextRange> xCellB1(xTable->getCellByName("B1"), uno::UNO_QUERY); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellB1,"TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB1,"BottomBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB1,"LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellB1,"RightBorder")); + aBorder = getProperty<table::BorderLine2>(xCellB1, "TopBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell top border", aBorder.InnerLineWidth > 0); + aBorder = getProperty<table::BorderLine2>(xCellB1, "BottomBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell bottom border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellB1, "LeftBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell left border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellB1, "RightBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell right border", aBorder.InnerLineWidth > 0); uno::Reference<text::XTextRange> xCellA2(xTable->getCellByName("A2"), uno::UNO_QUERY); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x0,0,0,0,0,0), getProperty<table::BorderLine2>(xCellA2,"TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellA2,"BottomBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA2,"LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA2,"RightBorder")); + aBorder = getProperty<table::BorderLine2>(xCellA2, "TopBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell top border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellA2, "BottomBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell bottom border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellA2, "LeftBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell left border", aBorder.InnerLineWidth > 0); + aBorder = getProperty<table::BorderLine2>(xCellA2,"RightBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell right border", aBorder.InnerLineWidth > 0); uno::Reference<text::XTextRange> xCellB2(xTable->getCellByName("B2"), uno::UNO_QUERY); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x0,0,0,0,0,0), getProperty<table::BorderLine2>(xCellB2,"TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB2,"BottomBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB2,"LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellB2,"RightBorder")); + aBorder = getProperty<table::BorderLine2>(xCellB2, "TopBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell top border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellB2, "BottomBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell bottom border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellB2, "LeftBorder"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected cell left border", sal_Int16(0), aBorder.InnerLineWidth); + aBorder = getProperty<table::BorderLine2>(xCellB2, "RightBorder"); + CPPUNIT_ASSERT_MESSAGE("Missing cell right border", aBorder.InnerLineWidth > 0); } CPPUNIT_PLUGIN_IMPLEMENT(); |