summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-10 21:23:43 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-11-24 21:58:21 +0100
commit2905930f8047d32cd19f34b2551296dd2c6fa045 (patch)
tree746106c322f72bf1c4eff718b7084bce34b7923c
parentc03f522db21f009fefd41665fc6fe8130fe5bf1a (diff)
make CppunitTest_framework_dispatch reliable
the appearance of 2 interceptions is reproducible for me on linux with make CppunitTest_framework_dispatch VALGRIND=memcheck 1st time #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0 #7 framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:110 #8 non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:0 #9 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:94 #10 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172 2nd time #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0 #7 SfxStateCache::GetSlotServer(SfxDispatcher&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&) at core/sfx2/source/control/statcach.cxx:263 #8 SfxBindings::UpdateSlotServer_Impl() at core/sfx2/source/control/bindings.cxx:1083 #9 SfxBindings::NextJob_Impl(Timer const*) at core/sfx2/source/control/bindings.cxx:1254 #10 SfxBindings::NextJob(Timer*) at core/sfx2/source/control/bindings.cxx:1222 #11 SfxBindings::LinkStubNextJob(void*, Timer*) at core/sfx2/source/control/bindings.cxx:1219 #12 Link<Timer*, void>::Call(Timer*) const at core/include/tools/link.hxx:111 #13 Timer::Invoke() at core/vcl/source/app/timer.cxx:76 #14 Scheduler::CallbackTaskScheduling() at core/vcl/source/app/scheduler.cxx:480 #15 SalTimer::CallCallback() at core/vcl/inc/saltimer.hxx:55 #16 SvpSalInstance::CheckTimeout(bool) at core/vcl/headless/svpinst.cxx:161 #17 SvpSalInstance::ImplYield(bool, bool) at core/vcl/headless/svpinst.cxx:399 #18 SvpSalInstance::DoYield(bool, bool) at core/vcl/headless/svpinst.cxx:471 #19 ImplYield(bool, bool) at core/vcl/source/app/svapp.cxx:377 #20 Scheduler::ProcessEventsToIdle() at core/vcl/source/app/svapp.cxx:407 #21 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:95 #22 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172 setting bold/italic will invalidate the slot for the property and timer starts to update the normal listeners to those properties which might kick in on a slower run. Change-Id: Ib37e61c0fbed463f8974d476158e54a0160a2c92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157798 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 30c582a7202b1403e260af933258d456e7280a19)
-rw-r--r--framework/qa/cppunit/dispatchtest.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx
index 7903715e4113..68d68f63f872 100644
--- a/framework/qa/cppunit/dispatchtest.cxx
+++ b/framework/qa/cppunit/dispatchtest.cxx
@@ -184,10 +184,9 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception)
xRegistration->registerDispatchProviderInterceptor(uno::Reference<frame::XDispatchProviderInterceptor>(pInterceptor.get()));
dispatchCommand(mxComponent, ".uno:Bold", {});
- CPPUNIT_ASSERT_EQUAL(1, pInterceptor->getExpected());
+ CPPUNIT_ASSERT_GREATER(0, pInterceptor->getExpected());
CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected());
dispatchCommand(mxComponent, ".uno:Italic", {});
- CPPUNIT_ASSERT_EQUAL(1, pInterceptor->getExpected());
// This was 1: MyInterceptor::queryDispatch() was called for .uno:Italic.
CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected());
}