Mishaal 9211a047e8
Updates for FPPTest corresponding to UT cmake update for protected/private (#3810)
* Updates for FppTest/dp and FppTest/component corresponding to UT cmake update for protected/private

* Refactor Fpp/state_machine/internal_instance/state teststo be in their own Tester classes

* Standardize headers

* Remove old ifndef from BasicGuardTester.hpp

* More cleanup of BasicGuardTester

* Remove extra /dp files (leftover from rename) and fix a header comment typo

* Revert accidentally checked in cmake

* Enable UT_AUTO_HELPERS for FppTest/dp

* Revert FppTest/state_machine/internal_instance/state

* Update state_machine/internal_instance/state/ component names to append Tester

* pdate state_machine/internal_instance/choice/ component names

* Update state_machine/internal_instance/initial/ component names

* Reformat code

---------

Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov>
2025-07-18 09:36:46 -07:00

116 lines
4.1 KiB
C++

// ======================================================================
// \title BasicTester.hpp
// \author bocchino
// \brief hpp file for BasicTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_Basic_HPP
#define FppTest_SmInstanceState_Basic_HPP
#include "FppTest/state_machine/internal/harness/Harness.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicComponentAc.hpp"
namespace FppTest {
namespace SmInstanceState {
class BasicTester : public BasicComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
//! The history size
static constexpr FwSizeType historySize = 10;
//! The queue depth
static constexpr FwSizeType queueDepth = 10;
//! The instance ID
static constexpr FwEnumStoreType instanceId = 0;
private:
// ----------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------
//! The type FppTest_SmInstanceState_Basic_Basic
using Basic_Basic = FppTest_SmInstanceState_Basic_Basic;
//! The type FppTest_SmState_Basic
using SmState_Basic = FppTest_SmState_Basic;
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct Basic object
BasicTester(const char* const compName //!< The component name
);
//! Destroy Basic object
~BasicTester();
private:
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
//! Handler implementation for schedIn
void schedIn_handler(FwIndexType portNum, //!< The port number
U32 context //!< The call order
) override;
private:
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
//! Implementation for action a of state machine FppTest_SmInstanceState_Basic_Basic
//!
//! Action a
void FppTest_SmInstanceState_Basic_Basic_action_a(
SmId smId, //!< The state machine id
FppTest_SmInstanceState_Basic_Basic::Signal signal //!< The signal
) override;
//! Implementation for action a of state machine FppTest_SmState_Basic
//!
//! Action a
void FppTest_SmState_Basic_action_a(SmId smId, //!< The state machine id
FppTest_SmState_Basic::Signal signal //!< The signal
) override;
public:
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
//! Run the test
void test();
private:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
//! The history associated with action a of basic1
SmHarness::History<Basic_Basic::Signal, historySize> m_basic1_action_a_history;
//! The history associated with action a of basic2
SmHarness::History<Basic_Basic::Signal, historySize> m_basic2_action_a_history;
//! The history associated with action a of smStateBasic1
SmHarness::History<SmState_Basic::Signal, historySize> m_smStateBasic1_action_a_history;
//! The history associated with action a of smStateBasic2
SmHarness::History<SmState_Basic::Signal, historySize> m_smStateBasic2_action_a_history;
};
} // namespace SmInstanceState
} // namespace FppTest
#endif