Bug 153533 - The test chart2_import fails on HIDPI display
Summary: The test chart2_import fails on HIDPI display
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords:
Depends on:
Blocks: HiDPI Dev-Bugs
  Show dependency treegraph
 
Reported: 2023-02-10 19:34 UTC by Hossein
Modified: 2023-02-25 03:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2023-02-10 19:34:04 UTC
Description:
I have 2 displays, one is HIDPI, and another is not.
On the same system, it fails on the HiDPI display, and passes on another.

On HiDPI display:

Chart2ImportTest::testPieChartPlotAreaMarginWithAutomaticLayout finish
ed in: 774ms
lode/dev/core/chart2/qa/extras/chart2import.cxx(2207) : error : Assertion
Test name: Chart2ImportTest::testFixedSizeBarChartVeryLongLabel
double equality assertion failed
- Expected: 4800
- Actual  : 4632
- Delta   : 100

Failures !!!
Run: 85   Failure total: 1   Failures: 1   Errors: 0
...
Error: a unit test failed, please do one of:
make CppunitTest_chart2_import CPPUNITTRACE=TRUE # which is a shortcut
 for the following line
make CppunitTest_chart2_import CPPUNITTRACE="'C:/Program Files/Microso
ft Visual Studio/2022/Community/Common7/IDE/devenv.exe' /debugexe" # f
or interactive debugging in Visual Studio
make CppunitTest_chart2_import CPPUNITTRACE="drmemory -free_max_frames
 20" # for memory checking (install Dr.Memory first, and put it to you
r PATH)

You can limit the execution to just one particular test by:

make CppunitTest_chart2_import CPPUNIT_TEST_NAME="testXYZ" ...above me
ntioned params...

make[1]: *** [lode/dev/core/solenv/gbuild
/CppunitTest.mk:121: lode/dev/core/workdir/CppunitTest/chart2_import.test] Error 1
make: *** [Makefile:169: CppunitTest_chart2_import] Error 2


Steps to Reproduce:
1. Compile LibreOffice core from the source code
2. Run 'make CppunitTest_chart2_import'

Actual Results:
The test fails on HiDPI display

Expected Results:
The test should pass on all displays including the HiDPI display


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 72959cc2b36749a779b56522f27e290731187043
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fa-IR (fa_IR); UI: en-US
Calc: threaded

This is the related part of the code in chart2/qa/extras/chart2import.cxx:2202

https://opengrok.libreoffice.org/xref/core/chart2/qa/extras/chart2import.cxx?r=959fbfc0#2202

2202      // The text shape width should be smaller than the chart wall
2203      // The specific numbers unfortunately vary depending on DPI - allow 1 mm
2204      CPPUNIT_ASSERT_DOUBLES_EQUAL(5085, xChartWall->getSize().Width, 100);
2205      CPPUNIT_ASSERT_DOUBLES_EQUAL(7113, xChartWall->getSize().Height, 100);
2206  
2207      CPPUNIT_ASSERT_DOUBLES_EQUAL(4800, xXAxis->getSize().Width, 100);
2208      CPPUNIT_ASSERT_DOUBLES_EQUAL(398, xXAxis->getSize().Height, 100);
Comment 1 Hossein 2023-02-10 22:22:59 UTC
Confirming as per problem reported by the mentee.

Chart2ImportTest::testPieChartPlotAreaMarginWithAutomaticLayout finished in: 871ms
C:/cygwin/home/user/lode/dev/core/chart2/qa/extras/chart2import.cxx(2277) : error : Assertion
Test name: Chart2ImportTest::testAutomaticSizeBarChartVeryLongLabel
double equality assertion failed
- Expected: 5320
- Actual  : 4765
- Delta   : 100

Failures !!!
Run: 85   Failure total: 1   Failures: 1   Errors: 0
warn:vcl.gdi.wndproc:14936:7040:vcl/win/app/salinst.cxx:631: ignoring timer event because we are shutting down
warn:vcl.schedule.deinit:14936:7040:vcl/source/app/scheduler.cxx:177: DeInit task: Timer a: 1 p: 1 drawinglayer ImpTimedRefDev destroy mpVirDev 180000ms (000001B252DE4090)
warn:vcl.schedule.deinit:14936:7040:vcl/source/app/scheduler.cxx:177: DeInit task: Timer a: 1 p: 1 graphic::Manager maSwapOutTimer 10000ms (00007FF9A039CEB8)
warn:vcl.schedule.deinit:14936:7040:vcl/source/app/scheduler.cxx:177: DeInit task: Timer a: 1 p: 1 sc ScModule IdleTimer 150ms (000001B2529B9050) (ignored)
warn:vcl.schedule.deinit:14936:7040:vcl/source/app/scheduler.cxx:198: DeInit active tasks: 3 (ignored: 1)
warn:vcl.gdi.wndproc:14936:7040:vcl/win/app/salinst.cxx:631: ignoring timer event because we are shutting down
warn:vcl.gdi.wndproc:14936:7040:vcl/win/app/salinst.cxx:631: ignoring timer event because we are shutting down
warn:vcl.gdi.wndproc:14936:7040:vcl/win/app/salinst.cxx:631: ignoring timer event because we are shutting down
warn:vcl.gdi.wndproc:14936:7040:vcl/win/app/salinst.cxx:631: ignoring timer event because we are shutting down

Error: a unit test failed, please do one of:
make CppunitTest_chart2_import CPPUNITTRACE=TRUE # which is a shortcut for the following line
make CppunitTest_chart2_import CPPUNITTRACE="'C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/devenv.exe' /debugexe" # for interactive debugging in Visual Studio
make CppunitTest_chart2_import CPPUNITTRACE="drmemory -free_max_frames 20" # for memory checking (install Dr.Memory first, and put it to your PATH)

You can limit the execution to just one particular test by:

make CppunitTest_chart2_import CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params...

make[1]: *** [C:/cygwin/home/user/lode/dev/core/solenv/gbuild/CppunitTest.mk:119: C:/cygwin/home/user/lode/dev/core/workdir/CppunitTest/chart2_import.test] Error 1
make: *** [Makefile:289: build] Error 2
Comment 2 Buovjaga 2023-02-11 07:06:43 UTC
I had one mentee getting the same issue with testFixedSizeBarChartVeryLongLabel in July 2022.
Comment 3 Commit Notification 2023-02-24 22:58:56 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/573863d78ae55cdb8dfc9747aee47804a0b6f84c

tdf#153533 Fix chart2_import test failure on HiDPI display

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.