diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-07-08 12:17:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-07-08 13:49:29 +0200 |
commit | 8abe6916308ed849ece9b3a58b860a73b04fec51 (patch) | |
tree | d727699850ecf059e113c730d231abcb2fc91e82 /emfio | |
parent | 5b0e81d462577113acac788ae4945e1cc00cf753 (diff) |
Make TestEmfPlusDrawPathWithCustomCap succeed on Aarch64
CppunitTest_emfio_emf CPPUNIT_TEST_NAME=Test::TestEmfPlusDrawPathWithCustomCap
introduced in 5b21b65572610df88986e700b81f1156aff14f65 "tdf#142770 tdf#143031
EMF+ Implement CustomLineCap" failed for me both in a local master build on
macOS on Apple M1 and in a Linux aarch64 test build of the libreoffice-7.4.0.1
Flathub flatpak (at <https://buildbot.flathub.org/#/builders/21/builds/7749>)
with
> xmltesttools.cxx:195:Assertion
> Test name: (anonymous namespace)::Test::TestEmfPlusDrawPathWithCustomCap
> equality assertion failed
> - Expected: 1423.297394625,1268.98481214025 830.006276132353,558.656004112967
> - Actual : 1423.297394625,1268.98481214025 830.006276132352,558.656004112967
> - In <>, XPath contents of child does not match
As this failed in exactly the same way for rather different builds (Clang vs.
GCC; Apple M1 vs. whatever ARM processor used by <https://flathub.org/builds>),
it smells like the test input might trigger a case where operations can
legitimately produce slightly different floating point results, which would then
cause the test to erroneously fail for some builds.
So I hacked the test input
emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf slightly, making
the EmfPlusPath's 2nd EmfPlusPointF Y coordinate identical to the 1st one's, so
that the arrow now points west rather than north-west,
> 00000190: 02 10 c0 db 00 00 00 00 00 00 cc ff 08 40 0e 03
> 000001a0: 2c 00 00 00 20 00 00 00 02 10 c0 db 02 00 00 00
> 000001b0: 00 00 00 00 2b b5 05 45 05 54 56 45 d6 66 00 45
> -000001c0: 05 54 56 45 00 01 81 01 15 40 0e 00 10 00 00 00
> +000001c0: 51 23 4d 45 00 01 81 01 15 40 0e 00 10 00 00 00
> 000001d0: 04 00 00 00 0f 00 00 00 0e 00 00 00 14 00 00 00
> 000001e0: 00 00 00 00 10 00 00 00 14 00 00 00
which happens to let the test compute a different polygonstrokearrow/polygon
value now, but which appears to be stable across at least my x86-64 and aarch64
test builds.
And temporarily reverting the non-test (i.e., drawinglayer) parts of
5b21b65572610df88986e700b81f1156aff14f65 would make the test fail with
> xmltesttools.cxx:121:Assertion
> Test name: (anonymous namespace)::Test::TestEmfPlusDrawPathWithCustomCap
> assertion failed
> - Expression: xmlXPathNodeSetGetLength(pXmlNodes) > 0
> - In <>, XPath '/primitive2D/metafile/transform/polygonstrokearrow/polygon' not found
so the test appears to still faithfully check the intended difference in
behavior.
Change-Id: Iec31246dd7666ec764176622ccc4f246eea6e4ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136896
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/qa/cppunit/emf/EmfImportTest.cxx | 2 | ||||
-rw-r--r-- | emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf | bin | 492 -> 492 bytes |
2 files changed, 1 insertions, 1 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index b423eae91721..fd89ade0c899 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -1060,7 +1060,7 @@ void Test::TestEmfPlusDrawPathWithCustomCap() CPPUNIT_ASSERT(pDocument); assertXPathContent(pDocument, aXPathPrefix + "polygonstrokearrow/polygon", - "1423.297394625,1268.98481214025 830.006276132353,558.656004112967"); + "1423.297394625,1268.98481214025 705.717657763014,1304.88786195939"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "color", "#cc0000"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "width", "96"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow/line", "linecap", "BUTT"); diff --git a/emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf b/emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf Binary files differindex e94986431618..df83e65516dd 100644 --- a/emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf +++ b/emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf |