ifw-slm 0.1.2
 
Loading...
Searching...
No Matches
testSuspendedActions.cpp File Reference

Unit tests for the suspended loop actions. More...

#include <ifw/slm/framework/actionMgr.hpp>
#include <ifw/slm/framework/dataContext.hpp>
#include <ifw/slm/framework/baseLoopActions.hpp>
#include <ifw/slm/framework/loopCompletionHandler.hpp>
#include <rad/application.hpp>
#include <gtest/gtest.h>

Classes

class  ifw::slm::TestableLoop1Suspended
 
class  ifw::slm::TestSuspendedActions
 Test fixture for suspended actions. More...
 

Namespaces

namespace  ifw
 
namespace  ifw::slm
 

Functions

 ifw::slm::TEST_F (TestSuspendedActions, CreateLoop1SuspendedActions)
 The factory creates a suspended action group for loop 1.
 
 ifw::slm::TEST_F (TestSuspendedActions, CreateLoopSuspendedActions_ValidRange)
 The factory creates a suspended action group for every loop (1-9).
 
 ifw::slm::TEST_F (TestSuspendedActions, ExecuteMarksSuspendedWithoutError)
 Execute() (entering Suspended) marks the loop SUSPENDED and is not a cycle error.
 
 ifw::slm::TEST_F (TestSuspendedActions, AbortDoesNotCountAsError)
 Abort() (Resume/Open) is a clean transition: it must not increment the consecutive-error count.
 
 ifw::slm::TEST_F (TestSuspendedActions, CompleteResetsErrors)
 Complete() clears a pending error count.
 

Detailed Description

Unit tests for the suspended loop actions.

Author

Covers two things:

  • the ActionMgr factory creates a suspended action group for every loop index (1-9), and
  • the ActionsLoopSuspended<N> template overrides drive the per-loop OLDB state correctly: Execute() marks the loop SUSPENDED without counting a cycle error, while Abort() (Resume/Open) is a clean transition that does not bump the error count.

The in-memory state transitions are asserted through a Testable subclass that exposes the protected LoopStateData; the actual SCXML wiring is exercised by the ETR integration tests.