vcl/qa/cppunit/complextext.cxx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
New commits: commit 9af45ef67824f3ec6e95c16e7deb005a73532d65 Author: Khaled Hosny <[email protected]> Date: Mon Mar 6 16:43:57 2017 +0200 Try harder to debug the random TB failures here Change-Id: I490302e56e6dcc222fc9b65755f16272bb53af56 Reviewed-on: https://gerrit.libreoffice.org/34930 Tested-by: Jenkins <[email protected]> Reviewed-by: Khaled Hosny <[email protected]> diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index fd6a72f..f785b4a 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <ostream> +#include <vector> +std::ostream& operator<<(std::ostream& rStream, const std::vector<long>& rVec); + #include <unotest/filters-test.hxx> #include <test/bootstrapfixture.hxx> @@ -15,6 +19,16 @@ #include <osl/file.hxx> #include <osl/process.h> +std::ostream& operator<<(std::ostream& rStream, const std::vector<long>& rVec) +{ + rStream << "{ "; + for (size_t i = 0; i < rVec.size() - 1; i++) + rStream << rVec[i] << ", "; + rStream << rVec.back(); + rStream << " }"; + return rStream; +} + class VclComplexTextTest : public test::BootstrapFixture { public: @@ -55,14 +69,14 @@ void VclComplexTextTest::testArabic() pOutDev->SetFont( aFont ); // absolute character widths AKA text array. + std::vector<long> aRefCharWidths {6, 9, 16, 16, 22, 22, 26, 29, 32, 32, + 36, 40, 49, 53, 56, 63, 63, 66, 72, 72}; std::vector<long> aCharWidths(aOneTwoThree.getLength(), 0); long nTextWidth = pOutDev->GetTextArray(aOneTwoThree, aCharWidths.data()); + + CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths); CPPUNIT_ASSERT_EQUAL(72L, nTextWidth); CPPUNIT_ASSERT_EQUAL(nTextWidth, aCharWidths.back()); - std::vector<long> aRefCharWidths {6, 9, 16, 16, 22, 22, 26, 29, 32, 32, - 36, 40, 49, 53, 56, 63, 63, 66, 72, 72}; - for (size_t i = 0; i < aCharWidths.size(); i++) - CPPUNIT_ASSERT_EQUAL(aRefCharWidths[i], aCharWidths[i]); // text advance width and line height CPPUNIT_ASSERT_EQUAL(72L, pOutDev->GetTextWidth(aOneTwoThree)); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
