diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-10 21:23:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-11 15:20:30 +0200 |
commit | 30c582a7202b1403e260af933258d456e7280a19 (patch) | |
tree | 0327f42b5e5dee8532881155ad5241326ade5846 /framework | |
parent | 5082d50d24c3fec4487c724a15eb0d54a82ecd0d (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>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/qa/cppunit/dispatchtest.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx index 9549ef150904..43837845b04c 100644 --- a/framework/qa/cppunit/dispatchtest.cxx +++ b/framework/qa/cppunit/dispatchtest.cxx @@ -163,10 +163,9 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception) xRegistration->registerDispatchProviderInterceptor(pInterceptor); 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()); } |