From c106031fbaacba474cc5f51f05ab626ed39cef33 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Mon, 22 Jan 2024 08:08:22 +0100 Subject: [PATCH] Add explicit test for unhandled events --- test/ScXmlFsmImpl.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/ScXmlFsmImpl.cxx b/test/ScXmlFsmImpl.cxx index 3846041..a7b267d 100644 --- a/test/ScXmlFsmImpl.cxx +++ b/test/ScXmlFsmImpl.cxx @@ -35,6 +35,13 @@ void ScXmlFsmImpl::Test() state2_on_entry_called_ = false; CheckAllFalse(); + // Send event that is not handled in state + fsm_.React(EScXmlEvent::Transition_3); + assert(fsm_.CurrentState() == &ScXmlTest::kState_1State_2); + assert(on_unhandled_event_called_); + on_unhandled_event_called_ = false; + CheckAllFalse(); + // Internal transition, action must be called. fsm_.React(EScXmlEvent::Internal); assert(fsm_.CurrentState() == &ScXmlTest::kState_1State_2);