summaryrefslogtreecommitdiff
path: root/sw/qa/extras/inc
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2013-09-09 12:49:13 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-10 07:27:09 +0000
commitf4dad76732328dfaa0ff16f810d6ee0a3bfd0d8c (patch)
tree0dcdca03a594a8e9535c264b91512ea7eac01111 /sw/qa/extras/inc
parenta41d72333d15c609f0441bd7df1722b31297756d (diff)
Improve border equal check in filter tests 2.
Change the order of words BORDER and EQUAL in the macro name to become consistent with other macro names. e.g. CPPUNIT_ASSERT_DOUBLES_EQUAL Use a function inside the macro to make it type safe. Add additional message to make clear why the test failed. Change-Id: I9fc7a5813adf2cac36ae831d438cec498232b06c Reviewed-on: https://gerrit.libreoffice.org/5885 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 254aabef60ca..353cd63e254f 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -37,13 +37,6 @@
using namespace com::sun::star;
#define DEFAULT_STYLE "Default Style"
-#define CPPUNIT_ASSERT_EQUAL_BORDER(aExpected, aActual) \
- CPPUNIT_ASSERT_EQUAL(aExpected.Color, aActual.Color); \
- CPPUNIT_ASSERT_EQUAL(aExpected.InnerLineWidth, aActual.InnerLineWidth); \
- CPPUNIT_ASSERT_EQUAL(aExpected.LineDistance, aActual.LineDistance); \
- CPPUNIT_ASSERT_EQUAL(aExpected.LineStyle, aActual.LineStyle); \
- CPPUNIT_ASSERT_EQUAL(aExpected.LineWidth, aActual.LineWidth); \
- CPPUNIT_ASSERT_EQUAL(aExpected.OuterLineWidth, aActual.OuterLineWidth);
/// Base class for filter tests loading or roundtriping a document, then asserting the document model.
class SwModelTestBase : public test::BootstrapFixture, public unotest::MacrosTest
@@ -366,4 +359,19 @@ protected:
sal_uInt32 m_nStartTime;
};
+inline void assertBorderEqual(
+ const table::BorderLine2& rExpected, const table::BorderLine2& rActual,
+ const CppUnit::SourceLine& rSourceLine )
+{
+ CPPUNIT_NS::assertEquals<util::Color>( rExpected.Color, rActual.Color, rSourceLine, "different Color" );
+ CPPUNIT_NS::assertEquals<sal_Int16>( rExpected.InnerLineWidth, rActual.InnerLineWidth, rSourceLine, "different InnerLineWidth" );
+ CPPUNIT_NS::assertEquals<sal_Int16>( rExpected.OuterLineWidth, rActual.OuterLineWidth, rSourceLine, "different OuterLineWidth" );
+ CPPUNIT_NS::assertEquals<sal_Int16>( rExpected.LineDistance, rActual.LineDistance, rSourceLine, "different LineDistance" );
+ CPPUNIT_NS::assertEquals<sal_Int16>( rExpected.LineStyle, rActual.LineStyle, rSourceLine, "different LineStyle" );
+ CPPUNIT_NS::assertEquals<sal_Int32>( rExpected.LineWidth, rActual.LineWidth, rSourceLine, "different LineWidth" );
+}
+
+#define CPPUNIT_ASSERT_BORDER_EQUAL(aExpected, aActual) \
+ assertBorderEqual( aExpected, aActual, CPPUNIT_SOURCELINE() ) \
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */