From 6007cdaabe1694ca8804ba816dbd87885dd3d8ac Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 5 Jan 2018 15:38:10 +0100 Subject: CppunitTest_sc_autoformatobj: fix read of value vs content of value As far as I see the old qadevOOo/runner/lib/MultiPropertyTest.java didn't assert the content of the property value (only avoided the set of the property if the value was null or void), the new C++ version asserts both the type and the value. Asserting the type is probably a good thing, but asserting the value is problematic, at least the test failed for me without these tweaks. Change-Id: I688486025e6118ad4c8907de6cb2629dd008f8fd Reviewed-on: https://gerrit.libreoffice.org/47475 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- test/source/sheet/tableautoformat.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/source/sheet/tableautoformat.cxx b/test/source/sheet/tableautoformat.cxx index 28f98eb172f6..ed1424482cb6 100644 --- a/test/source/sheet/tableautoformat.cxx +++ b/test/source/sheet/tableautoformat.cxx @@ -28,8 +28,8 @@ void TableAutoFormat::testTableAutoFormatProperties() propName = "IncludeFont"; bool aIncludeFont = false; - CPPUNIT_ASSERT(xTableAutoFormat->getPropertyValue(propName) >>= aIncludeFont); - CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeFont", aIncludeFont); + CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeFont", + xTableAutoFormat->getPropertyValue(propName) >>= aIncludeFont); aNewValue <<= false; xTableAutoFormat->setPropertyValue(propName, aNewValue); @@ -38,8 +38,8 @@ void TableAutoFormat::testTableAutoFormatProperties() propName = "IncludeJustify"; bool aIncludeJustify = false; - CPPUNIT_ASSERT(xTableAutoFormat->getPropertyValue(propName) >>= aIncludeJustify); - CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeJustify", aIncludeJustify); + CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeJustify", + xTableAutoFormat->getPropertyValue(propName) >>= aIncludeJustify); aNewValue <<= false; xTableAutoFormat->setPropertyValue(propName, aNewValue); @@ -48,8 +48,8 @@ void TableAutoFormat::testTableAutoFormatProperties() propName = "IncludeBorder"; bool aIncludeBorder = false; - CPPUNIT_ASSERT(xTableAutoFormat->getPropertyValue(propName) >>= aIncludeBorder); - CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeBorder", aIncludeBorder); + CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeBorder", + xTableAutoFormat->getPropertyValue(propName) >>= aIncludeBorder); aNewValue <<= false; xTableAutoFormat->setPropertyValue(propName, aNewValue); @@ -58,8 +58,8 @@ void TableAutoFormat::testTableAutoFormatProperties() propName = "IncludeBackground"; bool aIncludeBackground = false; - CPPUNIT_ASSERT(xTableAutoFormat->getPropertyValue(propName) >>= aIncludeBackground); - CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeBackground", aIncludeBackground); + CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeBackground", + xTableAutoFormat->getPropertyValue(propName) >>= aIncludeBackground); aNewValue <<= false; xTableAutoFormat->setPropertyValue(propName, aNewValue); @@ -68,9 +68,8 @@ void TableAutoFormat::testTableAutoFormatProperties() propName = "IncludeNumberFormat"; bool aIncludeNumberFormat = false; - CPPUNIT_ASSERT(xTableAutoFormat->getPropertyValue(propName) >>= aIncludeNumberFormat); CPPUNIT_ASSERT_MESSAGE("Unable to get property value IncludeNumberFormat", - aIncludeNumberFormat); + xTableAutoFormat->getPropertyValue(propName) >>= aIncludeNumberFormat); aNewValue <<= false; xTableAutoFormat->setPropertyValue(propName, aNewValue); -- cgit