Failure in VclTextTest::testSimpleText due to a slightly oversized delta
Ilmari Lauhakangas
ilmari.lauhakangas at libreoffice.org
Wed Apr 19 07:02:37 UTC 2023
A new contributor gets this on Ubuntu 22.04:
[_RUN_____] VclTextTest::testSimpleText
/home/user/LibreOffice/core/vcl/qa/cppunit/text.cxx:230:VclTextTest::testSimpleText
double equality assertion failed
- Expected: 42
- Actual : 37
- Delta : 4
No display scaling is in use.
The block leading up to 230 is:
font = vcl::Font("DejaVu Sans", "Book", Size(0, 72));
device->Erase();
device->SetFont(font);
device->DrawText(Point(10, 10), text);
exportDevice("simple-text-72.png", device);
// Font size is doubled, so pixel sizes should also roughly double.
tools::Long height72 = getCharacterLeftSideHeight(device, Point(0, 30));
CPPUNIT_ASSERT_DOUBLES_EQUAL(height36 * 2, height72, 4);
tools::Long width72 = getCharacterBaseWidth(device, Point(20, 99));
CPPUNIT_ASSERT_DOUBLES_EQUAL(width36 * 2, width72, 4);
Test was added in ae38f1dff768e3582464f34ec4cd89b8133e8423
Should we bump the delta and be happy?
Ilmari
More information about the LibreOffice
mailing list