sc/qa/unit/tiledrendering/tiledrendering.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit 3dcf2acadb847ec76d7e1dff3b4b730a64b52c41 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Tue Aug 8 23:15:59 2023 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Wed Aug 9 07:33:26 2023 +0200 sc: fix tiledrendering test execution order issue with comment IDs ScPostIt::mnLastPostItId is a static variable, which is used for generated the comment ID. In the test we depend that the ID are consistent and start with 1, but as we have more tests that insert comments this can be a problem. testCommentCallback and testCommentCellCopyPaste, both add comments and the expected execution order is testCommentCallback and then testCommentCellCopyPaste, so the latter test resets the mnLastPostItId variable to 1, so the IDs are consistent. In a LO 7.6 build for Fedora, it happened that the testCommentCellCopyPaste was executed first and testCommentCallback afterwards, but in testCommentCallback we do not reset the mnLastPostItId and the build failed. This change resets the mnLastPostItId also in testCommentCallback. Change-Id: I123b2f47b0d6177b2f5bdefcf6d8e9c301a7413b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155498 Tested-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index c0fc36968c58..35304683e724 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -1079,6 +1079,9 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCallback) // Comments callback are emitted only if tiled annotations are off comphelper::LibreOfficeKit::setTiledAnnotations(false); + // FIXME: Hack because previous tests do not destroy ScDocument(with annotations) on exit (?). + ScPostIt::mnLastPostItId = 1; + { ScModelObj* pModelObj = createDoc("small.ods"); ViewCallback aView1;