diff --git a/test/ScXmlFsmImpl.cxx b/test/ScXmlFsmImpl.cxx index a7b267d..e8b4aaa 100644 --- a/test/ScXmlFsmImpl.cxx +++ b/test/ScXmlFsmImpl.cxx @@ -6,14 +6,14 @@ ScXmlFsmImpl::ScXmlFsmImpl() { fsm_.on_handle_event_ = [](ScXmlTest::Ref fsm, ScXmlTest::StateRef state, ScXmlTest::Event event) - { std::cout << fsm.Name() << " State " << state.Name() << " handle event " << event << '\n'; }; + { std::cout << fsm << " State " << state << " handle event " << event << '\n'; }; fsm_.on_state_entry_ = [](ScXmlTest::Ref fsm, ScXmlTest::StateRef state) - { std::cout << fsm.Name() << " Enter " << state.Name() << '\n'; }; + { std::cout << fsm << " Enter " << state << '\n'; }; fsm_.on_state_exit_ = [](ScXmlTest::Ref fsm, ScXmlTest::StateRef state) - { std::cout << fsm.Name() << " Exit " << state.Name() << '\n'; }; + { std::cout << fsm << " Exit " << state << '\n'; }; fsm_.on_unhandled_event_ = [](ScXmlTest::Ref fsm, ScXmlTest::StateRef state, ScXmlTest::Event event) { - std::cout << fsm.Name() << " Unhandled event " << event << " in state " << state.Name() << '\n'; + std::cout << fsm << " Unhandled event " << event << " in state " << state << '\n'; fsm.Implementation()->UnhandledEvent(); }; diff --git a/test/XmiFsm.hxx b/test/XmiFsm.hxx index 1944aff..9f9f647 100644 --- a/test/XmiFsm.hxx +++ b/test/XmiFsm.hxx @@ -40,41 +40,6 @@ using PoolSizeCalculator = cpp_event_framework::SignalPoolElementSizeCalculator; -inline std::ostream& operator<<(std::ostream& os, const cpp_event_framework::Signal::SPtr& event) -{ - switch (event->Id()) - { - case Transition_1::kId: - os << "Transition_1"; - break; - case Transition_2::kId: - os << "Transition_2"; - break; - case Transition_3::kId: - os << "Transition_3"; - break; - case Transition_4::kId: - os << "Transition_4"; - break; - case Transition_6::kId: - os << "Transition_6"; - break; - case Transition_7::kId: - os << "Transition_7"; - break; - case Transition_8::kId: - os << "Transition_8"; - break; - case Internal::kId: - os << "Internal"; - break; - default: - os << "Unknown"; - break; - } - return os; -} - class IXmiFsmImpl; using XmiTestBase = cpp_event_framework::Statemachine; diff --git a/test/XmiFsmImpl.cxx b/test/XmiFsmImpl.cxx index 159732d..7aa09e7 100644 --- a/test/XmiFsmImpl.cxx +++ b/test/XmiFsmImpl.cxx @@ -13,14 +13,14 @@ XmiFsmImpl::XmiFsmImpl() EventPoolAllocator::SetPool(pool); fsm_.on_handle_event_ = [](XmiTest::Ref fsm, XmiTest::StateRef state, XmiTest::Event event) - { std::cout << fsm.Name() << " State " << state.Name() << " handle event " << event << '\n'; }; + { std::cout << fsm << " State " << state << " handle event " << event << '\n'; }; fsm_.on_state_entry_ = [](XmiTest::Ref fsm, XmiTest::StateRef state) - { std::cout << fsm.Name() << " Enter " << state.Name() << '\n'; }; + { std::cout << fsm << " Enter " << state << '\n'; }; fsm_.on_state_exit_ = [](XmiTest::Ref fsm, XmiTest::StateRef state) - { std::cout << fsm.Name() << " Exit " << state.Name() << '\n'; }; + { std::cout << fsm << " Exit " << state << '\n'; }; fsm_.on_unhandled_event_ = [](XmiTest::Ref fsm, XmiTest::StateRef state, XmiTest::Event event) { - std::cout << fsm.Name() << " Unhandled event " << event << " in state " << state.Name() << '\n'; + std::cout << fsm << " Unhandled event " << event << " in state " << state << '\n'; fsm.Implementation()->UnhandledEvent(); };