From 69c964bbd56ff49324d1ca649739fae354dd4c16 Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Fri, 10 Jun 2022 21:35:43 +0200 Subject: [PATCH] fix 32bit build in new a11y cppunit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /<>/toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx: In member function ‘void XAccessibleComponentTester::testBounds()’: /<>/toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx:51:5: error: no matching function for call to ‘assertGreaterEqual(int, sal_Int32&, CppUnit::SourceLine, const char [1])’ 51 | CPPUNIT_ASSERT_GREATEREQUAL(0, bounds.X); | ^ /usr/include/cppunit/TestAssert.h:251:6: note: candidate: ‘template void CppUnit::assertGreaterEqual(const T&, const T&, CppUnit::SourceLine, const string&)’ 251 | void assertGreaterEqual( const T& expected, | ^~~~~~~~~~~~~~~~~~ /usr/include/cppunit/TestAssert.h:251:6: note: template argument deduction/substitution failed: /<>/toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx:51:5: note: deduced conflicting types for parameter ‘const T’ (‘int’ and ‘sal_Int32’ {aka ‘long int’}) 51 | CPPUNIT_ASSERT_GREATEREQUAL(0, bounds.X); | ^ etc. Regression from d2a5b4bc0b8c8d1dd82133719a3ef5cc01b0cbbe Change-Id: I123894e5ed6d6f3bcf46b1c5b37f1f49cb5f9f99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135630 Tested-by: Jenkins Tested-by: René Engelhard Reviewed-by: René Engelhard --- toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx | 8 ++++---- toolkit/qa/cppunit/a11y/XAccessibleContextTester.cxx | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx b/toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx index 5613724786b9..ea46ff778575 100644 --- a/toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx +++ b/toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx @@ -48,10 +48,10 @@ void XAccessibleComponentTester::testBounds() auto bounds = mxComponent->getBounds(); std::cout << "bounds: " << bounds.Width << "x" << bounds.Height << std::showpos << bounds.X << bounds.Y << std::noshowpos << std::endl; - CPPUNIT_ASSERT_GREATEREQUAL(0, bounds.X); - CPPUNIT_ASSERT_GREATEREQUAL(0, bounds.Y); - CPPUNIT_ASSERT_GREATER(0, bounds.Width); - CPPUNIT_ASSERT_GREATER(0, bounds.Height); + CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), bounds.X); + CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), bounds.Y); + CPPUNIT_ASSERT_GREATER(static_cast(0), bounds.Width); + CPPUNIT_ASSERT_GREATER(static_cast(0), bounds.Height); } /** diff --git a/toolkit/qa/cppunit/a11y/XAccessibleContextTester.cxx b/toolkit/qa/cppunit/a11y/XAccessibleContextTester.cxx index 3a7eb70e9dd5..b8c7898f963f 100644 --- a/toolkit/qa/cppunit/a11y/XAccessibleContextTester.cxx +++ b/toolkit/qa/cppunit/a11y/XAccessibleContextTester.cxx @@ -57,7 +57,7 @@ void XAccessibleContextTester::testGetAccessibleChildCount() { auto childCount = mxContext->getAccessibleChildCount(); std::cout << childCount << " children found." << std::endl; - CPPUNIT_ASSERT_GREATEREQUAL(0, childCount); + CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), childCount); } /** @@ -130,10 +130,10 @@ void XAccessibleContextTester::testGetAccessibleRelationSet() */ void XAccessibleContextTester::testGetAccessibleRole() { - sal_Int16 role = mxContext->getAccessibleRole(); + sal_Int32 role = mxContext->getAccessibleRole(); std::cout << "The role is " << role << " (" << AccessibilityTools::getRoleName(role) << ")" << std::endl; - CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), role); + CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), role); } /** @@ -157,8 +157,8 @@ void XAccessibleContextTester::testGetLocale() { auto loc = mxContext->getLocale(); std::cout << "The locale is " << loc.Language << "," << loc.Country << std::endl; - CPPUNIT_ASSERT_GREATER(0, loc.Language.getLength()); - CPPUNIT_ASSERT_GREATER(0, loc.Country.getLength()); + CPPUNIT_ASSERT_GREATER(static_cast(0), loc.Language.getLength()); + CPPUNIT_ASSERT_GREATER(static_cast(0), loc.Country.getLength()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */