Skip to content

Commit

Permalink
Add explicit test for unhandled events
Browse files Browse the repository at this point in the history
  • Loading branch information
dziegel committed Jan 22, 2024
1 parent f62f46f commit c106031
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/ScXmlFsmImpl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c106031

Please sign in to comment.