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>
This commit is contained in:
Mishaal 2025-07-18 09:36:46 -07:00 committed by GitHub
parent 6cd812658b
commit 9211a047e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
90 changed files with 1965 additions and 1985 deletions

View File

@ -54,7 +54,8 @@ set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/fpp_types.fpp"
"${CMAKE_CURRENT_LIST_DIR}/port_index_enums.fpp"
"${CMAKE_CURRENT_LIST_DIR}/port_types.fpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.hpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/ActiveTestTester.cpp"
)
# Needed for compiling files using Tester.hpp from outside the directory
include_directories("${CMAKE_CURRENT_LIST_DIR}/test/ut")

View File

@ -1,19 +1,18 @@
// ======================================================================
// \title ActiveTest/test/ut/Tester.cpp
// \title ActiveTest/test/ut/ActiveTestActiveTestTester.cpp
// \author tiffany
// \brief cpp file for ActiveTest test harness implementation class
// ======================================================================
#include "Tester.hpp"
#include "ActiveTestTester.hpp"
#include "STest/Pick/Pick.hpp"
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
Tester ::Tester()
: ActiveTestGTestBase("Tester", Tester::MAX_HISTORY_SIZE),
ActiveTestTester ::ActiveTestTester()
: ActiveTestGTestBase("ActiveTestTester", ActiveTestTester::MAX_HISTORY_SIZE),
component("ActiveTest"),
primitiveBuf(primitiveData, sizeof(primitiveData)),
stringBuf(stringData, sizeof(stringData)),
@ -28,14 +27,16 @@ Tester ::Tester()
this->component.registerExternalParameters(&this->paramTesterDelegate);
}
Tester ::~Tester() {}
ActiveTestTester ::~ActiveTestTester() {}
void Tester ::initComponents() {
void ActiveTestTester ::initComponents() {
this->init();
this->component.init(Tester::TEST_INSTANCE_QUEUE_DEPTH, Tester::TEST_INSTANCE_ID);
this->component.init(ActiveTestTester::TEST_INSTANCE_QUEUE_DEPTH, ActiveTestTester::TEST_INSTANCE_ID);
}
Fw::ParamValid Tester ::from_prmGetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
Fw::ParamValid ActiveTestTester ::from_prmGetIn_handler(const FwIndexType portNum,
FwPrmIdType id,
Fw::ParamBuffer& val) {
val.resetSer();
Fw::SerializeStatus status;
@ -80,7 +81,7 @@ Fw::ParamValid Tester ::from_prmGetIn_handler(const FwIndexType portNum, FwPrmId
return prmValid;
}
void Tester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
void ActiveTestTester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
Fw::SerializeStatus status;
U32 id_base = component.getIdBase();
@ -121,98 +122,89 @@ void Tester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, F
this->pushFromPortEntry_prmSetIn(id, val);
}
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
Fw::SerializeStatus Tester::ActiveTestComponentBaseParamExternalDelegate ::
deserializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
const Fw::ParamValid prmStat,
Fw::SerializeBufferBase& buff
)
{
Fw::SerializeStatus stat;
(void) base_id;
Fw::SerializeStatus ActiveTestTester::ActiveTestComponentBaseParamExternalDelegate ::deserializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
const Fw::ParamValid prmStat,
Fw::SerializeBufferBase& buff) {
Fw::SerializeStatus stat;
(void)base_id;
// Serialize the parameter based on ID
switch(local_id)
{
// ParamBoolExternal
case ActiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.deserialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case ActiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.deserialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case ActiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.deserialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case ActiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.deserialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
// Serialize the parameter based on ID
switch (local_id) {
// ParamBoolExternal
case ActiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.deserialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case ActiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.deserialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case ActiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.deserialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case ActiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.deserialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
return stat;
}
Fw::SerializeStatus Tester::ActiveTestComponentBaseParamExternalDelegate ::
serializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
Fw::SerializeBufferBase& buff
) const
{
Fw::SerializeStatus stat;
(void) base_id;
Fw::SerializeStatus ActiveTestTester::ActiveTestComponentBaseParamExternalDelegate ::serializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
Fw::SerializeBufferBase& buff) const {
Fw::SerializeStatus stat;
(void)base_id;
// Serialize the parameter based on ID
switch(local_id)
{
// ParamBoolExternal
case ActiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.serialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case ActiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.serialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.serialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case ActiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.serialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case ActiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.serialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.serialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
// Serialize the parameter based on ID
switch (local_id) {
// ParamBoolExternal
case ActiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.serialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case ActiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.serialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.serialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case ActiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.serialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case ActiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.serialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case ActiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.serialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
return stat;
}

View File

@ -0,0 +1,250 @@
// ======================================================================
// \title ActiveTest/test/ut/ActiveTestTester.hpp
// \author tiffany
// \brief hpp file for ActiveTest test harness implementation class
// ======================================================================
#ifndef ACTIVE_TEST_TESTER_HPP
#define ACTIVE_TEST_TESTER_HPP
#include "ActiveTestGTestBase.hpp"
#include "FppTest/component/active/ActiveTest.hpp"
#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
#include "FppTest/component/active/TypedPortIndexEnumAc.hpp"
#include "FppTest/component/tests/CmdTests.hpp"
#include "FppTest/component/tests/EventTests.hpp"
#include "FppTest/component/tests/ExternalParamTests.hpp"
#include "FppTest/component/tests/InternalInterfaceTests.hpp"
#include "FppTest/component/tests/ParamTests.hpp"
#include "FppTest/component/tests/PortTests.hpp"
#include "FppTest/component/tests/TlmTests.hpp"
#include "FppTest/component/types/FormalParamTypes.hpp"
class ActiveTestTester : public ActiveTestGTestBase {
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
public:
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 100;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test
static const FwSizeType TEST_INSTANCE_QUEUE_DEPTH = 10;
//! Construct object ActiveTestTester
//!
ActiveTestTester();
//! Destroy object ActiveTestTester
//!
~ActiveTestTester();
public:
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
PORT_TEST_DECLS
PORT_TEST_DECLS_ASYNC
CMD_TEST_DECLS
CMD_TEST_DECLS_ASYNC
EVENT_TEST_DECLS
TLM_TEST_DECLS
void testParam();
PARAM_CMD_TEST_DECLS
void testExternalParam();
EXTERNAL_PARAM_CMD_TEST_DECLS
INTERNAL_INT_TEST_DECLS
void testTime();
void testOverflowAssert();
void testOverflowDrop();
void testOverflowHook();
private:
#include "FppTest/component/common/tester.hpp"
private:
// ----------------------------------------------------------------------
// Handlers for serial from ports
// ----------------------------------------------------------------------
//! Handler for from_serialOut
//!
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& Buffer //!< The serialization buffer
) final;
public:
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
//! Connect ports
//!
void connectPorts();
//! Connect async ports
void connectAsyncPorts();
//! Connect prmSetIn port
void connectPrmSetIn();
//! Connect timeGetOut port
void connectTimeGetOut();
//! Connect serial ports to special ports
void connectSpecialPortsSerial();
//! Set prmValid
void setPrmValid(Fw::ParamValid valid);
//! Call doDispatch() on component under test
Fw::QueuedComponentBase::MsgDispatchStatus doDispatch();
//! Initialize components
//!
void initComponents();
//! Check successful status of a serial port invocation
void checkSerializeStatusSuccess();
//! Check unsuccessful status of a serial port invocation
void checkSerializeStatusBufferEmpty();
private:
// ----------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------
//! The component under test
//!
ActiveTest component;
// Values returned by typed output ports
FppTest::Types::BoolType noParamReturnVal;
FppTest::Types::U32Type primitiveReturnVal;
FppTest::Types::EnumType enumReturnVal;
FppTest::Types::ArrayType arrayReturnVal;
FppTest::Types::StructType structReturnVal;
FppTest::Types::StringType stringReturnVal;
FppTest::Types::StringType stringAliasReturnVal;
FppTest::Types::AliasStringArrayType arrayStringAliasReturnVal;
// Buffers from serial output ports;
U8 primitiveData[InputPrimitiveArgsPort::SERIALIZED_SIZE];
U8 stringData[InputStringArgsPort::SERIALIZED_SIZE];
U8 enumData[InputEnumArgsPort::SERIALIZED_SIZE];
U8 arrayData[InputArrayArgsPort::SERIALIZED_SIZE];
U8 structData[InputStructArgsPort::SERIALIZED_SIZE];
U8 serialData[SERIAL_ARGS_BUFFER_CAPACITY];
Fw::SerialBuffer primitiveBuf;
Fw::SerialBuffer stringBuf;
Fw::SerialBuffer enumBuf;
Fw::SerialBuffer arrayBuf;
Fw::SerialBuffer structBuf;
Fw::SerialBuffer serialBuf;
// Parameter test values
FppTest::Types::BoolParam boolPrm;
FppTest::Types::U32Param u32Prm;
FppTest::Types::PrmStringParam stringPrm;
FppTest::Types::EnumParam enumPrm;
FppTest::Types::ArrayParam arrayPrm;
FppTest::Types::StructParam structPrm;
Fw::ParamValid prmValid;
Fw::Time time;
//! External Parameter Delegate
class ActiveTestComponentBaseParamExternalDelegate : public Fw::ParamExternalDelegate {
public:
// ----------------------------------------------------------------------
// Parameter validity flags
// ----------------------------------------------------------------------
//! True if ParamBoolExternal was successfully received
Fw::ParamValid m_param_ParamBoolExternal_valid;
//! True if ParamI32External was successfully received
Fw::ParamValid m_param_ParamI32External_valid;
//! True if ParamStringExternal was successfully received
Fw::ParamValid m_param_ParamStringExternal_valid;
//! True if ParamEnumExternal was successfully received
Fw::ParamValid m_param_ParamEnumExternal_valid;
//! True if ParamArrayExternal was successfully received
Fw::ParamValid m_param_ParamArrayExternal_valid;
//! True if ParamStructExternal was successfully received
Fw::ParamValid m_param_ParamStructExternal_valid;
public:
// ----------------------------------------------------------------------
// Parameter variables
// ----------------------------------------------------------------------
//! Parameter ParamBoolExternal
bool m_param_ParamBoolExternal;
//! Parameter ParamI32External
I32 m_param_ParamI32External;
//! Parameter ParamStringExternal
Fw::ParamString m_param_ParamStringExternal;
//! Parameter ParamEnumExternal
FormalParamEnum m_param_ParamEnumExternal;
//! Parameter ParamArrayExternal
FormalParamArray m_param_ParamArrayExternal;
//! Parameter ParamStructExternal
FormalParamStruct m_param_ParamStructExternal;
public:
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
//! Parameter deserialization function for external parameter unit testing
Fw::SerializeStatus deserializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to deserialize
const FwPrmIdType local_id, //!< The parameter local ID to deserialize
const Fw::ParamValid prmStat, //!< The parameter validity status
Fw::SerializeBufferBase& buff //!< The buffer containing the parameter to deserialize
) override;
//! Parameter serialization function for external parameter unit testing
Fw::SerializeStatus serializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerializeBufferBase& buff //!< The buffer to serialize the parameter into
) const override;
};
// ----------------------------------------------------------------------
// Parameter delegates
// ----------------------------------------------------------------------
//! Delegate to serialize/deserialize an externally stored parameter
ActiveTestComponentBaseParamExternalDelegate paramTesterDelegate;
};
typedef ActiveTestTester Tester;
#endif

View File

@ -1,258 +1,9 @@
// ======================================================================
// \title ActiveTest/test/ut/Tester.hpp
// \author tiffany
// \brief hpp file for ActiveTest test harness implementation class
// ======================================================================
#ifndef TESTER_HPP
#define TESTER_HPP
#include "ActiveTestGTestBase.hpp"
#include "FppTest/component/active/ActiveTest.hpp"
#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
#include "FppTest/component/active/TypedPortIndexEnumAc.hpp"
#include "FppTest/component/tests/CmdTests.hpp"
#include "FppTest/component/tests/EventTests.hpp"
#include "FppTest/component/tests/InternalInterfaceTests.hpp"
#include "FppTest/component/tests/ParamTests.hpp"
#include "FppTest/component/tests/ExternalParamTests.hpp"
#include "FppTest/component/tests/PortTests.hpp"
#include "FppTest/component/tests/TlmTests.hpp"
#include "FppTest/component/types/FormalParamTypes.hpp"
class Tester : public ActiveTestGTestBase {
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
public:
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 100;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test
static const FwSizeType TEST_INSTANCE_QUEUE_DEPTH = 10;
//! Construct object Tester
//!
Tester();
//! Destroy object Tester
//!
~Tester();
public:
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
PORT_TEST_DECLS
PORT_TEST_DECLS_ASYNC
CMD_TEST_DECLS
CMD_TEST_DECLS_ASYNC
EVENT_TEST_DECLS
TLM_TEST_DECLS
void testParam();
PARAM_CMD_TEST_DECLS
void testExternalParam();
EXTERNAL_PARAM_CMD_TEST_DECLS
INTERNAL_INT_TEST_DECLS
void testTime();
void testOverflowAssert();
void testOverflowDrop();
void testOverflowHook();
private:
#include "FppTest/component/common/tester.hpp"
private:
// ----------------------------------------------------------------------
// Handlers for serial from ports
// ----------------------------------------------------------------------
//! Handler for from_serialOut
//!
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& Buffer //!< The serialization buffer
) final;
public:
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
//! Connect ports
//!
void connectPorts();
//! Connect async ports
void connectAsyncPorts();
//! Connect prmSetIn port
void connectPrmSetIn();
//! Connect timeGetOut port
void connectTimeGetOut();
//! Connect serial ports to special ports
void connectSpecialPortsSerial();
//! Set prmValid
void setPrmValid(Fw::ParamValid valid);
//! Call doDispatch() on component under test
Fw::QueuedComponentBase::MsgDispatchStatus doDispatch();
//! Initialize components
//!
void initComponents();
//! Check successful status of a serial port invocation
void checkSerializeStatusSuccess();
//! Check unsuccessful status of a serial port invocation
void checkSerializeStatusBufferEmpty();
private:
// ----------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------
//! The component under test
//!
ActiveTest component;
// Values returned by typed output ports
FppTest::Types::BoolType noParamReturnVal;
FppTest::Types::U32Type primitiveReturnVal;
FppTest::Types::EnumType enumReturnVal;
FppTest::Types::ArrayType arrayReturnVal;
FppTest::Types::StructType structReturnVal;
FppTest::Types::StringType stringReturnVal;
FppTest::Types::StringType stringAliasReturnVal;
FppTest::Types::AliasStringArrayType arrayStringAliasReturnVal;
// Buffers from serial output ports;
U8 primitiveData[InputPrimitiveArgsPort::SERIALIZED_SIZE];
U8 stringData[InputStringArgsPort::SERIALIZED_SIZE];
U8 enumData[InputEnumArgsPort::SERIALIZED_SIZE];
U8 arrayData[InputArrayArgsPort::SERIALIZED_SIZE];
U8 structData[InputStructArgsPort::SERIALIZED_SIZE];
U8 serialData[SERIAL_ARGS_BUFFER_CAPACITY];
Fw::SerialBuffer primitiveBuf;
Fw::SerialBuffer stringBuf;
Fw::SerialBuffer enumBuf;
Fw::SerialBuffer arrayBuf;
Fw::SerialBuffer structBuf;
Fw::SerialBuffer serialBuf;
// Parameter test values
FppTest::Types::BoolParam boolPrm;
FppTest::Types::U32Param u32Prm;
FppTest::Types::PrmStringParam stringPrm;
FppTest::Types::EnumParam enumPrm;
FppTest::Types::ArrayParam arrayPrm;
FppTest::Types::StructParam structPrm;
Fw::ParamValid prmValid;
Fw::Time time;
//! External Parameter Delegate
class ActiveTestComponentBaseParamExternalDelegate :
public Fw::ParamExternalDelegate
{
public:
// ----------------------------------------------------------------------
// Parameter validity flags
// ----------------------------------------------------------------------
//! True if ParamBoolExternal was successfully received
Fw::ParamValid m_param_ParamBoolExternal_valid;
//! True if ParamI32External was successfully received
Fw::ParamValid m_param_ParamI32External_valid;
//! True if ParamStringExternal was successfully received
Fw::ParamValid m_param_ParamStringExternal_valid;
//! True if ParamEnumExternal was successfully received
Fw::ParamValid m_param_ParamEnumExternal_valid;
//! True if ParamArrayExternal was successfully received
Fw::ParamValid m_param_ParamArrayExternal_valid;
//! True if ParamStructExternal was successfully received
Fw::ParamValid m_param_ParamStructExternal_valid;
public:
// ----------------------------------------------------------------------
// Parameter variables
// ----------------------------------------------------------------------
//! Parameter ParamBoolExternal
bool m_param_ParamBoolExternal;
//! Parameter ParamI32External
I32 m_param_ParamI32External;
//! Parameter ParamStringExternal
Fw::ParamString m_param_ParamStringExternal;
//! Parameter ParamEnumExternal
FormalParamEnum m_param_ParamEnumExternal;
//! Parameter ParamArrayExternal
FormalParamArray m_param_ParamArrayExternal;
//! Parameter ParamStructExternal
FormalParamStruct m_param_ParamStructExternal;
public:
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
//! Parameter deserialization function for external parameter unit testing
Fw::SerializeStatus deserializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to deserialize
const FwPrmIdType local_id, //!< The parameter local ID to deserialize
const Fw::ParamValid prmStat, //!< The parameter validity status
Fw::SerializeBufferBase& buff //!< The buffer containing the parameter to deserialize
) override;
//! Parameter serialization function for external parameter unit testing
Fw::SerializeStatus serializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerializeBufferBase& buff //!< The buffer to serialize the parameter into
) const override;
};
// ----------------------------------------------------------------------
// Parameter delegates
// ----------------------------------------------------------------------
//! Delegate to serialize/deserialize an externally stored parameter
ActiveTestComponentBaseParamExternalDelegate paramTesterDelegate;
};
// ActiveTestTester is the full implementation - using it as the Tester class
#include "ActiveTestTester.hpp"
class ActiveTestTester;
typedef ActiveTestTester Tester;
#endif

View File

@ -29,7 +29,7 @@ set(UT_MOD_DEPS
# UT_SOURCE_FILES: Sources for unit test
set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/passive.fpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.hpp"
"${CMAKE_CURRENT_LIST_DIR}/../tests/TestMain.cpp"
"${CMAKE_CURRENT_LIST_DIR}/../tests/Tests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/../tests/TesterHandlers.cpp"
@ -43,6 +43,7 @@ set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/../tests/TimeTests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/../types/FormalParamTypes.cpp"
"${CMAKE_CURRENT_LIST_DIR}/../../utils/Utils.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/PassiveTestTester.cpp"
)
# Needed for compiling files using Tester.hpp from outside the directory
include_directories("${CMAKE_CURRENT_LIST_DIR}/test/ut")

View File

@ -0,0 +1,209 @@
// ======================================================================
// \title PassiveTest/test/ut/PassiveTestTester.cpp
// \author tiffany
// \brief cpp file for PassiveTest test harness implementation class
// ======================================================================
#include "PassiveTestTester.hpp"
#include "STest/Pick/Pick.hpp"
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
PassiveTestTester ::PassiveTestTester()
: PassiveTestGTestBase("PassiveTestTester", PassiveTestTester::MAX_HISTORY_SIZE),
component("PassiveTest"),
primitiveBuf(primitiveData, sizeof(primitiveData)),
stringBuf(stringData, sizeof(stringData)),
enumBuf(enumData, sizeof(enumData)),
arrayBuf(arrayData, sizeof(arrayData)),
structBuf(structData, sizeof(structData)),
serialBuf(serialData, sizeof(serialData)),
time(STest::Pick::any(), STest::Pick::any()) {
this->initComponents();
this->connectPorts();
this->component.registerExternalParameters(&this->paramTesterDelegate);
}
PassiveTestTester ::~PassiveTestTester() {}
void PassiveTestTester ::initComponents() {
this->init();
this->component.init(PassiveTestTester::TEST_INSTANCE_ID);
}
Fw::ParamValid PassiveTestTester ::from_prmGetIn_handler(const FwIndexType portNum,
FwPrmIdType id,
Fw::ParamBuffer& val) {
val.resetSer();
Fw::SerializeStatus status;
U32 id_base = component.getIdBase();
FW_ASSERT(id >= id_base);
switch (id - id_base) {
case PassiveTestComponentBase::PARAMID_PARAMBOOL:
status = val.serialize(boolPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMU32:
status = val.serialize(u32Prm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRING:
status = val.serialize(stringPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMENUM:
status = val.serialize(enumPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMARRAY:
status = val.serialize(arrayPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRUCT:
status = val.serialize(structPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
}
this->pushFromPortEntry_prmGetIn(id, val);
return prmValid;
}
void PassiveTestTester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
Fw::SerializeStatus status;
U32 id_base = component.getIdBase();
FW_ASSERT(id >= id_base);
switch (id - id_base) {
case PassiveTestComponentBase::PARAMID_PARAMBOOL:
status = val.deserialize(boolPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMU32:
status = val.deserialize(u32Prm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRING:
status = val.deserialize(stringPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMENUM:
status = val.deserialize(enumPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMARRAY:
status = val.deserialize(arrayPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRUCT:
status = val.deserialize(structPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
}
this->pushFromPortEntry_prmSetIn(id, val);
}
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
Fw::SerializeStatus PassiveTestTester::PassiveTestComponentBaseParamExternalDelegate ::deserializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
const Fw::ParamValid prmStat,
Fw::SerializeBufferBase& buff) {
Fw::SerializeStatus stat;
(void)base_id;
// Serialize the parameter based on ID
switch (local_id) {
// ParamBoolExternal
case PassiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.deserialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case PassiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.deserialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case PassiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.deserialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case PassiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.deserialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
}
Fw::SerializeStatus PassiveTestTester::PassiveTestComponentBaseParamExternalDelegate ::serializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
Fw::SerializeBufferBase& buff) const {
Fw::SerializeStatus stat;
(void)base_id;
// Serialize the parameter based on ID
switch (local_id) {
// ParamBoolExternal
case PassiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.serialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case PassiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.serialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.serialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case PassiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.serialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case PassiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.serialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.serialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
}

View File

@ -0,0 +1,232 @@
// ======================================================================
// \title PassiveTest/test/ut/PassiveTestTester.hpp
// \author tiffany
// \brief hpp file for PassiveTest test harness implementation class
// ======================================================================
#ifndef PASSIVE_TEST_TESTER_HPP
#define PASSIVE_TEST_TESTER_HPP
#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
#include "FppTest/component/active/TypedPortIndexEnumAc.hpp"
#include "FppTest/component/passive/PassiveTest.hpp"
#include "FppTest/component/tests/CmdTests.hpp"
#include "FppTest/component/tests/EventTests.hpp"
#include "FppTest/component/tests/ExternalParamTests.hpp"
#include "FppTest/component/tests/ParamTests.hpp"
#include "FppTest/component/tests/PortTests.hpp"
#include "FppTest/component/tests/TlmTests.hpp"
#include "FppTest/component/types/FormalParamTypes.hpp"
#include "PassiveTestGTestBase.hpp"
class PassiveTestTester : public PassiveTestGTestBase {
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
public:
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 100;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test
static const FwSizeType TEST_INSTANCE_QUEUE_DEPTH = 10;
//! Construct object PassiveTestTester
//!
PassiveTestTester();
//! Destroy object PassiveTestTester
//!
~PassiveTestTester();
public:
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
PORT_TEST_DECLS
CMD_TEST_DECLS
EVENT_TEST_DECLS
TLM_TEST_DECLS
void testParam();
PARAM_CMD_TEST_DECLS
void testExternalParam();
EXTERNAL_PARAM_CMD_TEST_DECLS
void testTime();
private:
#include "FppTest/component/common/tester.hpp"
private:
// ----------------------------------------------------------------------
// Handlers for serial from ports
// ----------------------------------------------------------------------
//! Handler for from_serialOut
//!
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& Buffer //!< The serialization buffer
);
public:
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
//! Connect ports
//!
void connectPorts();
//! Connect prmSetIn port
void connectPrmSetIn();
//! Connect timeGetOut port
void connectTimeGetOut();
//! Connect serial ports to special ports
void connectSpecialPortsSerial();
//! Set prmValid
void setPrmValid(Fw::ParamValid valid);
//! Initialize components
//!
void initComponents();
//! Check successful status of a serial port invocation
void checkSerializeStatusSuccess();
//! Check unsuccessful status of a serial port invocation
void checkSerializeStatusBufferEmpty();
private:
// ----------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------
//! The component under test
//!
PassiveTest component;
// Values returned by typed output ports
FppTest::Types::BoolType noParamReturnVal;
FppTest::Types::U32Type primitiveReturnVal;
FppTest::Types::EnumType enumReturnVal;
FppTest::Types::ArrayType arrayReturnVal;
FppTest::Types::StructType structReturnVal;
FppTest::Types::StringType stringReturnVal;
FppTest::Types::StringType stringAliasReturnVal;
FppTest::Types::AliasStringArrayType arrayStringAliasReturnVal;
// Buffers from serial output ports;
U8 primitiveData[InputPrimitiveArgsPort::SERIALIZED_SIZE];
U8 stringData[InputStringArgsPort::SERIALIZED_SIZE];
U8 enumData[InputEnumArgsPort::SERIALIZED_SIZE];
U8 arrayData[InputArrayArgsPort::SERIALIZED_SIZE];
U8 structData[InputStructArgsPort::SERIALIZED_SIZE];
U8 serialData[SERIAL_ARGS_BUFFER_CAPACITY];
Fw::SerialBuffer primitiveBuf;
Fw::SerialBuffer stringBuf;
Fw::SerialBuffer enumBuf;
Fw::SerialBuffer arrayBuf;
Fw::SerialBuffer structBuf;
Fw::SerialBuffer serialBuf;
// Parameter test values
FppTest::Types::BoolParam boolPrm;
FppTest::Types::U32Param u32Prm;
FppTest::Types::PrmStringParam stringPrm;
FppTest::Types::EnumParam enumPrm;
FppTest::Types::ArrayParam arrayPrm;
FppTest::Types::StructParam structPrm;
Fw::ParamValid prmValid;
// Time test values
Fw::Time time;
//! External Parameter Delegate
class PassiveTestComponentBaseParamExternalDelegate : public Fw::ParamExternalDelegate {
public:
// ----------------------------------------------------------------------
// Parameter validity flags
// ----------------------------------------------------------------------
//! True if ParamBoolExternal was successfully received
Fw::ParamValid m_param_ParamBoolExternal_valid;
//! True if ParamI32External was successfully received
Fw::ParamValid m_param_ParamI32External_valid;
//! True if ParamStringExternal was successfully received
Fw::ParamValid m_param_ParamStringExternal_valid;
//! True if ParamEnumExternal was successfully received
Fw::ParamValid m_param_ParamEnumExternal_valid;
//! True if ParamArrayExternal was successfully received
Fw::ParamValid m_param_ParamArrayExternal_valid;
//! True if ParamStructExternal was successfully received
Fw::ParamValid m_param_ParamStructExternal_valid;
public:
// ----------------------------------------------------------------------
// Parameter variables
// ----------------------------------------------------------------------
//! Parameter ParamBoolExternal
bool m_param_ParamBoolExternal;
//! Parameter ParamI32External
I32 m_param_ParamI32External;
//! Parameter ParamStringExternal
Fw::ParamString m_param_ParamStringExternal;
//! Parameter ParamEnumExternal
FormalParamEnum m_param_ParamEnumExternal;
//! Parameter ParamArrayExternal
FormalParamArray m_param_ParamArrayExternal;
//! Parameter ParamStructExternal
FormalParamStruct m_param_ParamStructExternal;
public:
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
//! Parameter deserialization function for external parameter unit testing
Fw::SerializeStatus deserializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to deserialize
const FwPrmIdType local_id, //!< The parameter local ID to deserialize
const Fw::ParamValid prmStat, //!< The parameter validity status
Fw::SerializeBufferBase& buff //!< The buffer containing the parameter to deserialize
) override;
//! Parameter serialization function for external parameter unit testing
Fw::SerializeStatus serializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerializeBufferBase& buff //!< The buffer to serialize the parameter into
) const override;
};
// ----------------------------------------------------------------------
// Parameter delegates
// ----------------------------------------------------------------------
//! Delegate to serialize/deserialize an externally stored parameter
PassiveTestComponentBaseParamExternalDelegate paramPassiveTestTesterDelegate;
};
#endif

View File

@ -1,216 +0,0 @@
// ======================================================================
// \title PassiveTest/test/ut/Tester.cpp
// \author tiffany
// \brief cpp file for PassiveTest test harness implementation class
// ======================================================================
#include "STest/Pick/Pick.hpp"
#include "Tester.hpp"
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
Tester ::Tester()
: PassiveTestGTestBase("Tester", Tester::MAX_HISTORY_SIZE),
component("PassiveTest"),
primitiveBuf(primitiveData, sizeof(primitiveData)),
stringBuf(stringData, sizeof(stringData)),
enumBuf(enumData, sizeof(enumData)),
arrayBuf(arrayData, sizeof(arrayData)),
structBuf(structData, sizeof(structData)),
serialBuf(serialData, sizeof(serialData)),
time(STest::Pick::any(), STest::Pick::any()) {
this->initComponents();
this->connectPorts();
this->component.registerExternalParameters(&this->paramTesterDelegate);
}
Tester ::~Tester() {}
void Tester ::initComponents() {
this->init();
this->component.init(Tester::TEST_INSTANCE_ID);
}
Fw::ParamValid Tester ::from_prmGetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
val.resetSer();
Fw::SerializeStatus status;
U32 id_base = component.getIdBase();
FW_ASSERT(id >= id_base);
switch (id - id_base) {
case PassiveTestComponentBase::PARAMID_PARAMBOOL:
status = val.serialize(boolPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMU32:
status = val.serialize(u32Prm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRING:
status = val.serialize(stringPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMENUM:
status = val.serialize(enumPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMARRAY:
status = val.serialize(arrayPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRUCT:
status = val.serialize(structPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
}
this->pushFromPortEntry_prmGetIn(id, val);
return prmValid;
}
void Tester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
Fw::SerializeStatus status;
U32 id_base = component.getIdBase();
FW_ASSERT(id >= id_base);
switch (id - id_base) {
case PassiveTestComponentBase::PARAMID_PARAMBOOL:
status = val.deserialize(boolPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMU32:
status = val.deserialize(u32Prm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRING:
status = val.deserialize(stringPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMENUM:
status = val.deserialize(enumPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMARRAY:
status = val.deserialize(arrayPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
case PassiveTestComponentBase::PARAMID_PARAMSTRUCT:
status = val.deserialize(structPrm.args.val);
FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
break;
}
this->pushFromPortEntry_prmSetIn(id, val);
}
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
Fw::SerializeStatus Tester::PassiveTestComponentBaseParamExternalDelegate ::
deserializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
const Fw::ParamValid prmStat,
Fw::SerializeBufferBase& buff
)
{
Fw::SerializeStatus stat;
(void) base_id;
// Serialize the parameter based on ID
switch(local_id)
{
// ParamBoolExternal
case PassiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.deserialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case PassiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.deserialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case PassiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.deserialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case PassiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.deserialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
}
Fw::SerializeStatus Tester::PassiveTestComponentBaseParamExternalDelegate ::
serializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
Fw::SerializeBufferBase& buff
) const
{
Fw::SerializeStatus stat;
(void) base_id;
// Serialize the parameter based on ID
switch(local_id)
{
// ParamBoolExternal
case PassiveTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.serialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case PassiveTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.serialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.serialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case PassiveTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.serialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case PassiveTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.serialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case PassiveTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.serialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
}

View File

@ -1,240 +1,9 @@
// ======================================================================
// \title PassiveTest/test/ut/Tester.hpp
// \author tiffany
// \brief hpp file for PassiveTest test harness implementation class
// ======================================================================
#ifndef TESTER_HPP
#define TESTER_HPP
#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
#include "FppTest/component/active/TypedPortIndexEnumAc.hpp"
#include "FppTest/component/passive/PassiveTest.hpp"
#include "FppTest/component/tests/CmdTests.hpp"
#include "FppTest/component/tests/EventTests.hpp"
#include "FppTest/component/tests/ParamTests.hpp"
#include "FppTest/component/tests/ExternalParamTests.hpp"
#include "FppTest/component/tests/PortTests.hpp"
#include "FppTest/component/tests/TlmTests.hpp"
#include "FppTest/component/types/FormalParamTypes.hpp"
#include "PassiveTestGTestBase.hpp"
class Tester : public PassiveTestGTestBase {
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
public:
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 100;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test
static const FwSizeType TEST_INSTANCE_QUEUE_DEPTH = 10;
//! Construct object Tester
//!
Tester();
//! Destroy object Tester
//!
~Tester();
public:
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
PORT_TEST_DECLS
CMD_TEST_DECLS
EVENT_TEST_DECLS
TLM_TEST_DECLS
void testParam();
PARAM_CMD_TEST_DECLS
void testExternalParam();
EXTERNAL_PARAM_CMD_TEST_DECLS
void testTime();
private:
#include "FppTest/component/common/tester.hpp"
private:
// ----------------------------------------------------------------------
// Handlers for serial from ports
// ----------------------------------------------------------------------
//! Handler for from_serialOut
//!
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& Buffer //!< The serialization buffer
);
public:
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
//! Connect ports
//!
void connectPorts();
//! Connect prmSetIn port
void connectPrmSetIn();
//! Connect timeGetOut port
void connectTimeGetOut();
//! Connect serial ports to special ports
void connectSpecialPortsSerial();
//! Set prmValid
void setPrmValid(Fw::ParamValid valid);
//! Initialize components
//!
void initComponents();
//! Check successful status of a serial port invocation
void checkSerializeStatusSuccess();
//! Check unsuccessful status of a serial port invocation
void checkSerializeStatusBufferEmpty();
private:
// ----------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------
//! The component under test
//!
PassiveTest component;
// Values returned by typed output ports
FppTest::Types::BoolType noParamReturnVal;
FppTest::Types::U32Type primitiveReturnVal;
FppTest::Types::EnumType enumReturnVal;
FppTest::Types::ArrayType arrayReturnVal;
FppTest::Types::StructType structReturnVal;
FppTest::Types::StringType stringReturnVal;
FppTest::Types::StringType stringAliasReturnVal;
FppTest::Types::AliasStringArrayType arrayStringAliasReturnVal;
// Buffers from serial output ports;
U8 primitiveData[InputPrimitiveArgsPort::SERIALIZED_SIZE];
U8 stringData[InputStringArgsPort::SERIALIZED_SIZE];
U8 enumData[InputEnumArgsPort::SERIALIZED_SIZE];
U8 arrayData[InputArrayArgsPort::SERIALIZED_SIZE];
U8 structData[InputStructArgsPort::SERIALIZED_SIZE];
U8 serialData[SERIAL_ARGS_BUFFER_CAPACITY];
Fw::SerialBuffer primitiveBuf;
Fw::SerialBuffer stringBuf;
Fw::SerialBuffer enumBuf;
Fw::SerialBuffer arrayBuf;
Fw::SerialBuffer structBuf;
Fw::SerialBuffer serialBuf;
// Parameter test values
FppTest::Types::BoolParam boolPrm;
FppTest::Types::U32Param u32Prm;
FppTest::Types::PrmStringParam stringPrm;
FppTest::Types::EnumParam enumPrm;
FppTest::Types::ArrayParam arrayPrm;
FppTest::Types::StructParam structPrm;
Fw::ParamValid prmValid;
// Time test values
Fw::Time time;
//! External Parameter Delegate
class PassiveTestComponentBaseParamExternalDelegate :
public Fw::ParamExternalDelegate
{
public:
// ----------------------------------------------------------------------
// Parameter validity flags
// ----------------------------------------------------------------------
//! True if ParamBoolExternal was successfully received
Fw::ParamValid m_param_ParamBoolExternal_valid;
//! True if ParamI32External was successfully received
Fw::ParamValid m_param_ParamI32External_valid;
//! True if ParamStringExternal was successfully received
Fw::ParamValid m_param_ParamStringExternal_valid;
//! True if ParamEnumExternal was successfully received
Fw::ParamValid m_param_ParamEnumExternal_valid;
//! True if ParamArrayExternal was successfully received
Fw::ParamValid m_param_ParamArrayExternal_valid;
//! True if ParamStructExternal was successfully received
Fw::ParamValid m_param_ParamStructExternal_valid;
public:
// ----------------------------------------------------------------------
// Parameter variables
// ----------------------------------------------------------------------
//! Parameter ParamBoolExternal
bool m_param_ParamBoolExternal;
//! Parameter ParamI32External
I32 m_param_ParamI32External;
//! Parameter ParamStringExternal
Fw::ParamString m_param_ParamStringExternal;
//! Parameter ParamEnumExternal
FormalParamEnum m_param_ParamEnumExternal;
//! Parameter ParamArrayExternal
FormalParamArray m_param_ParamArrayExternal;
//! Parameter ParamStructExternal
FormalParamStruct m_param_ParamStructExternal;
public:
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
//! Parameter deserialization function for external parameter unit testing
Fw::SerializeStatus deserializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to deserialize
const FwPrmIdType local_id, //!< The parameter local ID to deserialize
const Fw::ParamValid prmStat, //!< The parameter validity status
Fw::SerializeBufferBase& buff //!< The buffer containing the parameter to deserialize
) override;
//! Parameter serialization function for external parameter unit testing
Fw::SerializeStatus serializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerializeBufferBase& buff //!< The buffer to serialize the parameter into
) const override;
};
// ----------------------------------------------------------------------
// Parameter delegates
// ----------------------------------------------------------------------
//! Delegate to serialize/deserialize an externally stored parameter
PassiveTestComponentBaseParamExternalDelegate paramTesterDelegate;
};
// PassiveTestTester is the full implementation - using it as the Tester class
#include "PassiveTestTester.hpp"
class PassiveTestTester;
typedef PassiveTestTester Tester;
#endif

View File

@ -29,7 +29,8 @@ set(UT_MOD_DEPS
# UT_SOURCE_FILES: Sources for unit test
set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/queued.fpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.hpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/QueuedTestTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/../tests/TestMain.cpp"
"${CMAKE_CURRENT_LIST_DIR}/../tests/Tests.cpp"
"${CMAKE_CURRENT_LIST_DIR}/../tests/TesterHandlers.cpp"

View File

@ -1,18 +1,18 @@
// ======================================================================
// \title QueuedTest/test/ut/Tester.cpp
// \title QueuedTest/test/ut/QueuedTestTester.cpp
// \author tiffany
// \brief cpp file for QueuedTest test harness implementation class
// ======================================================================
#include "QueuedTestTester.hpp"
#include "STest/Pick/Pick.hpp"
#include "Tester.hpp"
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
Tester ::Tester()
: QueuedTestGTestBase("Tester", Tester::MAX_HISTORY_SIZE),
QueuedTestTester ::QueuedTestTester()
: QueuedTestGTestBase("QueuedTestTester", QueuedTestTester::MAX_HISTORY_SIZE),
component("QueuedTest"),
primitiveBuf(primitiveData, sizeof(primitiveData)),
stringBuf(stringData, sizeof(stringData)),
@ -27,14 +27,16 @@ Tester ::Tester()
this->component.registerExternalParameters(&this->paramTesterDelegate);
}
Tester ::~Tester() {}
QueuedTestTester ::~QueuedTestTester() {}
void Tester ::initComponents() {
void QueuedTestTester ::initComponents() {
this->init();
this->component.init(Tester::TEST_INSTANCE_QUEUE_DEPTH, Tester::TEST_INSTANCE_ID);
this->component.init(QueuedTestTester::TEST_INSTANCE_QUEUE_DEPTH, QueuedTestTester::TEST_INSTANCE_ID);
}
Fw::ParamValid Tester ::from_prmGetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
Fw::ParamValid QueuedTestTester ::from_prmGetIn_handler(const FwIndexType portNum,
FwPrmIdType id,
Fw::ParamBuffer& val) {
val.resetSer();
Fw::SerializeStatus status;
@ -79,7 +81,7 @@ Fw::ParamValid Tester ::from_prmGetIn_handler(const FwIndexType portNum, FwPrmId
return prmValid;
}
void Tester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
void QueuedTestTester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
Fw::SerializeStatus status;
U32 id_base = component.getIdBase();
@ -124,93 +126,85 @@ void Tester ::from_prmSetIn_handler(const FwIndexType portNum, FwPrmIdType id, F
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
Fw::SerializeStatus Tester::QueuedTestComponentBaseParamExternalDelegate ::
deserializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
const Fw::ParamValid prmStat,
Fw::SerializeBufferBase& buff
)
{
Fw::SerializeStatus stat;
(void) base_id;
Fw::SerializeStatus QueuedTestTester::QueuedTestComponentBaseParamExternalDelegate ::deserializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
const Fw::ParamValid prmStat,
Fw::SerializeBufferBase& buff) {
Fw::SerializeStatus stat;
(void)base_id;
// Serialize the parameter based on ID
switch(local_id)
{
// ParamBoolExternal
case QueuedTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.deserialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case QueuedTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.deserialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case QueuedTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.deserialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case QueuedTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.deserialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
// Serialize the parameter based on ID
switch (local_id) {
// ParamBoolExternal
case QueuedTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.deserialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case QueuedTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.deserialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case QueuedTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.deserialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case QueuedTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.deserialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.deserialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
return stat;
}
Fw::SerializeStatus Tester::QueuedTestComponentBaseParamExternalDelegate ::
serializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
Fw::SerializeBufferBase& buff
) const
{
Fw::SerializeStatus stat;
(void) base_id;
Fw::SerializeStatus QueuedTestTester::QueuedTestComponentBaseParamExternalDelegate ::serializeParam(
const FwPrmIdType base_id,
const FwPrmIdType local_id,
Fw::SerializeBufferBase& buff) const {
Fw::SerializeStatus stat;
(void)base_id;
// Serialize the parameter based on ID
switch(local_id)
{
// ParamBoolExternal
case QueuedTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.serialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case QueuedTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.serialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.serialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case QueuedTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.serialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case QueuedTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.serialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.serialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
// Serialize the parameter based on ID
switch (local_id) {
// ParamBoolExternal
case QueuedTestComponentBase::PARAMID_PARAMBOOLEXTERNAL:
stat = buff.serialize(this->m_param_ParamBoolExternal);
break;
// ParamI32External
case QueuedTestComponentBase::PARAMID_PARAMI32EXTERNAL:
stat = buff.serialize(this->m_param_ParamI32External);
break;
// ParamStringExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRINGEXTERNAL:
stat = buff.serialize(this->m_param_ParamStringExternal);
break;
// ParamEnumExternal
case QueuedTestComponentBase::PARAMID_PARAMENUMEXTERNAL:
stat = buff.serialize(this->m_param_ParamEnumExternal);
break;
// ParamArrayExternal
case QueuedTestComponentBase::PARAMID_PARAMARRAYEXTERNAL:
stat = buff.serialize(this->m_param_ParamArrayExternal);
break;
// ParamStructExternal
case QueuedTestComponentBase::PARAMID_PARAMSTRUCTEXTERNAL:
stat = buff.serialize(this->m_param_ParamStructExternal);
break;
default:
// Unknown ID should not have gotten here
FW_ASSERT(false, static_cast<FwAssertArgType>(local_id));
}
return stat;
return stat;
}

View File

@ -0,0 +1,249 @@
// ======================================================================
// \title QueuedTest/test/ut/QueuedTestTester.hpp
// \author tiffany
// \brief hpp file for QueuedTest test harness implementation class
// ======================================================================
#ifndef QUEUED_TEST_TESTER_HPP
#define QUEUED_TEST_TESTER_HPP
#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
#include "FppTest/component/active/TypedPortIndexEnumAc.hpp"
#include "FppTest/component/queued/QueuedTest.hpp"
#include "FppTest/component/tests/CmdTests.hpp"
#include "FppTest/component/tests/EventTests.hpp"
#include "FppTest/component/tests/ExternalParamTests.hpp"
#include "FppTest/component/tests/InternalInterfaceTests.hpp"
#include "FppTest/component/tests/ParamTests.hpp"
#include "FppTest/component/tests/PortTests.hpp"
#include "FppTest/component/tests/TlmTests.hpp"
#include "FppTest/component/types/FormalParamTypes.hpp"
#include "QueuedTestGTestBase.hpp"
class QueuedTestTester : public QueuedTestGTestBase {
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
public:
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 100;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test
static const FwSizeType TEST_INSTANCE_QUEUE_DEPTH = 10;
//! Construct object QueuedTestTester
//!
QueuedTestTester();
//! Destroy object QueuedTestTester
//!
~QueuedTestTester();
public:
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
PORT_TEST_DECLS
PORT_TEST_DECLS_ASYNC
CMD_TEST_DECLS
CMD_TEST_DECLS_ASYNC
EVENT_TEST_DECLS
TLM_TEST_DECLS
void testParam();
PARAM_CMD_TEST_DECLS
void testExternalParam();
EXTERNAL_PARAM_CMD_TEST_DECLS
INTERNAL_INT_TEST_DECLS
void testTime();
void testOverflowAssert();
void testOverflowDrop();
void testOverflowHook();
private:
#include "FppTest/component/common/tester.hpp"
private:
// ----------------------------------------------------------------------
// Handlers for serial from ports
// ----------------------------------------------------------------------
//! Handler for from_serialOut
//!
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& Buffer //!< The serialization buffer
);
public:
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
//! Connect ports
//!
void connectPorts();
//! Connect async ports
void connectAsyncPorts();
//! Connect prmSetIn port
void connectPrmSetIn();
//! Connect timeGetOut port
void connectTimeGetOut();
//! Connect serial ports to special ports
void connectSpecialPortsSerial();
//! Set prmValid
void setPrmValid(Fw::ParamValid valid);
//! Call doDispatch() on component under test
Fw::QueuedComponentBase::MsgDispatchStatus doDispatch();
//! Initialize components
//!
void initComponents();
//! Check successful status of a serial port invocation
void checkSerializeStatusSuccess();
//! Check unsuccessful status of a serial port invocation
void checkSerializeStatusBufferEmpty();
private:
// ----------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------
//! The component under test
//!
QueuedTest component;
// Values returned by typed output ports
FppTest::Types::BoolType noParamReturnVal;
FppTest::Types::U32Type primitiveReturnVal;
FppTest::Types::EnumType enumReturnVal;
FppTest::Types::ArrayType arrayReturnVal;
FppTest::Types::StructType structReturnVal;
FppTest::Types::StringType stringReturnVal;
FppTest::Types::StringType stringAliasReturnVal;
FppTest::Types::AliasStringArrayType arrayStringAliasReturnVal;
// Buffers from serial output ports;
U8 primitiveData[InputPrimitiveArgsPort::SERIALIZED_SIZE];
U8 stringData[InputStringArgsPort::SERIALIZED_SIZE];
U8 enumData[InputEnumArgsPort::SERIALIZED_SIZE];
U8 arrayData[InputArrayArgsPort::SERIALIZED_SIZE];
U8 structData[InputStructArgsPort::SERIALIZED_SIZE];
U8 serialData[SERIAL_ARGS_BUFFER_CAPACITY];
Fw::SerialBuffer primitiveBuf;
Fw::SerialBuffer stringBuf;
Fw::SerialBuffer enumBuf;
Fw::SerialBuffer arrayBuf;
Fw::SerialBuffer structBuf;
Fw::SerialBuffer serialBuf;
// Parameter test values
FppTest::Types::BoolParam boolPrm;
FppTest::Types::U32Param u32Prm;
FppTest::Types::PrmStringParam stringPrm;
FppTest::Types::EnumParam enumPrm;
FppTest::Types::ArrayParam arrayPrm;
FppTest::Types::StructParam structPrm;
Fw::ParamValid prmValid;
// Time test values
Fw::Time time;
//! External Parameter Delegate
class QueuedTestComponentBaseParamExternalDelegate : public Fw::ParamExternalDelegate {
public:
// ----------------------------------------------------------------------
// Parameter validity flags
// ----------------------------------------------------------------------
//! True if ParamBoolExternal was successfully received
Fw::ParamValid m_param_ParamBoolExternal_valid;
//! True if ParamI32External was successfully received
Fw::ParamValid m_param_ParamI32External_valid;
//! True if ParamStringExternal was successfully received
Fw::ParamValid m_param_ParamStringExternal_valid;
//! True if ParamEnumExternal was successfully received
Fw::ParamValid m_param_ParamEnumExternal_valid;
//! True if ParamArrayExternal was successfully received
Fw::ParamValid m_param_ParamArrayExternal_valid;
//! True if ParamStructExternal was successfully received
Fw::ParamValid m_param_ParamStructExternal_valid;
public:
// ----------------------------------------------------------------------
// Parameter variables
// ----------------------------------------------------------------------
//! Parameter ParamBoolExternal
bool m_param_ParamBoolExternal;
//! Parameter ParamI32External
I32 m_param_ParamI32External;
//! Parameter ParamStringExternal
Fw::ParamString m_param_ParamStringExternal;
//! Parameter ParamEnumExternal
FormalParamEnum m_param_ParamEnumExternal;
//! Parameter ParamArrayExternal
FormalParamArray m_param_ParamArrayExternal;
//! Parameter ParamStructExternal
FormalParamStruct m_param_ParamStructExternal;
public:
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
//! Parameter deserialization function for external parameter unit testing
Fw::SerializeStatus deserializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to deserialize
const FwPrmIdType local_id, //!< The parameter local ID to deserialize
const Fw::ParamValid prmStat, //!< The parameter validity status
Fw::SerializeBufferBase& buff //!< The buffer containing the parameter to deserialize
) override;
//! Parameter serialization function for external parameter unit testing
Fw::SerializeStatus serializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerializeBufferBase& buff //!< The buffer to serialize the parameter into
) const override;
};
// ----------------------------------------------------------------------
// Parameter delegates
// ----------------------------------------------------------------------
//! Delegate to serialize/deserialize an externally stored parameter
QueuedTestComponentBaseParamExternalDelegate paramTesterDelegate;
};
#endif

View File

@ -1,258 +1,9 @@
// ======================================================================
// \title QueuedTest/test/ut/Tester.hpp
// \author tiffany
// \brief hpp file for QueuedTest test harness implementation class
// ======================================================================
#ifndef TESTER_HPP
#define TESTER_HPP
#include "FppTest/component/active/SerialPortIndexEnumAc.hpp"
#include "FppTest/component/active/TypedPortIndexEnumAc.hpp"
#include "FppTest/component/queued/QueuedTest.hpp"
#include "FppTest/component/tests/CmdTests.hpp"
#include "FppTest/component/tests/EventTests.hpp"
#include "FppTest/component/tests/InternalInterfaceTests.hpp"
#include "FppTest/component/tests/ParamTests.hpp"
#include "FppTest/component/tests/ExternalParamTests.hpp"
#include "FppTest/component/tests/PortTests.hpp"
#include "FppTest/component/tests/TlmTests.hpp"
#include "FppTest/component/types/FormalParamTypes.hpp"
#include "QueuedTestGTestBase.hpp"
class Tester : public QueuedTestGTestBase {
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
public:
// Maximum size of histories storing events, telemetry, and port outputs
static const U32 MAX_HISTORY_SIZE = 100;
// Instance ID supplied to the component instance under test
static const FwEnumStoreType TEST_INSTANCE_ID = 0;
// Queue depth supplied to component instance under test
static const FwSizeType TEST_INSTANCE_QUEUE_DEPTH = 10;
//! Construct object Tester
//!
Tester();
//! Destroy object Tester
//!
~Tester();
public:
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
PORT_TEST_DECLS
PORT_TEST_DECLS_ASYNC
CMD_TEST_DECLS
CMD_TEST_DECLS_ASYNC
EVENT_TEST_DECLS
TLM_TEST_DECLS
void testParam();
PARAM_CMD_TEST_DECLS
void testExternalParam();
EXTERNAL_PARAM_CMD_TEST_DECLS
INTERNAL_INT_TEST_DECLS
void testTime();
void testOverflowAssert();
void testOverflowDrop();
void testOverflowHook();
private:
#include "FppTest/component/common/tester.hpp"
private:
// ----------------------------------------------------------------------
// Handlers for serial from ports
// ----------------------------------------------------------------------
//! Handler for from_serialOut
//!
void from_serialOut_handler(FwIndexType portNum, //!< The port number
Fw::SerializeBufferBase& Buffer //!< The serialization buffer
);
public:
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
//! Connect ports
//!
void connectPorts();
//! Connect async ports
void connectAsyncPorts();
//! Connect prmSetIn port
void connectPrmSetIn();
//! Connect timeGetOut port
void connectTimeGetOut();
//! Connect serial ports to special ports
void connectSpecialPortsSerial();
//! Set prmValid
void setPrmValid(Fw::ParamValid valid);
//! Call doDispatch() on component under test
Fw::QueuedComponentBase::MsgDispatchStatus doDispatch();
//! Initialize components
//!
void initComponents();
//! Check successful status of a serial port invocation
void checkSerializeStatusSuccess();
//! Check unsuccessful status of a serial port invocation
void checkSerializeStatusBufferEmpty();
private:
// ----------------------------------------------------------------------
// Variables
// ----------------------------------------------------------------------
//! The component under test
//!
QueuedTest component;
// Values returned by typed output ports
FppTest::Types::BoolType noParamReturnVal;
FppTest::Types::U32Type primitiveReturnVal;
FppTest::Types::EnumType enumReturnVal;
FppTest::Types::ArrayType arrayReturnVal;
FppTest::Types::StructType structReturnVal;
FppTest::Types::StringType stringReturnVal;
FppTest::Types::StringType stringAliasReturnVal;
FppTest::Types::AliasStringArrayType arrayStringAliasReturnVal;
// Buffers from serial output ports;
U8 primitiveData[InputPrimitiveArgsPort::SERIALIZED_SIZE];
U8 stringData[InputStringArgsPort::SERIALIZED_SIZE];
U8 enumData[InputEnumArgsPort::SERIALIZED_SIZE];
U8 arrayData[InputArrayArgsPort::SERIALIZED_SIZE];
U8 structData[InputStructArgsPort::SERIALIZED_SIZE];
U8 serialData[SERIAL_ARGS_BUFFER_CAPACITY];
Fw::SerialBuffer primitiveBuf;
Fw::SerialBuffer stringBuf;
Fw::SerialBuffer enumBuf;
Fw::SerialBuffer arrayBuf;
Fw::SerialBuffer structBuf;
Fw::SerialBuffer serialBuf;
// Parameter test values
FppTest::Types::BoolParam boolPrm;
FppTest::Types::U32Param u32Prm;
FppTest::Types::PrmStringParam stringPrm;
FppTest::Types::EnumParam enumPrm;
FppTest::Types::ArrayParam arrayPrm;
FppTest::Types::StructParam structPrm;
Fw::ParamValid prmValid;
// Time test values
Fw::Time time;
//! External Parameter Delegate
class QueuedTestComponentBaseParamExternalDelegate :
public Fw::ParamExternalDelegate
{
public:
// ----------------------------------------------------------------------
// Parameter validity flags
// ----------------------------------------------------------------------
//! True if ParamBoolExternal was successfully received
Fw::ParamValid m_param_ParamBoolExternal_valid;
//! True if ParamI32External was successfully received
Fw::ParamValid m_param_ParamI32External_valid;
//! True if ParamStringExternal was successfully received
Fw::ParamValid m_param_ParamStringExternal_valid;
//! True if ParamEnumExternal was successfully received
Fw::ParamValid m_param_ParamEnumExternal_valid;
//! True if ParamArrayExternal was successfully received
Fw::ParamValid m_param_ParamArrayExternal_valid;
//! True if ParamStructExternal was successfully received
Fw::ParamValid m_param_ParamStructExternal_valid;
public:
// ----------------------------------------------------------------------
// Parameter variables
// ----------------------------------------------------------------------
//! Parameter ParamBoolExternal
bool m_param_ParamBoolExternal;
//! Parameter ParamI32External
I32 m_param_ParamI32External;
//! Parameter ParamStringExternal
Fw::ParamString m_param_ParamStringExternal;
//! Parameter ParamEnumExternal
FormalParamEnum m_param_ParamEnumExternal;
//! Parameter ParamArrayExternal
FormalParamArray m_param_ParamArrayExternal;
//! Parameter ParamStructExternal
FormalParamStruct m_param_ParamStructExternal;
public:
// ----------------------------------------------------------------------
// Unit test implementation of external parameter delegate serialization/deserialization
// ----------------------------------------------------------------------
//! Parameter deserialization function for external parameter unit testing
Fw::SerializeStatus deserializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to deserialize
const FwPrmIdType local_id, //!< The parameter local ID to deserialize
const Fw::ParamValid prmStat, //!< The parameter validity status
Fw::SerializeBufferBase& buff //!< The buffer containing the parameter to deserialize
) override;
//! Parameter serialization function for external parameter unit testing
Fw::SerializeStatus serializeParam(
const FwPrmIdType base_id, //!< The component base parameter ID to serialize
const FwPrmIdType local_id, //!< The parameter local ID to serialize
Fw::SerializeBufferBase& buff //!< The buffer to serialize the parameter into
) const override;
};
// ----------------------------------------------------------------------
// Parameter delegates
// ----------------------------------------------------------------------
//! Delegate to serialize/deserialize an externally stored parameter
QueuedTestComponentBaseParamExternalDelegate paramTesterDelegate;
};
// QueuedTestTester is the full implementation - using it as the Tester class
#include "QueuedTestTester.hpp"
class QueuedTestTester;
typedef QueuedTestTester Tester;
#endif

View File

@ -7,9 +7,9 @@ register_fprime_module()
set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/DpTest.fpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/TestMain.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/TesterHelpers.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/DpTestTestMain.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test/ut/DpTestTester.cpp"
)
set(UT_MOD_DEPS STest)
set(UT_AUTO_HELPERS ON)
register_fprime_ut()

View File

@ -7,8 +7,8 @@
#include <cstdio>
#include "FppTest/dp/DpTest.hpp"
#include "Fw/Types/Assert.hpp"
#include "Fw/Dp/test/ut/DpContainerTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {

View File

@ -16,7 +16,7 @@ namespace FppTest {
class DpTest : public DpTestComponentBase {
// Friend class for testing
friend class Tester;
friend class DpTestTester;
public:
// ----------------------------------------------------------------------
@ -83,7 +83,7 @@ class DpTest : public DpTestComponentBase {
//! Handler implementation for schedIn
void schedIn_handler(const FwIndexType portNum, //!< The port number
U32 context //!< The call order
U32 context //!< The call order
) final;
private:

View File

@ -1,8 +1,8 @@
// ----------------------------------------------------------------------
// TestMain.cpp
// DpTestTestMain.cpp
// ----------------------------------------------------------------------
#include "FppTest/dp/test/ut/Tester.hpp"
#include "FppTest/dp/test/ut/DpTestTester.hpp"
#include "Fw/Test/UnitTest.hpp"
#include "STest/Random/Random.hpp"
@ -13,7 +13,7 @@ static constexpr FwIndexType NUM_ITERS = 2;
TEST(schedIn, OK) {
COMMENT("schedIn OK");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.schedIn_OK();
}
@ -21,7 +21,7 @@ TEST(schedIn, OK) {
TEST(productRecvIn, Container1_SUCCESS) {
COMMENT("Receive Container1 SUCCESS");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container1_SUCCESS();
}
@ -29,7 +29,7 @@ TEST(productRecvIn, Container1_SUCCESS) {
TEST(productRecvIn, Container1_FAILURE) {
COMMENT("Receive Container1 FAILURE");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container1_FAILURE();
}
@ -37,7 +37,7 @@ TEST(productRecvIn, Container1_FAILURE) {
TEST(productRecvIn, Container2_SUCCESS) {
COMMENT("Receive Container2 SUCCESS");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container2_SUCCESS();
}
@ -45,7 +45,7 @@ TEST(productRecvIn, Container2_SUCCESS) {
TEST(productRecvIn, Container2_FAILURE) {
COMMENT("Receive Container2 FAILURE");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container2_FAILURE();
}
@ -53,7 +53,7 @@ TEST(productRecvIn, Container2_FAILURE) {
TEST(productRecvIn, Container3_SUCCESS) {
COMMENT("Receive Container3 SUCCESS");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container3_SUCCESS();
}
@ -61,7 +61,7 @@ TEST(productRecvIn, Container3_SUCCESS) {
TEST(productRecvIn, Container3_FAILURE) {
COMMENT("Receive Container3 FAILURE");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container3_FAILURE();
}
@ -69,7 +69,7 @@ TEST(productRecvIn, Container3_FAILURE) {
TEST(productRecvIn, Container4_SUCCESS) {
COMMENT("Receive Container4 SUCCESS");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container4_SUCCESS();
}
@ -77,7 +77,7 @@ TEST(productRecvIn, Container4_SUCCESS) {
TEST(productRecvIn, Container4_FAILURE) {
COMMENT("Receive Container4 FAILURE");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container4_FAILURE();
}
@ -85,7 +85,7 @@ TEST(productRecvIn, Container4_FAILURE) {
TEST(productRecvIn, Container5_SUCCESS) {
COMMENT("Receive Container5 SUCCESS");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container5_SUCCESS();
}
@ -93,7 +93,7 @@ TEST(productRecvIn, Container5_SUCCESS) {
TEST(productRecvIn, Container5_FAILURE) {
COMMENT("Receive Container5 FAILURE");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container5_FAILURE();
}
@ -101,7 +101,7 @@ TEST(productRecvIn, Container5_FAILURE) {
TEST(productRecvIn, Container6_SUCCESS) {
COMMENT("Receive Container6 SUCCESS");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container6_SUCCESS();
}
@ -109,7 +109,7 @@ TEST(productRecvIn, Container6_SUCCESS) {
TEST(productRecvIn, Container6_FAILURE) {
COMMENT("Receive Container6 FAILURE");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container6_FAILURE();
}
@ -117,7 +117,7 @@ TEST(productRecvIn, Container6_FAILURE) {
TEST(productRecvIn, Container7_SUCCESS) {
COMMENT("Receive Container7 SUCCESS");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container7_SUCCESS();
}
@ -125,7 +125,7 @@ TEST(productRecvIn, Container7_SUCCESS) {
TEST(productRecvIn, Container7_FAILURE) {
COMMENT("Receive Container7 FAILURE");
Tester tester;
DpTestTester tester;
for (FwIndexType i = 0; i < NUM_ITERS; i++) {
tester.productRecvIn_Container7_FAILURE();
}

View File

@ -1,5 +1,5 @@
// ======================================================================
// \title DpTest.hpp
// \title DpTestTester.cpp
// \author bocchino
// \brief cpp file for DpTest test harness implementation class
// ======================================================================
@ -7,7 +7,7 @@
#include <cstring>
#include "FppTest/dp/FppConstantsAc.hpp"
#include "FppTest/dp/test/ut/Tester.hpp"
#include "FppTest/dp/test/ut/DpTestTester.hpp"
#include "Fw/Types/ExternalString.hpp"
#include "STest/Pick/Pick.hpp"
@ -17,8 +17,8 @@ namespace FppTest {
// Construction and destruction
// ----------------------------------------------------------------------
Tester::Tester()
: DpTestGTestBase("Tester", Tester::MAX_HISTORY_SIZE),
DpTestTester::DpTestTester()
: DpTestGTestBase("DpTestTester", DpTestTester::MAX_HISTORY_SIZE),
container1Data{},
container1Buffer(this->container1Data, sizeof this->container1Data),
container2Data{},
@ -56,13 +56,13 @@ Tester::Tester()
generateRandomString(this->stringRecordData);
}
Tester::~Tester() {}
DpTestTester::~DpTestTester() {}
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
void Tester::schedIn_OK() {
void DpTestTester::schedIn_OK() {
this->clearHistory();
this->invoke_to_schedIn(0, 0);
this->component.doDispatch();
@ -81,7 +81,7 @@ void Tester::schedIn_OK() {
ASSERT_PRODUCT_GET(4, ID_BASE + DpTest::ContainerId::Container5, FwSizeType(DpTest::CONTAINER_5_PACKET_SIZE));
}
void Tester::productRecvIn_Container1_SUCCESS() {
void DpTestTester::productRecvIn_Container1_SUCCESS() {
Fw::Buffer buffer;
FwSizeType expectedNumElts;
// Clear the history
@ -111,12 +111,12 @@ void Tester::productRecvIn_Container1_SUCCESS() {
}
}
void Tester::productRecvIn_Container1_FAILURE() {
void DpTestTester::productRecvIn_Container1_FAILURE() {
this->clearHistory();
productRecvIn_CheckFailure(DpTest::ContainerId::Container1, this->container1Buffer);
}
void Tester::productRecvIn_Container2_SUCCESS() {
void DpTestTester::productRecvIn_Container2_SUCCESS() {
Fw::Buffer buffer;
FwSizeType expectedNumElts;
// Clear the history
@ -146,12 +146,12 @@ void Tester::productRecvIn_Container2_SUCCESS() {
}
}
void Tester::productRecvIn_Container2_FAILURE() {
void DpTestTester::productRecvIn_Container2_FAILURE() {
this->clearHistory();
productRecvIn_CheckFailure(DpTest::ContainerId::Container2, this->container2Buffer);
}
void Tester::productRecvIn_Container3_SUCCESS() {
void DpTestTester::productRecvIn_Container3_SUCCESS() {
Fw::Buffer buffer;
FwSizeType expectedNumElts;
// Clear the history
@ -191,12 +191,12 @@ void Tester::productRecvIn_Container3_SUCCESS() {
}
}
void Tester::productRecvIn_Container3_FAILURE() {
void DpTestTester::productRecvIn_Container3_FAILURE() {
this->clearHistory();
productRecvIn_CheckFailure(DpTest::ContainerId::Container3, this->container3Buffer);
}
void Tester::productRecvIn_Container4_SUCCESS() {
void DpTestTester::productRecvIn_Container4_SUCCESS() {
Fw::Buffer buffer;
FwSizeType expectedNumElts;
// Clear the history
@ -236,12 +236,12 @@ void Tester::productRecvIn_Container4_SUCCESS() {
}
}
void Tester::productRecvIn_Container4_FAILURE() {
void DpTestTester::productRecvIn_Container4_FAILURE() {
productRecvIn_CheckFailure(DpTest::ContainerId::Container4, this->container4Buffer);
this->clearHistory();
}
void Tester::productRecvIn_Container5_SUCCESS() {
void DpTestTester::productRecvIn_Container5_SUCCESS() {
Fw::Buffer buffer;
FwSizeType expectedNumElts;
// Clear the history
@ -281,12 +281,12 @@ void Tester::productRecvIn_Container5_SUCCESS() {
}
}
void Tester::productRecvIn_Container5_FAILURE() {
void DpTestTester::productRecvIn_Container5_FAILURE() {
this->clearHistory();
productRecvIn_CheckFailure(DpTest::ContainerId::Container5, this->container5Buffer);
}
void Tester::productRecvIn_Container6_SUCCESS() {
void DpTestTester::productRecvIn_Container6_SUCCESS() {
Fw::Buffer buffer;
FwSizeType expectedNumElts;
// Clear the history
@ -319,12 +319,12 @@ void Tester::productRecvIn_Container6_SUCCESS() {
}
}
void Tester::productRecvIn_Container6_FAILURE() {
void DpTestTester::productRecvIn_Container6_FAILURE() {
this->clearHistory();
productRecvIn_CheckFailure(DpTest::ContainerId::Container6, this->container6Buffer);
}
void Tester::productRecvIn_Container7_SUCCESS() {
void DpTestTester::productRecvIn_Container7_SUCCESS() {
Fw::Buffer buffer;
FwSizeType expectedNumElts;
// Clear the history
@ -367,7 +367,7 @@ void Tester::productRecvIn_Container7_SUCCESS() {
}
}
void Tester::productRecvIn_Container7_FAILURE() {
void DpTestTester::productRecvIn_Container7_FAILURE() {
this->clearHistory();
productRecvIn_CheckFailure(DpTest::ContainerId::Container7, this->container7Buffer);
}
@ -376,7 +376,7 @@ void Tester::productRecvIn_Container7_FAILURE() {
// Helper methods
// ----------------------------------------------------------------------
Fw::Time Tester::randomizeTestTime() {
Fw::Time DpTestTester::randomizeTestTime() {
const U32 seconds = STest::Pick::any();
const U32 useconds = STest::Pick::startLength(0, 1000000);
const Fw::Time time(seconds, useconds);
@ -385,7 +385,7 @@ Fw::Time Tester::randomizeTestTime() {
return time;
}
void Tester::generateRandomString(Fw::StringBase& str) {
void DpTestTester::generateRandomString(Fw::StringBase& str) {
char buffer[Fw::StringBase::BUFFER_SIZE(MAX_STRING_LENGTH)];
// Pick a random string length
const FwSizeType length = STest::Pick::lowerUpper(0, MAX_STRING_LENGTH);
@ -401,12 +401,12 @@ void Tester::generateRandomString(Fw::StringBase& str) {
str.format("%s", buffer);
}
void Tester::productRecvIn_InvokeAndCheckHeader(FwDpIdType id,
FwSizeType dataEltSize,
FwDpPriorityType priority,
Fw::Buffer inputBuffer,
Fw::Buffer& outputBuffer,
FwSizeType& expectedNumElts) {
void DpTestTester::productRecvIn_InvokeAndCheckHeader(FwDpIdType id,
FwSizeType dataEltSize,
FwDpPriorityType priority,
Fw::Buffer inputBuffer,
Fw::Buffer& outputBuffer,
FwSizeType& expectedNumElts) {
const auto globalId = ID_BASE + id;
// Set the test time
const Fw::Time timeTag = this->randomizeTestTime();
@ -434,7 +434,7 @@ void Tester::productRecvIn_InvokeAndCheckHeader(FwDpIdType id,
ASSERT_PRODUCT_SEND(0, globalId, priority, timeTag, 0, userData, dpState, expectedDataSize, outputBuffer);
}
void Tester::productRecvIn_CheckFailure(FwDpIdType id, Fw::Buffer buffer) {
void DpTestTester::productRecvIn_CheckFailure(FwDpIdType id, Fw::Buffer buffer) {
// Invoke the port
const auto globalId = ID_BASE + id;
this->sendProductResponse(globalId, buffer, Fw::Success::FAILURE);
@ -447,7 +447,7 @@ void Tester::productRecvIn_CheckFailure(FwDpIdType id, Fw::Buffer buffer) {
// Handlers for typed from ports
// ----------------------------------------------------------------------
Fw::Success::T Tester::productGet_handler(FwDpIdType id, FwSizeType size, Fw::Buffer& buffer) {
Fw::Success::T DpTestTester::productGet_handler(FwDpIdType id, FwSizeType size, Fw::Buffer& buffer) {
this->pushProductGetEntry(id, size);
Fw::Success status = Fw::Success::FAILURE;
FW_ASSERT(id >= ID_BASE, static_cast<FwAssertArgType>(id), static_cast<FwAssertArgType>(ID_BASE));

View File

@ -1,11 +1,11 @@
// ======================================================================
// \title DpTest/test/ut/Tester.hpp
// \title DpTest/test/ut/DpTestTester.hpp
// \author bocchino
// \brief hpp file for DpTest test harness implementation class
// ======================================================================
#ifndef FppTest_DpTest_Tester_HPP
#define FppTest_DpTest_Tester_HPP
#ifndef FppTest_DpTest_DpTestTester_HPP
#define FppTest_DpTest_DpTestTester_HPP
#include "DpTestGTestBase.hpp"
#include "FppTest/dp/DpTest.hpp"
@ -14,7 +14,7 @@
namespace FppTest {
class Tester : public DpTestGTestBase {
class DpTestTester : public DpTestGTestBase {
// ----------------------------------------------------------------------
// Construction and destruction
// ----------------------------------------------------------------------
@ -31,13 +31,13 @@ class Tester : public DpTestGTestBase {
// The max string length for string data
static constexpr FwSizeType MAX_STRING_LENGTH = 100;
//! Construct object Tester
//! Construct object DpTestTester
//!
Tester();
DpTestTester();
//! Destroy object Tester
//! Destroy object DpTestTester
//!
~Tester();
~DpTestTester();
public:
// ----------------------------------------------------------------------
@ -117,8 +117,8 @@ class Tester : public DpTestGTestBase {
Fw::Time randomizeTestTime();
//! Generate a random string
static void generateRandomString(Fw::StringBase& str //!< The string (output)
);
static void generateRandomString(Fw::StringBase& str //!< The string (output)
);
//! Invoke productRecvIn and check header
//! This sets the output buffer to the received buffer and sets the

View File

@ -1,41 +0,0 @@
// ======================================================================
// \title DpTest/test/ut/TesterHelpers.cpp
// \author Auto-generated
// \brief cpp file for DpTest component test harness base class
//
// NOTE: this file was automatically generated
//
// ======================================================================
#include "Tester.hpp"
namespace FppTest {
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
void Tester ::connectPorts() {
// productRecvIn
this->connect_to_productRecvIn(0, this->component.get_productRecvIn_InputPort(0));
// schedIn
this->connect_to_schedIn(0, this->component.get_schedIn_InputPort(0));
// productGetOut
this->component.set_productGetOut_OutputPort(0, this->get_from_productGetOut(0));
// productRequestOut
this->component.set_productRequestOut_OutputPort(0, this->get_from_productRequestOut(0));
// productSendOut
this->component.set_productSendOut_OutputPort(0, this->get_from_productSendOut(0));
// timeGetOut
this->component.set_timeGetOut_OutputPort(0, this->get_from_timeGetOut(0));
}
void Tester ::initComponents() {
this->init();
this->component.init(Tester::TEST_INSTANCE_QUEUE_DEPTH, Tester::TEST_INSTANCE_ID);
}
} // end namespace FppTest

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title Basic.cpp
// \title BasicTester.cpp
// \author bocchino
// \brief cpp file for Basic component implementation class
// \brief cpp file for BasicTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/choice/Basic.hpp"
#include "FppTest/state_machine/internal_instance/choice/BasicTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,7 +17,7 @@ namespace SmInstanceChoice {
// Component construction and destruction
// ----------------------------------------------------------------------
Basic::Basic(const char* const compName)
BasicTester::BasicTester(const char* const compName)
: BasicComponentBase(compName),
m_basic_action_a_history(),
m_basic_action_b_history(),
@ -26,13 +26,13 @@ Basic::Basic(const char* const compName)
m_smChoiceBasic_action_b_history(),
m_smChoiceBasic_guard_g() {}
Basic::~Basic() {}
BasicTester::~BasicTester() {}
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
void Basic::schedIn_handler(FwIndexType portNum, U32 context) {
void BasicTester::schedIn_handler(FwIndexType portNum, U32 context) {
// Nothing to do
}
@ -40,24 +40,24 @@ void Basic::schedIn_handler(FwIndexType portNum, U32 context) {
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void Basic::FppTest_SmInstanceChoice_Basic_Basic_action_a(SmId smId,
FppTest_SmInstanceChoice_Basic_Basic::Signal signal) {
void BasicTester::FppTest_SmInstanceChoice_Basic_Basic_action_a(SmId smId,
FppTest_SmInstanceChoice_Basic_Basic::Signal signal) {
ASSERT_EQ(smId, SmId::basic);
this->m_basic_action_a_history.push(signal);
}
void Basic::FppTest_SmInstanceChoice_Basic_Basic_action_b(SmId smId,
FppTest_SmInstanceChoice_Basic_Basic::Signal signal) {
void BasicTester::FppTest_SmInstanceChoice_Basic_Basic_action_b(SmId smId,
FppTest_SmInstanceChoice_Basic_Basic::Signal signal) {
ASSERT_EQ(smId, SmId::basic);
this->m_basic_action_b_history.push(signal);
}
void Basic::FppTest_SmChoice_Basic_action_a(SmId smId, FppTest_SmChoice_Basic::Signal signal) {
void BasicTester::FppTest_SmChoice_Basic_action_a(SmId smId, FppTest_SmChoice_Basic::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceBasic);
this->m_smChoiceBasic_action_a_history.push(signal);
}
void Basic::FppTest_SmChoice_Basic_action_b(SmId smId, FppTest_SmChoice_Basic::Signal signal) {
void BasicTester::FppTest_SmChoice_Basic_action_b(SmId smId, FppTest_SmChoice_Basic::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceBasic);
this->m_smChoiceBasic_action_b_history.push(signal);
}
@ -66,13 +66,14 @@ void Basic::FppTest_SmChoice_Basic_action_b(SmId smId, FppTest_SmChoice_Basic::S
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool Basic::FppTest_SmInstanceChoice_Basic_Basic_guard_g(SmId smId,
FppTest_SmInstanceChoice_Basic_Basic::Signal signal) const {
bool BasicTester::FppTest_SmInstanceChoice_Basic_Basic_guard_g(
SmId smId,
FppTest_SmInstanceChoice_Basic_Basic::Signal signal) const {
FW_ASSERT(smId == SmId::basic, static_cast<FwAssertArgType>(smId));
return this->m_basic_guard_g.call(signal);
}
bool Basic::FppTest_SmChoice_Basic_guard_g(SmId smId, FppTest_SmChoice_Basic::Signal signal) const {
bool BasicTester::FppTest_SmChoice_Basic_guard_g(SmId smId, FppTest_SmChoice_Basic::Signal signal) const {
FW_ASSERT(smId == SmId::smChoiceBasic, static_cast<FwAssertArgType>(smId));
return this->m_smChoiceBasic_guard_g.call(signal);
}
@ -81,7 +82,7 @@ bool Basic::FppTest_SmChoice_Basic_guard_g(SmId smId, FppTest_SmChoice_Basic::Si
// Tests
// ----------------------------------------------------------------------
void Basic::testBasicTrue() {
void BasicTester::testBasicTrue() {
this->m_basic_action_a_history.clear();
this->m_basic_action_b_history.clear();
this->m_basic_guard_g.reset();
@ -102,7 +103,7 @@ void Basic::testBasicTrue() {
ASSERT_EQ(this->basic_getState(), Basic_Basic::State::S2);
}
void Basic::testBasicFalse() {
void BasicTester::testBasicFalse() {
this->m_basic_action_a_history.clear();
this->m_basic_action_b_history.clear();
this->m_basic_guard_g.reset();
@ -122,7 +123,7 @@ void Basic::testBasicFalse() {
ASSERT_EQ(this->basic_getState(), Basic_Basic::State::S3);
}
void Basic::testSmChoiceBasicTrue() {
void BasicTester::testSmChoiceBasicTrue() {
this->m_smChoiceBasic_action_a_history.clear();
this->m_smChoiceBasic_action_b_history.clear();
this->m_smChoiceBasic_guard_g.reset();
@ -143,7 +144,7 @@ void Basic::testSmChoiceBasicTrue() {
ASSERT_EQ(this->smChoiceBasic_getState(), SmChoice_Basic::State::S2);
}
void Basic::testSmChoiceBasicFalse() {
void BasicTester::testSmChoiceBasicFalse() {
this->m_smChoiceBasic_action_a_history.clear();
this->m_smChoiceBasic_action_b_history.clear();
this->m_smChoiceBasic_guard_g.reset();

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title Basic.hpp
// \title BasicTester.hpp
// \author bocchino
// \brief hpp file for Basic component implementation class
// \brief hpp file for BasicTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceChoice_Basic_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceChoice {
class Basic : public BasicComponentBase {
class BasicTester : public BasicComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -45,12 +45,12 @@ class Basic : public BasicComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct Basic object
Basic(const char* const compName //!< The component name
//! Construct BasicTester object
BasicTester(const char* const compName //!< The component name
);
//! Destroy Basic object
~Basic();
//! Destroy BasicTester object
~BasicTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicU32.cpp
// \title BasicU32Tester.cpp
// \author bocchino
// \brief cpp file for BasicU32 component implementation class
// \brief cpp file for BasicU32Tester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/choice/BasicU32.hpp"
#include "FppTest/state_machine/internal_instance/choice/BasicU32Tester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,24 +17,26 @@ namespace SmInstanceChoice {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicU32 ::BasicU32(const char* const compName)
BasicU32Tester ::BasicU32Tester(const char* const compName)
: BasicU32ComponentBase(compName),
m_smChoiceBasicU32_action_a_history(),
m_smChoiceBasicU32_action_b_history(),
m_smChoiceBasicU32_guard_g() {}
BasicU32 ::~BasicU32() {}
BasicU32Tester ::~BasicU32Tester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicU32 ::FppTest_SmChoice_BasicU32_action_a(SmId smId, FppTest_SmChoice_BasicU32::Signal signal, U32 value) {
void BasicU32Tester ::FppTest_SmChoice_BasicU32_action_a(SmId smId,
FppTest_SmChoice_BasicU32::Signal signal,
U32 value) {
ASSERT_EQ(smId, SmId::smChoiceBasicU32);
this->m_smChoiceBasicU32_action_a_history.push(signal, value);
}
void BasicU32 ::FppTest_SmChoice_BasicU32_action_b(SmId smId, FppTest_SmChoice_BasicU32::Signal signal) {
void BasicU32Tester ::FppTest_SmChoice_BasicU32_action_b(SmId smId, FppTest_SmChoice_BasicU32::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceBasicU32);
this->m_smChoiceBasicU32_action_b_history.push(signal);
}
@ -43,9 +45,9 @@ void BasicU32 ::FppTest_SmChoice_BasicU32_action_b(SmId smId, FppTest_SmChoice_B
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicU32 ::FppTest_SmChoice_BasicU32_guard_g(SmId smId,
FppTest_SmChoice_BasicU32::Signal signal,
U32 value) const {
bool BasicU32Tester ::FppTest_SmChoice_BasicU32_guard_g(SmId smId,
FppTest_SmChoice_BasicU32::Signal signal,
U32 value) const {
FW_ASSERT(smId == SmId::smChoiceBasicU32, static_cast<FwAssertArgType>(smId));
return this->m_smChoiceBasicU32_guard_g.call(signal, value);
}
@ -54,7 +56,7 @@ bool BasicU32 ::FppTest_SmChoice_BasicU32_guard_g(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicU32::testTrue() {
void BasicU32Tester::testTrue() {
this->m_smChoiceBasicU32_action_a_history.clear();
this->m_smChoiceBasicU32_action_b_history.clear();
this->m_smChoiceBasicU32_guard_g.reset();
@ -79,7 +81,7 @@ void BasicU32::testTrue() {
ASSERT_EQ(this->smChoiceBasicU32_getState(), SmChoice_BasicU32::State::S2);
}
void BasicU32::testFalse() {
void BasicU32Tester::testFalse() {
this->m_smChoiceBasicU32_action_a_history.clear();
this->m_smChoiceBasicU32_action_b_history.clear();
this->m_smChoiceBasicU32_guard_g.reset();

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicU32.hpp
// \title BasicU32Tester.hpp
// \author bocchino
// \brief hpp file for BasicU32 component implementation class
// \brief hpp file for BasicU32Tester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceChoice_BasicU32_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceChoice {
class BasicU32 : public BasicU32ComponentBase {
class BasicU32Tester : public BasicU32ComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicU32 : public BasicU32ComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicU32 object
BasicU32(const char* const compName //!< The component name
//! Construct BasicU32Tester object
BasicU32Tester(const char* const compName //!< The component name
);
//! Destroy BasicU32 object
~BasicU32();
//! Destroy BasicU32Tester object
~BasicU32Tester();
private:
// ----------------------------------------------------------------------

View File

@ -11,13 +11,13 @@ set(MOD_DEPS FppTest/state_machine/internal/harness)
register_fprime_module()
set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/Basic.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicU32.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ChoiceToChoice.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ChoiceToState.cpp"
"${CMAKE_CURRENT_LIST_DIR}/InputPairU16U32.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Sequence.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SequenceU32.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicU32Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ChoiceToChoiceTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ChoiceToStateTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/InputPairU16U32Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SequenceTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SequenceU32Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/main.cpp"
)
set(UT_MOD_DEPS STest)

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title ChoiceToChoice.cpp
// \title ChoiceToChoiceTester.cpp
// \author bocchino
// \brief cpp file for ChoiceToChoice component implementation class
// \brief cpp file for ChoiceToChoiceTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/choice/ChoiceToChoice.hpp"
#include "FppTest/state_machine/internal_instance/choice/ChoiceToChoiceTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,32 +17,34 @@ namespace SmInstanceChoice {
// Component construction and destruction
// ----------------------------------------------------------------------
ChoiceToChoice ::ChoiceToChoice(const char* const compName)
ChoiceToChoiceTester ::ChoiceToChoiceTester(const char* const compName)
: ChoiceToChoiceComponentBase(compName),
m_smChoiceChoiceToChoice_actionHistory(),
m_smChoiceChoiceToChoice_guard_g1(),
m_smChoiceChoiceToChoice_guard_g2() {}
ChoiceToChoice ::~ChoiceToChoice() {}
ChoiceToChoiceTester ::~ChoiceToChoiceTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void ChoiceToChoice ::FppTest_SmChoice_ChoiceToChoice_action_exitS1(SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) {
void ChoiceToChoiceTester ::FppTest_SmChoice_ChoiceToChoice_action_exitS1(
SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceChoiceToChoice);
this->m_smChoiceChoiceToChoice_actionHistory.push(signal, ActionId::EXIT_S1);
}
void ChoiceToChoice ::FppTest_SmChoice_ChoiceToChoice_action_a(SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) {
void ChoiceToChoiceTester ::FppTest_SmChoice_ChoiceToChoice_action_a(SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceChoiceToChoice);
this->m_smChoiceChoiceToChoice_actionHistory.push(signal, ActionId::A);
}
void ChoiceToChoice ::FppTest_SmChoice_ChoiceToChoice_action_enterS2(SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) {
void ChoiceToChoiceTester ::FppTest_SmChoice_ChoiceToChoice_action_enterS2(
SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceChoiceToChoice);
this->m_smChoiceChoiceToChoice_actionHistory.push(signal, ActionId::ENTER_S2);
}
@ -51,14 +53,16 @@ void ChoiceToChoice ::FppTest_SmChoice_ChoiceToChoice_action_enterS2(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool ChoiceToChoice ::FppTest_SmChoice_ChoiceToChoice_guard_g1(SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) const {
bool ChoiceToChoiceTester ::FppTest_SmChoice_ChoiceToChoice_guard_g1(
SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) const {
FW_ASSERT(smId == SmId::smChoiceChoiceToChoice, static_cast<FwAssertArgType>(smId));
return this->m_smChoiceChoiceToChoice_guard_g1.call(signal);
}
bool ChoiceToChoice ::FppTest_SmChoice_ChoiceToChoice_guard_g2(SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) const {
bool ChoiceToChoiceTester ::FppTest_SmChoice_ChoiceToChoice_guard_g2(
SmId smId,
FppTest_SmChoice_ChoiceToChoice::Signal signal) const {
FW_ASSERT(smId == SmId::smChoiceChoiceToChoice, static_cast<FwAssertArgType>(smId));
return this->m_smChoiceChoiceToChoice_guard_g2.call(signal);
}
@ -67,9 +71,9 @@ bool ChoiceToChoice ::FppTest_SmChoice_ChoiceToChoice_guard_g2(SmId smId,
// Overflow hook implementations for internal state machines
// ----------------------------------------------------------------------
void ChoiceToChoice ::smChoiceChoiceToChoice_stateMachineOverflowHook(SmId smId,
FwEnumStoreType signal,
Fw::SerializeBufferBase& buffer) {
void ChoiceToChoiceTester ::smChoiceChoiceToChoice_stateMachineOverflowHook(SmId smId,
FwEnumStoreType signal,
Fw::SerializeBufferBase& buffer) {
this->m_hookCalled = true;
ASSERT_EQ(smId, SmId::smChoiceChoiceToChoice);
ASSERT_EQ(static_cast<SmChoice_ChoiceToChoice::Signal>(signal), SmChoice_ChoiceToChoice::Signal::s);
@ -80,7 +84,7 @@ void ChoiceToChoice ::smChoiceChoiceToChoice_stateMachineOverflowHook(SmId smId,
// Tests
// ----------------------------------------------------------------------
void ChoiceToChoice::testG1True() {
void ChoiceToChoiceTester::testG1True() {
this->m_smChoiceChoiceToChoice_actionHistory.clear();
this->m_smChoiceChoiceToChoice_guard_g1.reset();
this->m_smChoiceChoiceToChoice_guard_g2.reset();
@ -112,7 +116,7 @@ void ChoiceToChoice::testG1True() {
ASSERT_EQ(this->smChoiceChoiceToChoice_getState(), SmChoice_ChoiceToChoice::State::S2_S3);
}
void ChoiceToChoice::testG1FalseG2True() {
void ChoiceToChoiceTester::testG1FalseG2True() {
this->m_smChoiceChoiceToChoice_actionHistory.clear();
this->m_smChoiceChoiceToChoice_guard_g1.reset();
this->m_smChoiceChoiceToChoice_guard_g2.reset();
@ -146,7 +150,7 @@ void ChoiceToChoice::testG1FalseG2True() {
ASSERT_EQ(this->smChoiceChoiceToChoice_getState(), SmChoice_ChoiceToChoice::State::S2_S3);
}
void ChoiceToChoice::testG1FalseG2False() {
void ChoiceToChoiceTester::testG1FalseG2False() {
this->m_smChoiceChoiceToChoice_actionHistory.clear();
this->m_smChoiceChoiceToChoice_guard_g1.reset();
this->m_smChoiceChoiceToChoice_guard_g2.reset();
@ -179,7 +183,7 @@ void ChoiceToChoice::testG1FalseG2False() {
ASSERT_EQ(this->smChoiceChoiceToChoice_getState(), SmChoice_ChoiceToChoice::State::S2_S4);
}
void ChoiceToChoice::testOverflow() {
void ChoiceToChoiceTester::testOverflow() {
this->m_hookCalled = false;
this->init(queueDepth, instanceId);
for (FwSizeType i = 0; i < queueDepth; i++) {

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title ChoiceToChoice.hpp
// \title ChoiceToChoiceTester.hpp
// \author bocchino
// \brief hpp file for ChoiceToChoice component implementation class
// \brief hpp file for ChoiceToChoiceTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceChoice_ChoiceToChoice_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceChoice {
class ChoiceToChoice : public ChoiceToChoiceComponentBase {
class ChoiceToChoiceTester : public ChoiceToChoiceComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -49,12 +49,12 @@ class ChoiceToChoice : public ChoiceToChoiceComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct ChoiceToChoice object
ChoiceToChoice(const char* const compName //!< The component name
//! Construct ChoiceToChoiceTester object
ChoiceToChoiceTester(const char* const compName //!< The component name
);
//! Destroy ChoiceToChoice object
~ChoiceToChoice();
//! Destroy ChoiceToChoiceTester object
~ChoiceToChoiceTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title ChoiceToState.cpp
// \title ChoiceToStateTester.cpp
// \author bocchino
// \brief cpp file for ChoiceToState component implementation class
// \brief cpp file for ChoiceToStateTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/choice/ChoiceToState.hpp"
#include "FppTest/state_machine/internal_instance/choice/ChoiceToStateTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,36 +17,37 @@ namespace SmInstanceChoice {
// Component construction and destruction
// ----------------------------------------------------------------------
ChoiceToState::ChoiceToState(const char* const compName)
ChoiceToStateTester::ChoiceToStateTester(const char* const compName)
: ChoiceToStateComponentBase(compName),
m_smChoiceChoiceToState_actionHistory(),
m_smChoiceChoiceToState_guard_g() {}
ChoiceToState::~ChoiceToState() {}
ChoiceToStateTester::~ChoiceToStateTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void ChoiceToState::FppTest_SmChoice_ChoiceToState_action_exitS1(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) {
void ChoiceToStateTester::FppTest_SmChoice_ChoiceToState_action_exitS1(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceChoiceToState);
this->m_smChoiceChoiceToState_actionHistory.push(signal, ActionId::EXIT_S1);
}
void ChoiceToState::FppTest_SmChoice_ChoiceToState_action_a(SmId smId, FppTest_SmChoice_ChoiceToState::Signal signal) {
void ChoiceToStateTester::FppTest_SmChoice_ChoiceToState_action_a(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceChoiceToState);
this->m_smChoiceChoiceToState_actionHistory.push(signal, ActionId::A);
}
void ChoiceToState::FppTest_SmChoice_ChoiceToState_action_enterS2(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) {
void ChoiceToStateTester::FppTest_SmChoice_ChoiceToState_action_enterS2(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceChoiceToState);
this->m_smChoiceChoiceToState_actionHistory.push(signal, ActionId::ENTER_S2);
}
void ChoiceToState::FppTest_SmChoice_ChoiceToState_action_enterS3(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) {
void ChoiceToStateTester::FppTest_SmChoice_ChoiceToState_action_enterS3(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) {
ASSERT_EQ(smId, SmId::smChoiceChoiceToState);
this->m_smChoiceChoiceToState_actionHistory.push(signal, ActionId::ENTER_S3);
}
@ -55,8 +56,8 @@ void ChoiceToState::FppTest_SmChoice_ChoiceToState_action_enterS3(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool ChoiceToState::FppTest_SmChoice_ChoiceToState_guard_g(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) const {
bool ChoiceToStateTester::FppTest_SmChoice_ChoiceToState_guard_g(SmId smId,
FppTest_SmChoice_ChoiceToState::Signal signal) const {
FW_ASSERT(smId == SmId::smChoiceChoiceToState, static_cast<FwAssertArgType>(smId));
return this->m_smChoiceChoiceToState_guard_g.call(signal);
}
@ -65,7 +66,7 @@ bool ChoiceToState::FppTest_SmChoice_ChoiceToState_guard_g(SmId smId,
// Tests
// ----------------------------------------------------------------------
void ChoiceToState::testTrue() {
void ChoiceToStateTester::testTrue() {
this->m_smChoiceChoiceToState_actionHistory.clear();
this->m_smChoiceChoiceToState_guard_g.reset();
this->m_smChoiceChoiceToState_guard_g.setReturnValue(true);
@ -93,7 +94,7 @@ void ChoiceToState::testTrue() {
ASSERT_EQ(this->smChoiceChoiceToState_getState(), SmChoice_ChoiceToState::State::S2_S3);
}
void ChoiceToState::testFalse() {
void ChoiceToStateTester::testFalse() {
this->m_smChoiceChoiceToState_actionHistory.clear();
this->m_smChoiceChoiceToState_guard_g.reset();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title ChoiceToState.hpp
// \title ChoiceToStateTester.hpp
// \author bocchino
// \brief hpp file for ChoiceToState component implementation class
// \brief hpp file for ChoiceToStateTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceChoice_ChoiceToState_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceChoice {
class ChoiceToState : public ChoiceToStateComponentBase {
class ChoiceToStateTester : public ChoiceToStateComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -50,12 +50,12 @@ class ChoiceToState : public ChoiceToStateComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct ChoiceToState object
ChoiceToState(const char* const compName //!< The component name
//! Construct ChoiceToStateTester object
ChoiceToStateTester(const char* const compName //!< The component name
);
//! Destroy ChoiceToState object
~ChoiceToState();
//! Destroy ChoiceToStateTester object
~ChoiceToStateTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title InputPairU16U32.cpp
// \title InputPairU16U32Tester.cpp
// \author bocchino
// \brief cpp file for InputPairU16U32 component implementation class
// \brief cpp file for InputPairU16U32Tester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/choice/InputPairU16U32.hpp"
#include "FppTest/state_machine/internal_instance/choice/InputPairU16U32Tester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,20 +17,20 @@ namespace SmInstanceChoice {
// Component construction and destruction
// ----------------------------------------------------------------------
InputPairU16U32 ::InputPairU16U32(const char* const compName)
InputPairU16U32Tester ::InputPairU16U32Tester(const char* const compName)
: InputPairU16U32ComponentBase(compName),
m_smChoiceInputPairU16U32_action_a_history(),
m_smChoiceInputPairU16U32_guard_g() {}
InputPairU16U32 ::~InputPairU16U32() {}
InputPairU16U32Tester ::~InputPairU16U32Tester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void InputPairU16U32 ::FppTest_SmChoice_InputPairU16U32_action_a(SmId smId,
FppTest_SmChoice_InputPairU16U32::Signal signal,
U32 value) {
void InputPairU16U32Tester ::FppTest_SmChoice_InputPairU16U32_action_a(SmId smId,
FppTest_SmChoice_InputPairU16U32::Signal signal,
U32 value) {
ASSERT_EQ(smId, SmId::smChoiceInputPairU16U32);
this->m_smChoiceInputPairU16U32_action_a_history.push(signal, value);
}
@ -39,9 +39,9 @@ void InputPairU16U32 ::FppTest_SmChoice_InputPairU16U32_action_a(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool InputPairU16U32 ::FppTest_SmChoice_InputPairU16U32_guard_g(SmId smId,
FppTest_SmChoice_InputPairU16U32::Signal signal,
U32 value) const {
bool InputPairU16U32Tester ::FppTest_SmChoice_InputPairU16U32_guard_g(SmId smId,
FppTest_SmChoice_InputPairU16U32::Signal signal,
U32 value) const {
FW_ASSERT(smId == SmId::smChoiceInputPairU16U32, static_cast<FwAssertArgType>(smId));
return this->m_smChoiceInputPairU16U32_guard_g.call(signal, value);
}
@ -50,7 +50,7 @@ bool InputPairU16U32 ::FppTest_SmChoice_InputPairU16U32_guard_g(SmId smId,
// Tests
// ----------------------------------------------------------------------
void InputPairU16U32::testS1True() {
void InputPairU16U32Tester::testS1True() {
this->m_smChoiceInputPairU16U32_action_a_history.clear();
this->m_smChoiceInputPairU16U32_guard_g.reset();
this->m_smChoiceInputPairU16U32_guard_g.setReturnValue(true);
@ -73,7 +73,7 @@ void InputPairU16U32::testS1True() {
ASSERT_EQ(this->smChoiceInputPairU16U32_getState(), SmChoice_InputPairU16U32::State::S2);
}
void InputPairU16U32::testS1False() {
void InputPairU16U32Tester::testS1False() {
this->m_smChoiceInputPairU16U32_action_a_history.clear();
this->m_smChoiceInputPairU16U32_guard_g.reset();
this->init(queueDepth, instanceId);
@ -95,7 +95,7 @@ void InputPairU16U32::testS1False() {
ASSERT_EQ(this->smChoiceInputPairU16U32_getState(), SmChoice_InputPairU16U32::State::S3);
}
void InputPairU16U32::testS2True() {
void InputPairU16U32Tester::testS2True() {
this->m_smChoiceInputPairU16U32_action_a_history.clear();
this->m_smChoiceInputPairU16U32_guard_g.reset();
this->m_smChoiceInputPairU16U32_guard_g.setReturnValue(true);
@ -118,7 +118,7 @@ void InputPairU16U32::testS2True() {
ASSERT_EQ(this->smChoiceInputPairU16U32_getState(), SmChoice_InputPairU16U32::State::S2);
}
void InputPairU16U32::testS2False() {
void InputPairU16U32Tester::testS2False() {
this->m_smChoiceInputPairU16U32_action_a_history.clear();
this->m_smChoiceInputPairU16U32_guard_g.reset();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title InputPairU16U32.hpp
// \title InputPairU16U32Tester.hpp
// \author bocchino
// \brief hpp file for InputPairU16U32 component implementation class
// \brief hpp file for InputPairU16U32Tester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceChoice_InputPairU16U32_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceChoice {
class InputPairU16U32 : public InputPairU16U32ComponentBase {
class InputPairU16U32Tester : public InputPairU16U32ComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class InputPairU16U32 : public InputPairU16U32ComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct InputPairU16U32 object
InputPairU16U32(const char* const compName //!< The component name
//! Construct InputPairU16U32Tester object
InputPairU16U32Tester(const char* const compName //!< The component name
);
//! Destroy InputPairU16U32 object
~InputPairU16U32();
//! Destroy InputPairU16U32Tester object
~InputPairU16U32Tester();
private:
// ----------------------------------------------------------------------

View File

@ -4,122 +4,122 @@
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/choice/Basic.hpp"
#include "FppTest/state_machine/internal_instance/choice/BasicU32.hpp"
#include "FppTest/state_machine/internal_instance/choice/ChoiceToChoice.hpp"
#include "FppTest/state_machine/internal_instance/choice/ChoiceToState.hpp"
#include "FppTest/state_machine/internal_instance/choice/InputPairU16U32.hpp"
#include "FppTest/state_machine/internal_instance/choice/Sequence.hpp"
#include "FppTest/state_machine/internal_instance/choice/SequenceU32.hpp"
#include "FppTest/state_machine/internal_instance/choice/BasicTester.hpp"
#include "FppTest/state_machine/internal_instance/choice/BasicU32Tester.hpp"
#include "FppTest/state_machine/internal_instance/choice/ChoiceToChoiceTester.hpp"
#include "FppTest/state_machine/internal_instance/choice/ChoiceToStateTester.hpp"
#include "FppTest/state_machine/internal_instance/choice/InputPairU16U32Tester.hpp"
#include "FppTest/state_machine/internal_instance/choice/SequenceTester.hpp"
#include "FppTest/state_machine/internal_instance/choice/SequenceU32Tester.hpp"
#include "STest/STest/Random/Random.hpp"
TEST(Basic, BasicTrue) {
FppTest::SmInstanceChoice::Basic basic("basic");
FppTest::SmInstanceChoice::BasicTester basic("basic");
basic.testBasicTrue();
}
TEST(Basic, BasicFalse) {
FppTest::SmInstanceChoice::Basic basic("basic");
FppTest::SmInstanceChoice::BasicTester basic("basic");
basic.testBasicFalse();
}
TEST(Basic, SmChoiceBasicTrue) {
FppTest::SmInstanceChoice::Basic basic("basic");
FppTest::SmInstanceChoice::BasicTester basic("basic");
basic.testSmChoiceBasicTrue();
}
TEST(Basic, SmChoiceBasicFalse) {
FppTest::SmInstanceChoice::Basic basic("basic");
FppTest::SmInstanceChoice::BasicTester basic("basic");
basic.testSmChoiceBasicFalse();
}
TEST(BasicU32, True) {
FppTest::SmInstanceChoice::BasicU32 basicU32("basicU32");
FppTest::SmInstanceChoice::BasicU32Tester basicU32("basicU32");
basicU32.testTrue();
}
TEST(BasicU32, False) {
FppTest::SmInstanceChoice::BasicU32 basicU32("basicU32");
FppTest::SmInstanceChoice::BasicU32Tester basicU32("basicU32");
basicU32.testFalse();
}
TEST(InputPairU16U32, S1True) {
FppTest::SmInstanceChoice::InputPairU16U32 inputPair("inputPair");
FppTest::SmInstanceChoice::InputPairU16U32Tester inputPair("inputPair");
inputPair.testS1True();
}
TEST(InputPairU16U32, S1False) {
FppTest::SmInstanceChoice::InputPairU16U32 inputPair("inputPair");
FppTest::SmInstanceChoice::InputPairU16U32Tester inputPair("inputPair");
inputPair.testS1False();
}
TEST(InputPairU16U32, S2True) {
FppTest::SmInstanceChoice::InputPairU16U32 inputPair("inputPair");
FppTest::SmInstanceChoice::InputPairU16U32Tester inputPair("inputPair");
inputPair.testS2True();
}
TEST(InputPairU16U32, S2False) {
FppTest::SmInstanceChoice::InputPairU16U32 inputPair("inputPair");
FppTest::SmInstanceChoice::InputPairU16U32Tester inputPair("inputPair");
inputPair.testS2False();
}
TEST(ChoiceToChoice, G1True) {
FppTest::SmInstanceChoice::ChoiceToChoice choiceToChoice("choiceToChoice");
FppTest::SmInstanceChoice::ChoiceToChoiceTester choiceToChoice("choiceToChoice");
choiceToChoice.testG1True();
}
TEST(ChoiceToChoice, G1FalseG2True) {
FppTest::SmInstanceChoice::ChoiceToChoice choiceToChoice("choiceToChoice");
FppTest::SmInstanceChoice::ChoiceToChoiceTester choiceToChoice("choiceToChoice");
choiceToChoice.testG1FalseG2True();
}
TEST(ChoiceToChoice, G1FalseG2False) {
FppTest::SmInstanceChoice::ChoiceToChoice choiceToChoice("choiceToChoice");
FppTest::SmInstanceChoice::ChoiceToChoiceTester choiceToChoice("choiceToChoice");
choiceToChoice.testG1FalseG2False();
}
TEST(ChoiceToChoice, Overflow) {
FppTest::SmInstanceChoice::ChoiceToChoice choiceToChoice("choiceToChoice");
FppTest::SmInstanceChoice::ChoiceToChoiceTester choiceToChoice("choiceToChoice");
choiceToChoice.testOverflow();
}
TEST(ChoiceToState, True) {
FppTest::SmInstanceChoice::ChoiceToState choiceToState("choiceToState");
FppTest::SmInstanceChoice::ChoiceToStateTester choiceToState("choiceToState");
choiceToState.testTrue();
}
TEST(ChoiceToState, False) {
FppTest::SmInstanceChoice::ChoiceToState choiceToState("choiceToState");
FppTest::SmInstanceChoice::ChoiceToStateTester choiceToState("choiceToState");
choiceToState.testFalse();
}
TEST(Sequence, G1True) {
FppTest::SmInstanceChoice::Sequence sequence("sequence");
FppTest::SmInstanceChoice::SequenceTester sequence("sequence");
sequence.testG1True();
}
TEST(Sequence, G1FalseG2True) {
FppTest::SmInstanceChoice::Sequence sequence("sequence");
FppTest::SmInstanceChoice::SequenceTester sequence("sequence");
sequence.testG1FalseG2True();
}
TEST(Sequence, G1FalseG2False) {
FppTest::SmInstanceChoice::Sequence sequence("sequence");
FppTest::SmInstanceChoice::SequenceTester sequence("sequence");
sequence.testG1FalseG2False();
}
TEST(SequenceU32, G1True) {
FppTest::SmInstanceChoice::SequenceU32 sequenceU32("sequenceU32");
FppTest::SmInstanceChoice::SequenceU32Tester sequenceU32("sequenceU32");
sequenceU32.testG1True();
}
TEST(SequenceU32, G1FalseG2True) {
FppTest::SmInstanceChoice::SequenceU32 sequenceU32("sequenceU32");
FppTest::SmInstanceChoice::SequenceU32Tester sequenceU32("sequenceU32");
sequenceU32.testG1FalseG2True();
}
TEST(SequenceU32, G1FalseG2False) {
FppTest::SmInstanceChoice::SequenceU32 sequenceU32("sequenceU32");
FppTest::SmInstanceChoice::SequenceU32Tester sequenceU32("sequenceU32");
sequenceU32.testG1FalseG2False();
}

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title Basic.cpp
// \title BasicTester.cpp
// \author bocchino
// \brief cpp file for Basic component implementation class
// \brief cpp file for BasicTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/initial/Basic.hpp"
#include "FppTest/state_machine/internal_instance/initial/BasicTester.hpp"
namespace FppTest {
@ -16,16 +16,16 @@ namespace SmInstanceInitial {
// Component construction and destruction
// ----------------------------------------------------------------------
Basic::Basic(const char* const compName)
BasicTester::BasicTester(const char* const compName)
: BasicComponentBase(compName), m_basic1_action_a_history(), m_smInitialBasic1_action_a_history() {}
Basic::~Basic() {}
BasicTester::~BasicTester() {}
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
void Basic::schedIn_handler(FwIndexType portNum, U32 context) {
void BasicTester::schedIn_handler(FwIndexType portNum, U32 context) {
// Nothing to do
}
@ -33,7 +33,7 @@ void Basic::schedIn_handler(FwIndexType portNum, U32 context) {
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void Basic::FppTest_SmInitial_Basic_action_a(SmId smId, FppTest_SmInitial_Basic::Signal signal) {
void BasicTester::FppTest_SmInitial_Basic_action_a(SmId smId, FppTest_SmInitial_Basic::Signal signal) {
ASSERT_TRUE((smId == SmId::smInitialBasic1) || (smId == SmId::smInitialBasic2));
if (smId == SmId::smInitialBasic1) {
this->m_smInitialBasic1_action_a_history.push(signal);
@ -42,8 +42,8 @@ void Basic::FppTest_SmInitial_Basic_action_a(SmId smId, FppTest_SmInitial_Basic:
}
}
void Basic::FppTest_SmInstanceInitial_Basic_Basic_action_a(SmId smId,
FppTest_SmInstanceInitial_Basic_Basic::Signal signal) {
void BasicTester::FppTest_SmInstanceInitial_Basic_Basic_action_a(SmId smId,
FppTest_SmInstanceInitial_Basic_Basic::Signal signal) {
ASSERT_TRUE((smId == SmId::basic1) || (smId == SmId::basic2));
if (smId == SmId::basic1) {
this->m_basic1_action_a_history.push(signal);
@ -56,7 +56,7 @@ void Basic::FppTest_SmInstanceInitial_Basic_Basic_action_a(SmId smId,
// Tests
// ----------------------------------------------------------------------
void Basic::test() {
void BasicTester::test() {
this->m_basic1_action_a_history.clear();
this->m_smInitialBasic1_action_a_history.clear();
ASSERT_EQ(this->basic1_getState(), Basic_Basic::State::__FPRIME_AC_UNINITIALIZED);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title Basic.hpp
// \title BasicTester.hpp
// \author bocchino
// \brief hpp file for Basic component implementation class
// \brief hpp file for BasicTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceInitial_Basic_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceInitial {
class Basic : public BasicComponentBase {
class BasicTester : public BasicComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -45,12 +45,12 @@ class Basic : public BasicComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct Basic object
Basic(const char* const compName //!< The component name
//! Construct BasicTester object
BasicTester(const char* const compName //!< The component name
);
//! Destroy Basic object
~Basic();
//! Destroy BasicTester object
~BasicTester();
private:
// ----------------------------------------------------------------------

View File

@ -7,9 +7,9 @@ set(MOD_DEPS FppTest/state_machine/internal/harness)
register_fprime_module()
set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/Basic.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Choice.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Nested.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ChoiceTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/NestedTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/main.cpp"
)
set(UT_MOD_DEPS STest)

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title Choice.cpp
// \title ChoiceTester.cpp
// \author bocchino
// \brief cpp file for Choice component implementation class
// \brief cpp file for ChoiceTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/initial/Choice.hpp"
#include "FppTest/state_machine/internal_instance/initial/ChoiceTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,26 +17,27 @@ namespace SmInstanceInitial {
// Component construction and destruction
// ----------------------------------------------------------------------
Choice::Choice(const char* const compName)
ChoiceTester::ChoiceTester(const char* const compName)
: ChoiceComponentBase(compName),
m_choice_action_a_history(),
m_smInitialChoice_action_a_history(),
m_choice_guard_g(),
m_smInitialChoice_guard_g() {}
Choice::~Choice() {}
ChoiceTester::~ChoiceTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void Choice::FppTest_SmInitial_Choice_action_a(SmId smId, FppTest_SmInitial_Choice::Signal signal) {
void ChoiceTester::FppTest_SmInitial_Choice_action_a(SmId smId, FppTest_SmInitial_Choice::Signal signal) {
ASSERT_EQ(smId, SmId::smInitialChoice);
this->m_smInitialChoice_action_a_history.push(signal);
}
void Choice::FppTest_SmInstanceInitial_Choice_Choice_action_a(SmId smId,
FppTest_SmInstanceInitial_Choice_Choice::Signal signal) {
void ChoiceTester::FppTest_SmInstanceInitial_Choice_Choice_action_a(
SmId smId,
FppTest_SmInstanceInitial_Choice_Choice::Signal signal) {
ASSERT_EQ(smId, SmId::choice);
this->m_choice_action_a_history.push(signal);
}
@ -45,12 +46,12 @@ void Choice::FppTest_SmInstanceInitial_Choice_Choice_action_a(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool Choice ::FppTest_SmInitial_Choice_guard_g(SmId smId, FppTest_SmInitial_Choice::Signal signal) const {
bool ChoiceTester ::FppTest_SmInitial_Choice_guard_g(SmId smId, FppTest_SmInitial_Choice::Signal signal) const {
FW_ASSERT(smId == SmId::smInitialChoice, static_cast<FwAssertArgType>(smId));
return m_smInitialChoice_guard_g.call(signal);
}
bool Choice ::FppTest_SmInstanceInitial_Choice_Choice_guard_g(
bool ChoiceTester ::FppTest_SmInstanceInitial_Choice_Choice_guard_g(
SmId smId,
FppTest_SmInstanceInitial_Choice_Choice::Signal signal) const {
FW_ASSERT(smId == SmId::choice, static_cast<FwAssertArgType>(smId));
@ -61,7 +62,7 @@ bool Choice ::FppTest_SmInstanceInitial_Choice_Choice_guard_g(
// Tests
// ----------------------------------------------------------------------
void Choice::testFalse() {
void ChoiceTester::testFalse() {
this->m_choice_action_a_history.clear();
this->m_smInitialChoice_action_a_history.clear();
this->m_choice_guard_g.reset();
@ -74,7 +75,7 @@ void Choice::testFalse() {
this->checkActionsAndGuards(expectedActionSize, expectedGuardSize);
}
void Choice::testTrue() {
void ChoiceTester::testTrue() {
this->m_choice_action_a_history.clear();
this->m_smInitialChoice_action_a_history.clear();
this->m_choice_guard_g.reset();
@ -93,7 +94,7 @@ void Choice::testTrue() {
// Helper functions
// ----------------------------------------------------------------------
void Choice::checkActionsAndGuards(FwIndexType expectedActionSize, FwIndexType expectedGuardSize) {
void ChoiceTester::checkActionsAndGuards(FwIndexType expectedActionSize, FwIndexType expectedGuardSize) {
ASSERT_EQ(this->m_choice_action_a_history.getSize(), expectedActionSize);
ASSERT_EQ(this->m_smInitialChoice_action_a_history.getSize(), expectedActionSize);
for (FwIndexType i = 0; i < expectedActionSize; i++) {

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title Choice.hpp
// \title ChoiceTester.hpp
// \author bocchino
// \brief hpp file for Choice component implementation class
// \brief hpp file for ChoiceTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceInitial_Choice_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceInitial {
class Choice : public ChoiceComponentBase {
class ChoiceTester : public ChoiceComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -45,12 +45,12 @@ class Choice : public ChoiceComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct Choice object
Choice(const char* const compName //!< The component name
//! Construct ChoiceTester object
ChoiceTester(const char* const compName //!< The component name
);
//! Destroy Choice object
~Choice();
//! Destroy ChoiceTester object
~ChoiceTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title Nested.cpp
// \title NestedTester.cpp
// \author bocchino
// \brief cpp file for Nested component implementation class
// \brief cpp file for NestedTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/initial/Nested.hpp"
#include "FppTest/state_machine/internal_instance/initial/NestedTester.hpp"
namespace FppTest {
@ -16,22 +16,23 @@ namespace SmInstanceInitial {
// Component construction and destruction
// ----------------------------------------------------------------------
Nested::Nested(const char* const compName)
NestedTester::NestedTester(const char* const compName)
: NestedComponentBase(compName), m_nested_action_a_history(), m_smInitialNested_action_a_history() {}
Nested::~Nested() {}
NestedTester::~NestedTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void Nested::FppTest_SmInitial_Nested_action_a(SmId smId, FppTest_SmInitial_Nested::Signal signal) {
void NestedTester::FppTest_SmInitial_Nested_action_a(SmId smId, FppTest_SmInitial_Nested::Signal signal) {
ASSERT_EQ(smId, SmId::smInitialNested);
this->m_smInitialNested_action_a_history.push(signal);
}
void Nested::FppTest_SmInstanceInitial_Nested_Nested_action_a(SmId smId,
FppTest_SmInstanceInitial_Nested_Nested::Signal signal) {
void NestedTester::FppTest_SmInstanceInitial_Nested_Nested_action_a(
SmId smId,
FppTest_SmInstanceInitial_Nested_Nested::Signal signal) {
ASSERT_EQ(smId, SmId::nested);
this->m_nested_action_a_history.push(signal);
}
@ -40,9 +41,9 @@ void Nested::FppTest_SmInstanceInitial_Nested_Nested_action_a(SmId smId,
// Overflow hook implementations for internal state machines
// ----------------------------------------------------------------------
void Nested ::smInitialNested_stateMachineOverflowHook(SmId smId,
FwEnumStoreType signal,
Fw::SerializeBufferBase& buffer) {
void NestedTester ::smInitialNested_stateMachineOverflowHook(SmId smId,
FwEnumStoreType signal,
Fw::SerializeBufferBase& buffer) {
// Nothing to do
}
@ -50,7 +51,7 @@ void Nested ::smInitialNested_stateMachineOverflowHook(SmId smId,
// Tests
// ----------------------------------------------------------------------
void Nested::test() {
void NestedTester::test() {
this->m_nested_action_a_history.clear();
this->m_smInitialNested_action_a_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title Nested.hpp
// \title NestedTester.hpp
// \author bocchino
// \brief hpp file for Nested component implementation class
// \brief hpp file for NestedTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceInitial_Nested_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceInitial {
class Nested : public NestedComponentBase {
class NestedTester : public NestedComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -45,12 +45,12 @@ class Nested : public NestedComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct Nested object
Nested(const char* const compName //!< The component name
//! Construct NestedTester object
NestedTester(const char* const compName //!< The component name
);
//! Destroy Nested object
~Nested();
//! Destroy NestedTester object
~NestedTester();
private:
// ----------------------------------------------------------------------

View File

@ -4,28 +4,28 @@
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/initial/Basic.hpp"
#include "FppTest/state_machine/internal_instance/initial/Choice.hpp"
#include "FppTest/state_machine/internal_instance/initial/Nested.hpp"
#include "FppTest/state_machine/internal_instance/initial/BasicTester.hpp"
#include "FppTest/state_machine/internal_instance/initial/ChoiceTester.hpp"
#include "FppTest/state_machine/internal_instance/initial/NestedTester.hpp"
#include "STest/STest/Random/Random.hpp"
TEST(Basic, Test) {
FppTest::SmInstanceInitial::Basic basic("basic");
FppTest::SmInstanceInitial::BasicTester basic("basic");
basic.test();
}
TEST(Choice, False) {
FppTest::SmInstanceInitial::Choice choice("choice");
FppTest::SmInstanceInitial::ChoiceTester choice("choice");
choice.testFalse();
}
TEST(Choice, True) {
FppTest::SmInstanceInitial::Choice choice("choice");
FppTest::SmInstanceInitial::ChoiceTester choice("choice");
choice.testTrue();
}
TEST(Nested, Test) {
FppTest::SmInstanceInitial::Nested nested("nested");
FppTest::SmInstanceInitial::NestedTester nested("nested");
nested.test();
}

View File

@ -1,13 +1,13 @@
// ======================================================================
// \title BasicGuardString.cpp
// \title BasicGuardStringTester.cpp
// \author bocchino
// \brief cpp file for BasicGuardString component implementation class
// \brief cpp file for BasicGuardStringTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal/state/FppConstantsAc.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardString.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardStringTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -18,20 +18,20 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicGuardString ::BasicGuardString(const char* const compName)
BasicGuardStringTester ::BasicGuardStringTester(const char* const compName)
: BasicGuardStringComponentBase(compName),
m_smStateBasicGuardString_action_a_history(),
m_smStateBasicGuardString_guard_g() {}
BasicGuardString ::~BasicGuardString() {}
BasicGuardStringTester ::~BasicGuardStringTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicGuardString ::FppTest_SmState_BasicGuardString_action_a(SmId smId,
FppTest_SmState_BasicGuardString::Signal signal,
const Fw::StringBase& value) {
void BasicGuardStringTester ::FppTest_SmState_BasicGuardString_action_a(SmId smId,
FppTest_SmState_BasicGuardString::Signal signal,
const Fw::StringBase& value) {
ASSERT_EQ(smId, SmId::smStateBasicGuardString);
this->m_smStateBasicGuardString_action_a_history.push(signal, Fw::String(value));
}
@ -40,9 +40,9 @@ void BasicGuardString ::FppTest_SmState_BasicGuardString_action_a(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicGuardString ::FppTest_SmState_BasicGuardString_guard_g(SmId smId,
FppTest_SmState_BasicGuardString::Signal signal,
const Fw::StringBase& value) const {
bool BasicGuardStringTester ::FppTest_SmState_BasicGuardString_guard_g(SmId smId,
FppTest_SmState_BasicGuardString::Signal signal,
const Fw::StringBase& value) const {
FW_ASSERT(smId == SmId::smStateBasicGuardString, static_cast<FwAssertArgType>(smId));
return this->m_smStateBasicGuardString_guard_g.call(signal, Fw::String(value));
}
@ -51,7 +51,7 @@ bool BasicGuardString ::FppTest_SmState_BasicGuardString_guard_g(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicGuardString::testFalse() {
void BasicGuardStringTester::testFalse() {
this->m_smStateBasicGuardString_action_a_history.clear();
this->m_smStateBasicGuardString_guard_g.reset();
this->init(queueDepth, instanceId);
@ -71,7 +71,7 @@ void BasicGuardString::testFalse() {
ASSERT_EQ(this->m_smStateBasicGuardString_action_a_history.getSize(), 0);
}
void BasicGuardString::testTrue() {
void BasicGuardStringTester::testTrue() {
this->m_smStateBasicGuardString_action_a_history.clear();
this->m_smStateBasicGuardString_guard_g.reset();
this->m_smStateBasicGuardString_guard_g.setReturnValue(true);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicGuardString.hpp
// \title BasicGuardStringTester.hpp
// \author bocchino
// \brief hpp file for BasicGuardString component implementation class
// \brief hpp file for BasicGuardStringTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicGuardString_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicGuardString : public BasicGuardStringComponentBase {
class BasicGuardStringTester : public BasicGuardStringComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicGuardString : public BasicGuardStringComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicGuardString object
BasicGuardString(const char* const compName //!< The component name
//! Construct BasicGuardStringTester object
BasicGuardStringTester(const char* const compName //!< The component name
);
//! Destroy BasicGuardString object
~BasicGuardString();
//! Destroy BasicGuardStringTester object
~BasicGuardStringTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicGuardTestAbsType.cpp
// \title BasicGuardTestAbsTypeTester.cpp
// \author bocchino
// \brief cpp file for BasicGuardTestAbsType component implementation class
// \brief cpp file for BasicGuardTestAbsTypeTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestAbsType.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestAbsTypeTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,19 +17,19 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicGuardTestAbsType::BasicGuardTestAbsType(const char* const compName)
BasicGuardTestAbsTypeTester::BasicGuardTestAbsTypeTester(const char* const compName)
: BasicGuardTestAbsTypeComponentBase(compName),
m_value(),
m_smStateBasicGuardTestAbsType_action_a_history(),
m_smStateBasicGuardTestAbsType_guard_g() {}
BasicGuardTestAbsType::~BasicGuardTestAbsType() {}
BasicGuardTestAbsTypeTester::~BasicGuardTestAbsTypeTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicGuardTestAbsType::FppTest_SmState_BasicGuardTestAbsType_action_a(
void BasicGuardTestAbsTypeTester::FppTest_SmState_BasicGuardTestAbsType_action_a(
SmId smId,
FppTest_SmState_BasicGuardTestAbsType::Signal signal,
const SmHarness::TestAbsType& value) {
@ -41,7 +41,7 @@ void BasicGuardTestAbsType::FppTest_SmState_BasicGuardTestAbsType_action_a(
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicGuardTestAbsType::FppTest_SmState_BasicGuardTestAbsType_guard_g(
bool BasicGuardTestAbsTypeTester::FppTest_SmState_BasicGuardTestAbsType_guard_g(
SmId smId,
FppTest_SmState_BasicGuardTestAbsType::Signal signal,
const SmHarness::TestAbsType& value) const {
@ -53,9 +53,10 @@ bool BasicGuardTestAbsType::FppTest_SmState_BasicGuardTestAbsType_guard_g(
// Overflow hook implementations for internal state machines
// ----------------------------------------------------------------------
void BasicGuardTestAbsType::smStateBasicGuardTestAbsType_stateMachineOverflowHook(SmId smId,
FwEnumStoreType signal,
Fw::SerializeBufferBase& buffer) {
void BasicGuardTestAbsTypeTester::smStateBasicGuardTestAbsType_stateMachineOverflowHook(
SmId smId,
FwEnumStoreType signal,
Fw::SerializeBufferBase& buffer) {
this->m_hookCalled = true;
ASSERT_EQ(smId, SmId::smStateBasicGuardTestAbsType);
ASSERT_EQ(static_cast<SmState_BasicGuardTestAbsType::Signal>(signal), SmState_BasicGuardTestAbsType::Signal::s);
@ -70,7 +71,7 @@ void BasicGuardTestAbsType::smStateBasicGuardTestAbsType_stateMachineOverflowHoo
// Tests
// ----------------------------------------------------------------------
void BasicGuardTestAbsType::testFalse() {
void BasicGuardTestAbsTypeTester::testFalse() {
this->m_smStateBasicGuardTestAbsType_action_a_history.clear();
this->m_smStateBasicGuardTestAbsType_guard_g.reset();
this->init(queueDepth, instanceId);
@ -90,7 +91,7 @@ void BasicGuardTestAbsType::testFalse() {
ASSERT_EQ(this->m_smStateBasicGuardTestAbsType_action_a_history.getSize(), 0);
}
void BasicGuardTestAbsType::testTrue() {
void BasicGuardTestAbsTypeTester::testTrue() {
this->m_smStateBasicGuardTestAbsType_action_a_history.clear();
this->m_smStateBasicGuardTestAbsType_guard_g.reset();
this->m_smStateBasicGuardTestAbsType_guard_g.setReturnValue(true);
@ -114,7 +115,7 @@ void BasicGuardTestAbsType::testTrue() {
ASSERT_EQ(this->m_smStateBasicGuardTestAbsType_action_a_history.getValues().getItemAt(0), this->m_value);
}
void BasicGuardTestAbsType::testOverflow() {
void BasicGuardTestAbsTypeTester::testOverflow() {
this->init(queueDepth, instanceId);
this->m_value = SmHarness::Pick::testAbsType();
for (FwSizeType i = 0; i < queueDepth; i++) {

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicGuardTestAbsType.hpp
// \title BasicGuardTestAbsTypeTester.hpp
// \author bocchino
// \brief hpp file for BasicGuardTestAbsType component implementation class
// \brief hpp file for BasicGuardTestAbsTypeTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicGuardTestAbsType_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicGuardTestAbsType : public BasicGuardTestAbsTypeComponentBase {
class BasicGuardTestAbsTypeTester : public BasicGuardTestAbsTypeComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicGuardTestAbsType : public BasicGuardTestAbsTypeComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicGuardTestAbsType object
BasicGuardTestAbsType(const char* const compName //!< The component name
//! Construct BasicGuardTestAbsTypeTester object
BasicGuardTestAbsTypeTester(const char* const compName //!< The component name
);
//! Destroy BasicGuardTestAbsType object
~BasicGuardTestAbsType();
//! Destroy BasicGuardTestAbsTypeTester object
~BasicGuardTestAbsTypeTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicGuardTestArray.cpp
// \title BasicGuardTestArrayTester.cpp
// \author bocchino
// \brief cpp file for BasicGuardTestArray component implementation class
// \brief cpp file for BasicGuardTestArrayTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestArray.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestArrayTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,18 +17,18 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicGuardTestArray::BasicGuardTestArray(const char* const compName)
BasicGuardTestArrayTester::BasicGuardTestArrayTester(const char* const compName)
: BasicGuardTestArrayComponentBase(compName),
m_smStateBasicGuardTestArray_action_a_history(),
m_smStateBasicGuardTestArray_guard_g() {}
BasicGuardTestArray::~BasicGuardTestArray() {}
BasicGuardTestArrayTester::~BasicGuardTestArrayTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicGuardTestArray::FppTest_SmState_BasicGuardTestArray_action_a(
void BasicGuardTestArrayTester::FppTest_SmState_BasicGuardTestArray_action_a(
SmId smId,
FppTest_SmState_BasicGuardTestArray::Signal signal,
const SmHarness::TestArray& value) {
@ -40,7 +40,7 @@ void BasicGuardTestArray::FppTest_SmState_BasicGuardTestArray_action_a(
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicGuardTestArray::FppTest_SmState_BasicGuardTestArray_guard_g(
bool BasicGuardTestArrayTester::FppTest_SmState_BasicGuardTestArray_guard_g(
SmId smId,
FppTest_SmState_BasicGuardTestArray::Signal signal,
const SmHarness::TestArray& value) const {
@ -52,7 +52,7 @@ bool BasicGuardTestArray::FppTest_SmState_BasicGuardTestArray_guard_g(
// Tests
// ----------------------------------------------------------------------
void BasicGuardTestArray::testFalse() {
void BasicGuardTestArrayTester::testFalse() {
this->m_smStateBasicGuardTestArray_action_a_history.clear();
this->m_smStateBasicGuardTestArray_guard_g.reset();
this->init(queueDepth, instanceId);
@ -71,7 +71,7 @@ void BasicGuardTestArray::testFalse() {
ASSERT_EQ(this->m_smStateBasicGuardTestArray_action_a_history.getSize(), 0);
}
void BasicGuardTestArray::testTrue() {
void BasicGuardTestArrayTester::testTrue() {
this->m_smStateBasicGuardTestArray_action_a_history.clear();
this->m_smStateBasicGuardTestArray_guard_g.reset();
this->m_smStateBasicGuardTestArray_guard_g.setReturnValue(true);
@ -96,4 +96,4 @@ void BasicGuardTestArray::testTrue() {
} // namespace SmInstanceState
} // namespace FppTest
} // namespace FppTest

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicGuardTestArray.hpp
// \title BasicGuardTestArrayTester.hpp
// \author bocchino
// \brief hpp file for BasicGuardTestArray component implementation class
// \brief hpp file for BasicGuardTestArrayTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicGuardTestArray_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicGuardTestArray : public BasicGuardTestArrayComponentBase {
class BasicGuardTestArrayTester : public BasicGuardTestArrayComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicGuardTestArray : public BasicGuardTestArrayComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicGuardTestArray object
BasicGuardTestArray(const char* const compName //!< The component name
//! Construct BasicGuardTestArrayTester object
BasicGuardTestArrayTester(const char* const compName //!< The component name
);
//! Destroy BasicGuardTestArray object
~BasicGuardTestArray();
//! Destroy BasicGuardTestArrayTester object
~BasicGuardTestArrayTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicGuardTestEnum.cpp
// \title BasicGuardTestEnumTester.cpp
// \author bocchino
// \brief cpp file for BasicGuardTestEnum component implementation class
// \brief cpp file for BasicGuardTestEnumTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestEnum.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestEnumTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,20 +17,21 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicGuardTestEnum::BasicGuardTestEnum(const char* const compName)
BasicGuardTestEnumTester::BasicGuardTestEnumTester(const char* const compName)
: BasicGuardTestEnumComponentBase(compName),
m_smStateBasicGuardTestEnum_action_a_history(),
m_smStateBasicGuardTestEnum_guard_g() {}
BasicGuardTestEnum::~BasicGuardTestEnum() {}
BasicGuardTestEnumTester::~BasicGuardTestEnumTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicGuardTestEnum::FppTest_SmState_BasicGuardTestEnum_action_a(SmId smId,
FppTest_SmState_BasicGuardTestEnum::Signal signal,
const SmHarness::TestEnum& value) {
void BasicGuardTestEnumTester::FppTest_SmState_BasicGuardTestEnum_action_a(
SmId smId,
FppTest_SmState_BasicGuardTestEnum::Signal signal,
const SmHarness::TestEnum& value) {
ASSERT_EQ(smId, SmId::smStateBasicGuardTestEnum);
this->m_smStateBasicGuardTestEnum_action_a_history.push(signal, value);
}
@ -39,9 +40,10 @@ void BasicGuardTestEnum::FppTest_SmState_BasicGuardTestEnum_action_a(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicGuardTestEnum::FppTest_SmState_BasicGuardTestEnum_guard_g(SmId smId,
FppTest_SmState_BasicGuardTestEnum::Signal signal,
const SmHarness::TestEnum& value) const {
bool BasicGuardTestEnumTester::FppTest_SmState_BasicGuardTestEnum_guard_g(
SmId smId,
FppTest_SmState_BasicGuardTestEnum::Signal signal,
const SmHarness::TestEnum& value) const {
FW_ASSERT(smId == SmId::smStateBasicGuardTestEnum, static_cast<FwAssertArgType>(smId));
return this->m_smStateBasicGuardTestEnum_guard_g.call(signal, value);
}
@ -50,7 +52,7 @@ bool BasicGuardTestEnum::FppTest_SmState_BasicGuardTestEnum_guard_g(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicGuardTestEnum::testFalse() {
void BasicGuardTestEnumTester::testFalse() {
this->m_smStateBasicGuardTestEnum_action_a_history.clear();
this->m_smStateBasicGuardTestEnum_guard_g.reset();
this->init(queueDepth, instanceId);
@ -69,7 +71,7 @@ void BasicGuardTestEnum::testFalse() {
ASSERT_EQ(this->m_smStateBasicGuardTestEnum_action_a_history.getSize(), 0);
}
void BasicGuardTestEnum::testTrue() {
void BasicGuardTestEnumTester::testTrue() {
this->m_smStateBasicGuardTestEnum_action_a_history.clear();
this->m_smStateBasicGuardTestEnum_guard_g.reset();
this->m_smStateBasicGuardTestEnum_guard_g.setReturnValue(true);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicGuardTestEnum.hpp
// \title BasicGuardTestEnumTester.hpp
// \author bocchino
// \brief hpp file for BasicGuardTestEnum component implementation class
// \brief hpp file for BasicGuardTestEnumTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicGuardTestEnum_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicGuardTestEnum : public BasicGuardTestEnumComponentBase {
class BasicGuardTestEnumTester : public BasicGuardTestEnumComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicGuardTestEnum : public BasicGuardTestEnumComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicGuardTestEnum object
BasicGuardTestEnum(const char* const compName //!< The component name
//! Construct BasicGuardTestEnumTester object
BasicGuardTestEnumTester(const char* const compName //!< The component name
);
//! Destroy BasicGuardTestEnum object
~BasicGuardTestEnum();
//! Destroy BasicGuardTestEnumTester object
~BasicGuardTestEnumTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicGuardTestStruct.cpp
// \title BasicGuardTestStructTester.cpp
// \author bocchino
// \brief cpp file for BasicGuardTestStruct component implementation class
// \brief cpp file for BasicGuardTestStructTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestStruct.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestStructTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,18 +17,18 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicGuardTestStruct::BasicGuardTestStruct(const char* const compName)
BasicGuardTestStructTester::BasicGuardTestStructTester(const char* const compName)
: BasicGuardTestStructComponentBase(compName),
m_smStateBasicGuardTestStruct_action_a_history(),
m_smStateBasicGuardTestStruct_guard_g() {}
BasicGuardTestStruct::~BasicGuardTestStruct() {}
BasicGuardTestStructTester::~BasicGuardTestStructTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicGuardTestStruct::FppTest_SmState_BasicGuardTestStruct_action_a(
void BasicGuardTestStructTester::FppTest_SmState_BasicGuardTestStruct_action_a(
SmId smId,
FppTest_SmState_BasicGuardTestStruct::Signal signal,
const SmHarness::TestStruct& value) {
@ -40,7 +40,7 @@ void BasicGuardTestStruct::FppTest_SmState_BasicGuardTestStruct_action_a(
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicGuardTestStruct::FppTest_SmState_BasicGuardTestStruct_guard_g(
bool BasicGuardTestStructTester::FppTest_SmState_BasicGuardTestStruct_guard_g(
SmId smId,
FppTest_SmState_BasicGuardTestStruct::Signal signal,
const SmHarness::TestStruct& value) const {
@ -52,7 +52,7 @@ bool BasicGuardTestStruct::FppTest_SmState_BasicGuardTestStruct_guard_g(
// Tests
// ----------------------------------------------------------------------
void BasicGuardTestStruct::testFalse() {
void BasicGuardTestStructTester::testFalse() {
this->m_smStateBasicGuardTestStruct_action_a_history.clear();
this->m_smStateBasicGuardTestStruct_guard_g.reset();
this->init(queueDepth, instanceId);
@ -71,7 +71,7 @@ void BasicGuardTestStruct::testFalse() {
ASSERT_EQ(this->m_smStateBasicGuardTestStruct_action_a_history.getSize(), 0);
}
void BasicGuardTestStruct::testTrue() {
void BasicGuardTestStructTester::testTrue() {
this->m_smStateBasicGuardTestStruct_action_a_history.clear();
this->m_smStateBasicGuardTestStruct_guard_g.reset();
this->m_smStateBasicGuardTestStruct_guard_g.setReturnValue(true);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicGuardTestStruct.hpp
// \title BasicGuardTestStructTester.hpp
// \author bocchino
// \brief hpp file for BasicGuardTestStruct component implementation class
// \brief hpp file for BasicGuardTestStructTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicGuardTestStruct_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicGuardTestStruct : public BasicGuardTestStructComponentBase {
class BasicGuardTestStructTester : public BasicGuardTestStructComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicGuardTestStruct : public BasicGuardTestStructComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicGuardTestStruct object
BasicGuardTestStruct(const char* const compName //!< The component name
//! Construct BasicGuardTestStructTester object
BasicGuardTestStructTester(const char* const compName //!< The component name
);
//! Destroy BasicGuardTestStruct object
~BasicGuardTestStruct();
//! Destroy BasicGuardTestStructTester object
~BasicGuardTestStructTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicGuard.cpp
// \title BasicGuardTester.cpp
// \author bocchino
// \brief cpp file for BasicGuard component implementation class
// \brief cpp file for BasicGuardTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicGuard.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,16 +17,16 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicGuard ::BasicGuard(const char* const compName)
BasicGuardTester ::BasicGuardTester(const char* const compName)
: BasicGuardComponentBase(compName), m_smStateBasicGuard_action_a_history(), m_smStateBasicGuard_guard_g() {}
BasicGuard ::~BasicGuard() {}
BasicGuardTester ::~BasicGuardTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicGuard ::FppTest_SmState_BasicGuard_action_a(SmId smId, FppTest_SmState_BasicGuard::Signal signal) {
void BasicGuardTester ::FppTest_SmState_BasicGuard_action_a(SmId smId, FppTest_SmState_BasicGuard::Signal signal) {
ASSERT_EQ(smId, SmId::smStateBasicGuard);
this->m_smStateBasicGuard_action_a_history.push(signal);
}
@ -35,7 +35,7 @@ void BasicGuard ::FppTest_SmState_BasicGuard_action_a(SmId smId, FppTest_SmState
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicGuard ::FppTest_SmState_BasicGuard_guard_g(SmId smId, FppTest_SmState_BasicGuard::Signal signal) const {
bool BasicGuardTester ::FppTest_SmState_BasicGuard_guard_g(SmId smId, FppTest_SmState_BasicGuard::Signal signal) const {
FW_ASSERT(smId == SmId::smStateBasicGuard, static_cast<FwAssertArgType>(smId));
return this->m_smStateBasicGuard_guard_g.call(signal);
}
@ -44,7 +44,7 @@ bool BasicGuard ::FppTest_SmState_BasicGuard_guard_g(SmId smId, FppTest_SmState_
// Tests
// ----------------------------------------------------------------------
void BasicGuard::testFalse() {
void BasicGuardTester::testFalse() {
this->m_smStateBasicGuard_action_a_history.clear();
this->m_smStateBasicGuard_guard_g.reset();
this->init(queueDepth, instanceId);
@ -58,7 +58,7 @@ void BasicGuard::testFalse() {
this->checkActionsAndGuards(0, 1);
}
void BasicGuard::testTrue() {
void BasicGuardTester::testTrue() {
this->m_smStateBasicGuard_action_a_history.clear();
this->m_smStateBasicGuard_guard_g.reset();
this->m_smStateBasicGuard_guard_g.setReturnValue(true);
@ -77,7 +77,7 @@ void BasicGuard::testTrue() {
// Helper functions
// ----------------------------------------------------------------------
void BasicGuard::checkActionsAndGuards(FwIndexType expectedActionSize, FwIndexType expectedGuardSize) {
void BasicGuardTester::checkActionsAndGuards(FwIndexType expectedActionSize, FwIndexType expectedGuardSize) {
ASSERT_EQ(this->m_smStateBasicGuard_action_a_history.getSize(), expectedActionSize);
for (FwIndexType i = 0; i < expectedActionSize; i++) {
ASSERT_EQ(this->m_smStateBasicGuard_action_a_history.getItemAt(i), SmState_BasicGuard::Signal::s);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicGuard.hpp
// \title BasicGuardTester.hpp
// \author bocchino
// \brief hpp file for BasicGuard component implementation class
// \brief hpp file for BasicGuardTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicGuard_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicGuard : public BasicGuardComponentBase {
class BasicGuardTester : public BasicGuardComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -43,11 +43,11 @@ class BasicGuard : public BasicGuardComponentBase {
// ----------------------------------------------------------------------
//! Construct BasicGuard object
BasicGuard(const char* const compName //!< The component name
BasicGuardTester(const char* const compName //!< The component name
);
//! Destroy BasicGuard object
~BasicGuard();
~BasicGuardTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicGuardU32.cpp
// \title BasicGuardU32Tester.cpp
// \author bocchino
// \brief cpp file for BasicGuardU32 component implementation class
// \brief cpp file for BasicGuardU32Tester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicGuardU32.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardU32Tester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,20 +17,20 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicGuardU32::BasicGuardU32(const char* const compName)
BasicGuardU32Tester::BasicGuardU32Tester(const char* const compName)
: BasicGuardU32ComponentBase(compName),
m_smStateBasicGuardU32_action_a_history(),
m_smStateBasicGuardU32_guard_g() {}
BasicGuardU32::~BasicGuardU32() {}
BasicGuardU32Tester::~BasicGuardU32Tester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicGuardU32::FppTest_SmState_BasicGuardU32_action_a(SmId smId,
FppTest_SmState_BasicGuardU32::Signal signal,
U32 value) {
void BasicGuardU32Tester::FppTest_SmState_BasicGuardU32_action_a(SmId smId,
FppTest_SmState_BasicGuardU32::Signal signal,
U32 value) {
ASSERT_EQ(smId, SmId::smStateBasicGuardU32);
this->m_smStateBasicGuardU32_action_a_history.push(signal, value);
}
@ -39,9 +39,9 @@ void BasicGuardU32::FppTest_SmState_BasicGuardU32_action_a(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool BasicGuardU32::FppTest_SmState_BasicGuardU32_guard_g(SmId smId,
FppTest_SmState_BasicGuardU32::Signal signal,
U32 value) const {
bool BasicGuardU32Tester::FppTest_SmState_BasicGuardU32_guard_g(SmId smId,
FppTest_SmState_BasicGuardU32::Signal signal,
U32 value) const {
FW_ASSERT(smId == SmId::smStateBasicGuardU32, static_cast<FwAssertArgType>(smId));
return this->m_smStateBasicGuardU32_guard_g.call(signal, value);
}
@ -50,7 +50,7 @@ bool BasicGuardU32::FppTest_SmState_BasicGuardU32_guard_g(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicGuardU32::testFalse() {
void BasicGuardU32Tester::testFalse() {
this->m_smStateBasicGuardU32_action_a_history.clear();
this->m_smStateBasicGuardU32_guard_g.reset();
this->init(queueDepth, instanceId);
@ -69,7 +69,7 @@ void BasicGuardU32::testFalse() {
ASSERT_EQ(this->m_smStateBasicGuardU32_action_a_history.getSize(), 0);
}
void BasicGuardU32::testTrue() {
void BasicGuardU32Tester::testTrue() {
this->m_smStateBasicGuardU32_action_a_history.clear();
this->m_smStateBasicGuardU32_guard_g.reset();
this->m_smStateBasicGuardU32_guard_g.setReturnValue(true);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicGuardU32.hpp
// \title BasicGuardU32Tester.hpp
// \author bocchino
// \brief hpp file for BasicGuardU32 component implementation class
// \brief hpp file for BasicGuardU32Tester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicGuardU32_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicGuardU32 : public BasicGuardU32ComponentBase {
class BasicGuardU32Tester : public BasicGuardU32ComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicGuardU32 : public BasicGuardU32ComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicGuardU32 object
BasicGuardU32(const char* const compName //!< The component name
//! Construct BasicGuardU32Tester object
BasicGuardU32Tester(const char* const compName //!< The component name
);
//! Destroy BasicGuardU32 object
~BasicGuardU32();
//! Destroy BasicGuardU32Tester object
~BasicGuardU32Tester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicInternal.cpp
// \title BasicInternalTester.cpp
// \author bocchino
// \brief cpp file for BasicInternal component implementation class
// \brief cpp file for BasicInternalTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicInternal.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicInternalTester.hpp"
namespace FppTest {
@ -16,16 +16,17 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicInternal::BasicInternal(const char* const compName)
BasicInternalTester::BasicInternalTester(const char* const compName)
: BasicInternalComponentBase(compName), m_smStateBasicInternal_action_a_history() {}
BasicInternal::~BasicInternal() {}
BasicInternalTester::~BasicInternalTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicInternal::FppTest_SmState_BasicInternal_action_a(SmId smId, FppTest_SmState_BasicInternal::Signal signal) {
void BasicInternalTester::FppTest_SmState_BasicInternal_action_a(SmId smId,
FppTest_SmState_BasicInternal::Signal signal) {
ASSERT_EQ(smId, SmId::smStateBasicInternal);
this->m_smStateBasicInternal_action_a_history.push(signal);
}
@ -34,7 +35,7 @@ void BasicInternal::FppTest_SmState_BasicInternal_action_a(SmId smId, FppTest_Sm
// Tests
// ----------------------------------------------------------------------
void BasicInternal::test() {
void BasicInternalTester::test() {
this->m_smStateBasicInternal_action_a_history.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStateBasicInternal_getState(), SmState_BasicInternal::State::S);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicInternal.hpp
// \title BasicInternalTester.hpp
// \author bocchino
// \brief hpp file for BasicInternal component implementation class
// \brief hpp file for BasicInternalTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicInternal_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicInternal : public BasicInternalComponentBase {
class BasicInternalTester : public BasicInternalComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicInternal : public BasicInternalComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicInternal object
BasicInternal(const char* const compName //!< The component name
//! Construct BasicInternalTester object
BasicInternalTester(const char* const compName //!< The component name
);
//! Destroy BasicInternal object
~BasicInternal();
//! Destroy BasicInternalTester object
~BasicInternalTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicSelf.cpp
// \title BasicSelfTester.cpp
// \author bocchino
// \brief cpp file for BasicSelf component implementation class
// \brief cpp file for BasicSelfTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicSelf.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicSelfTester.hpp"
namespace FppTest {
@ -16,16 +16,16 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicSelf::BasicSelf(const char* const compName)
BasicSelfTester::BasicSelfTester(const char* const compName)
: BasicSelfComponentBase(compName), m_smStateBasicSelf_action_a_history() {}
BasicSelf::~BasicSelf() {}
BasicSelfTester::~BasicSelfTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicSelf::FppTest_SmState_BasicSelf_action_a(SmId smId, FppTest_SmState_BasicSelf::Signal signal) {
void BasicSelfTester::FppTest_SmState_BasicSelf_action_a(SmId smId, FppTest_SmState_BasicSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateBasicSelf);
this->m_smStateBasicSelf_action_a_history.push(signal);
}
@ -34,7 +34,7 @@ void BasicSelf::FppTest_SmState_BasicSelf_action_a(SmId smId, FppTest_SmState_Ba
// Tests
// ----------------------------------------------------------------------
void BasicSelf::test() {
void BasicSelfTester::test() {
this->m_smStateBasicSelf_action_a_history.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStateBasicSelf_getState(), SmState_BasicSelf::State::S);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicSelf.hpp
// \title BasicSelfTester.hpp
// \author bocchino
// \brief hpp file for BasicSelf component implementation class
// \brief hpp file for BasicSelfTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicSelf_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicSelf : public BasicSelfComponentBase {
class BasicSelfTester : public BasicSelfComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -42,12 +42,12 @@ class BasicSelf : public BasicSelfComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicSelf object
BasicSelf(const char* const compName //!< The component name
//! Construct BasicSelfTester object
BasicSelfTester(const char* const compName //!< The component name
);
//! Destroy BasicSelf object
~BasicSelf();
//! Destroy BasicSelfTester object
~BasicSelfTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,13 +1,13 @@
// ======================================================================
// \title BasicString.cpp
// \title BasicStringTester.cpp
// \author bocchino
// \brief cpp file for BasicString component implementation class
// \brief cpp file for BasicStringTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal/state/FppConstantsAc.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicString.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicStringTester.hpp"
namespace FppTest {
@ -17,24 +17,24 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicString ::BasicString(const char* const compName)
BasicStringTester ::BasicStringTester(const char* const compName)
: BasicStringComponentBase(compName),
m_smStateBasicString_action_a_history(),
m_smStateBasicString_action_b_history() {}
BasicString ::~BasicString() {}
BasicStringTester ::~BasicStringTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicString ::FppTest_SmState_BasicString_action_a(SmId smId, FppTest_SmState_BasicString::Signal signal) {
void BasicStringTester ::FppTest_SmState_BasicString_action_a(SmId smId, FppTest_SmState_BasicString::Signal signal) {
this->m_smStateBasicString_action_a_history.push(signal);
}
void BasicString ::FppTest_SmState_BasicString_action_b(SmId smId,
FppTest_SmState_BasicString::Signal signal,
const Fw::StringBase& value) {
void BasicStringTester ::FppTest_SmState_BasicString_action_b(SmId smId,
FppTest_SmState_BasicString::Signal signal,
const Fw::StringBase& value) {
this->m_smStateBasicString_action_b_history.push(signal, Fw::String(value));
}
@ -42,7 +42,7 @@ void BasicString ::FppTest_SmState_BasicString_action_b(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicString::test() {
void BasicStringTester::test() {
this->m_smStateBasicString_action_a_history.clear();
this->m_smStateBasicString_action_b_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicString.hpp
// \title BasicStringTester.hpp
// \author bocchino
// \brief hpp file for BasicString component implementation class
// \brief hpp file for BasicStringTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicString_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicString : public BasicStringComponentBase {
class BasicStringTester : public BasicStringComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class BasicString : public BasicStringComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicString object
BasicString(const char* const compName //!< The component name
//! Construct BasicStringTester object
BasicStringTester(const char* const compName //!< The component name
);
//! Destroy BasicString object
~BasicString();
//! Destroy BasicStringTester object
~BasicStringTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicTestAbsType.cpp
// \title BasicTestAbsTypeTester.cpp
// \author bocchino
// \brief cpp file for BasicTestAbsType component implementation class
// \brief cpp file for BasicTestAbsTypeTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicTestAbsType.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestAbsTypeTester.hpp"
namespace FppTest {
@ -16,25 +16,26 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicTestAbsType ::BasicTestAbsType(const char* const compName)
BasicTestAbsTypeTester ::BasicTestAbsTypeTester(const char* const compName)
: BasicTestAbsTypeComponentBase(compName),
m_smStateBasicTestAbsType_action_a_history(),
m_smStateBasicTestAbsType_action_b_history() {}
BasicTestAbsType ::~BasicTestAbsType() {}
BasicTestAbsTypeTester ::~BasicTestAbsTypeTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicTestAbsType ::FppTest_SmState_BasicTestAbsType_action_a(SmId smId,
FppTest_SmState_BasicTestAbsType::Signal signal) {
void BasicTestAbsTypeTester ::FppTest_SmState_BasicTestAbsType_action_a(
SmId smId,
FppTest_SmState_BasicTestAbsType::Signal signal) {
this->m_smStateBasicTestAbsType_action_a_history.push(signal);
}
void BasicTestAbsType ::FppTest_SmState_BasicTestAbsType_action_b(SmId smId,
FppTest_SmState_BasicTestAbsType::Signal signal,
const SmHarness::TestAbsType& value) {
void BasicTestAbsTypeTester ::FppTest_SmState_BasicTestAbsType_action_b(SmId smId,
FppTest_SmState_BasicTestAbsType::Signal signal,
const SmHarness::TestAbsType& value) {
this->m_smStateBasicTestAbsType_action_b_history.push(signal, value);
}
@ -42,7 +43,7 @@ void BasicTestAbsType ::FppTest_SmState_BasicTestAbsType_action_b(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicTestAbsType::test() {
void BasicTestAbsTypeTester::test() {
this->m_smStateBasicTestAbsType_action_a_history.clear();
this->m_smStateBasicTestAbsType_action_b_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicTestAbsType.hpp
// \title BasicTestAbsTypeTester.hpp
// \author bocchino
// \brief hpp file for BasicTestAbsType component implementation class
// \brief hpp file for BasicTestAbsTypeTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicTestAbsType_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicTestAbsType : public BasicTestAbsTypeComponentBase {
class BasicTestAbsTypeTester : public BasicTestAbsTypeComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class BasicTestAbsType : public BasicTestAbsTypeComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicTestAbsType object
BasicTestAbsType(const char* const compName //!< The component name
//! Construct BasicTestAbsTypeTester object
BasicTestAbsTypeTester(const char* const compName //!< The component name
);
//! Destroy BasicTestAbsType object
~BasicTestAbsType();
//! Destroy BasicTestAbsTypeTester object
~BasicTestAbsTypeTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicTestArray.cpp
// \title BasicTestArrayTester.cpp
// \author bocchino
// \brief cpp file for BasicTestArray component implementation class
// \brief cpp file for BasicTestArrayTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicTestArray.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestArrayTester.hpp"
namespace FppTest {
@ -16,24 +16,25 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicTestArray::BasicTestArray(const char* const compName)
BasicTestArrayTester::BasicTestArrayTester(const char* const compName)
: BasicTestArrayComponentBase(compName),
m_smStateBasicTestArray_action_a_history(),
m_smStateBasicTestArray_action_b_history() {}
BasicTestArray::~BasicTestArray() {}
BasicTestArrayTester::~BasicTestArrayTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicTestArray::FppTest_SmState_BasicTestArray_action_a(SmId smId, FppTest_SmState_BasicTestArray::Signal signal) {
void BasicTestArrayTester::FppTest_SmState_BasicTestArray_action_a(SmId smId,
FppTest_SmState_BasicTestArray::Signal signal) {
this->m_smStateBasicTestArray_action_a_history.push(signal);
}
void BasicTestArray::FppTest_SmState_BasicTestArray_action_b(SmId smId,
FppTest_SmState_BasicTestArray::Signal signal,
const SmHarness::TestArray& value) {
void BasicTestArrayTester::FppTest_SmState_BasicTestArray_action_b(SmId smId,
FppTest_SmState_BasicTestArray::Signal signal,
const SmHarness::TestArray& value) {
this->m_smStateBasicTestArray_action_b_history.push(signal, value);
}
@ -41,7 +42,7 @@ void BasicTestArray::FppTest_SmState_BasicTestArray_action_b(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicTestArray::test() {
void BasicTestArrayTester::test() {
this->m_smStateBasicTestArray_action_a_history.clear();
this->m_smStateBasicTestArray_action_b_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicTestArray.hpp
// \title BasicTestArrayTester.hpp
// \author bocchino
// \brief hpp file for BasicTestArray component implementation class
// \brief hpp file for BasicTestArrayTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicTestArray_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicTestArray : public BasicTestArrayComponentBase {
class BasicTestArrayTester : public BasicTestArrayComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class BasicTestArray : public BasicTestArrayComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicTestArray object
BasicTestArray(const char* const compName //!< The component name
//! Construct BasicTestArrayTester object
BasicTestArrayTester(const char* const compName //!< The component name
);
//! Destroy BasicTestArray object
~BasicTestArray();
//! Destroy BasicTestArrayTester object
~BasicTestArrayTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicTestEnum.cpp
// \title BasicTestEnumTester.cpp
// \author bocchino
// \brief cpp file for BasicTestEnum component implementation class
// \brief cpp file for BasicTestEnumTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicTestEnum.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestEnumTester.hpp"
namespace FppTest {
@ -16,24 +16,25 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicTestEnum::BasicTestEnum(const char* const compName)
BasicTestEnumTester::BasicTestEnumTester(const char* const compName)
: BasicTestEnumComponentBase(compName),
m_smStateBasicTestEnum_action_a_history(),
m_smStateBasicTestEnum_action_b_history() {}
BasicTestEnum::~BasicTestEnum() {}
BasicTestEnumTester::~BasicTestEnumTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicTestEnum::FppTest_SmState_BasicTestEnum_action_a(SmId smId, FppTest_SmState_BasicTestEnum::Signal signal) {
void BasicTestEnumTester::FppTest_SmState_BasicTestEnum_action_a(SmId smId,
FppTest_SmState_BasicTestEnum::Signal signal) {
this->m_smStateBasicTestEnum_action_a_history.push(signal);
}
void BasicTestEnum::FppTest_SmState_BasicTestEnum_action_b(SmId smId,
FppTest_SmState_BasicTestEnum::Signal signal,
const SmHarness::TestEnum& value) {
void BasicTestEnumTester::FppTest_SmState_BasicTestEnum_action_b(SmId smId,
FppTest_SmState_BasicTestEnum::Signal signal,
const SmHarness::TestEnum& value) {
this->m_smStateBasicTestEnum_action_b_history.push(signal, value);
}
@ -41,7 +42,7 @@ void BasicTestEnum::FppTest_SmState_BasicTestEnum_action_b(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicTestEnum::test() {
void BasicTestEnumTester::test() {
this->m_smStateBasicTestEnum_action_a_history.clear();
this->m_smStateBasicTestEnum_action_b_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicTestEnum.hpp
// \title BasicTestEnumTester.hpp
// \author bocchino
// \brief hpp file for BasicTestEnum component implementation class
// \brief hpp file for BasicTestEnumTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicTestEnum_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicTestEnum : public BasicTestEnumComponentBase {
class BasicTestEnumTester : public BasicTestEnumComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class BasicTestEnum : public BasicTestEnumComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicTestEnum object
BasicTestEnum(const char* const compName //!< The component name
//! Construct BasicTestEnumTester object
BasicTestEnumTester(const char* const compName //!< The component name
);
//! Destroy BasicTestEnum object
~BasicTestEnum();
//! Destroy BasicTestEnumTester object
~BasicTestEnumTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicTestStruct.cpp
// \title BasicTestStructTester.cpp
// \author bocchino
// \brief cpp file for BasicTestStruct component implementation class
// \brief cpp file for BasicTestStructTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicTestStruct.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestStructTester.hpp"
namespace FppTest {
@ -16,25 +16,25 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicTestStruct::BasicTestStruct(const char* const compName)
BasicTestStructTester::BasicTestStructTester(const char* const compName)
: BasicTestStructComponentBase(compName),
m_smStateBasicTestStruct_action_a_history(),
m_smStateBasicTestStruct_action_b_history() {}
BasicTestStruct::~BasicTestStruct() {}
BasicTestStructTester::~BasicTestStructTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicTestStruct::FppTest_SmState_BasicTestStruct_action_a(SmId smId,
FppTest_SmState_BasicTestStruct::Signal signal) {
void BasicTestStructTester::FppTest_SmState_BasicTestStruct_action_a(SmId smId,
FppTest_SmState_BasicTestStruct::Signal signal) {
this->m_smStateBasicTestStruct_action_a_history.push(signal);
}
void BasicTestStruct::FppTest_SmState_BasicTestStruct_action_b(SmId smId,
FppTest_SmState_BasicTestStruct::Signal signal,
const SmHarness::TestStruct& value) {
void BasicTestStructTester::FppTest_SmState_BasicTestStruct_action_b(SmId smId,
FppTest_SmState_BasicTestStruct::Signal signal,
const SmHarness::TestStruct& value) {
this->m_smStateBasicTestStruct_action_b_history.push(signal, value);
}
@ -42,7 +42,7 @@ void BasicTestStruct::FppTest_SmState_BasicTestStruct_action_b(SmId smId,
// Tests
// ----------------------------------------------------------------------
void BasicTestStruct::test() {
void BasicTestStructTester::test() {
this->m_smStateBasicTestStruct_action_a_history.clear();
this->m_smStateBasicTestStruct_action_b_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicTestStruct.hpp
// \title BasicTestStructTester.hpp
// \author bocchino
// \brief hpp file for BasicTestStruct component implementation class
// \brief hpp file for BasicTestStructTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicTestStruct_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicTestStruct : public BasicTestStructComponentBase {
class BasicTestStructTester : public BasicTestStructComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class BasicTestStruct : public BasicTestStructComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicTestStruct object
BasicTestStruct(const char* const compName //!< The component name
//! Construct BasicTestStructTester object
BasicTestStructTester(const char* const compName //!< The component name
);
//! Destroy BasicTestStruct object
~BasicTestStruct();
//! Destroy BasicTestStructTester object
~BasicTestStructTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title Basic.cpp
// \title BasicTester.cpp
// \author bocchino
// \brief cpp file for Basic component implementation class
// \brief cpp file for BasicTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/Basic.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTester.hpp"
namespace FppTest {
@ -16,16 +16,16 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
Basic ::Basic(const char* const compName)
BasicTester ::BasicTester(const char* const compName)
: BasicComponentBase(compName), m_basic1_action_a_history(), m_smStateBasic1_action_a_history() {}
Basic ::~Basic() {}
BasicTester ::~BasicTester() {}
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
void Basic::schedIn_handler(FwIndexType portNum, U32 context) {
void BasicTester::schedIn_handler(FwIndexType portNum, U32 context) {
// Nothing to do
}
@ -33,8 +33,8 @@ void Basic::schedIn_handler(FwIndexType portNum, U32 context) {
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void Basic ::FppTest_SmInstanceState_Basic_Basic_action_a(SmId smId,
FppTest_SmInstanceState_Basic_Basic::Signal signal) {
void BasicTester ::FppTest_SmInstanceState_Basic_Basic_action_a(SmId smId,
FppTest_SmInstanceState_Basic_Basic::Signal signal) {
ASSERT_TRUE((smId == SmId::basic1) || (smId == SmId::basic2));
if (smId == SmId::basic1) {
this->m_basic1_action_a_history.push(signal);
@ -43,7 +43,7 @@ void Basic ::FppTest_SmInstanceState_Basic_Basic_action_a(SmId smId,
}
}
void Basic ::FppTest_SmState_Basic_action_a(SmId smId, FppTest_SmState_Basic::Signal signal) {
void BasicTester ::FppTest_SmState_Basic_action_a(SmId smId, FppTest_SmState_Basic::Signal signal) {
ASSERT_TRUE((smId == SmId::smStateBasic1) || (smId == SmId::smStateBasic2));
if (smId == SmId::smStateBasic1) {
this->m_smStateBasic1_action_a_history.push(signal);
@ -56,7 +56,7 @@ void Basic ::FppTest_SmState_Basic_action_a(SmId smId, FppTest_SmState_Basic::Si
// Tests
// ----------------------------------------------------------------------
void Basic::test() {
void BasicTester::test() {
this->m_basic1_action_a_history.clear();
this->m_smStateBasic1_action_a_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title Basic.hpp
// \title BasicTester.hpp
// \author bocchino
// \brief hpp file for Basic component implementation class
// \brief hpp file for BasicTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_Basic_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class Basic : public BasicComponentBase {
class BasicTester : public BasicComponentBase {
private:
// ----------------------------------------------------------------------
// Constants
@ -46,11 +46,11 @@ class Basic : public BasicComponentBase {
// ----------------------------------------------------------------------
//! Construct Basic object
Basic(const char* const compName //!< The component name
BasicTester(const char* const compName //!< The component name
);
//! Destroy Basic object
~Basic();
~BasicTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title BasicU32.cpp
// \title BasicU32Tester.cpp
// \author bocchino
// \brief cpp file for BasicU32 component implementation class
// \brief cpp file for BasicU32Tester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/BasicU32.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicU32Tester.hpp"
namespace FppTest {
@ -16,20 +16,20 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
BasicU32::BasicU32(const char* const compName)
BasicU32Tester::BasicU32Tester(const char* const compName)
: BasicU32ComponentBase(compName), m_smStateBasicU32_action_a_history(), m_smStateBasicU32_action_b_history() {}
BasicU32::~BasicU32() {}
BasicU32Tester::~BasicU32Tester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void BasicU32::FppTest_SmState_BasicU32_action_a(SmId smId, FppTest_SmState_BasicU32::Signal signal) {
void BasicU32Tester::FppTest_SmState_BasicU32_action_a(SmId smId, FppTest_SmState_BasicU32::Signal signal) {
this->m_smStateBasicU32_action_a_history.push(signal);
}
void BasicU32::FppTest_SmState_BasicU32_action_b(SmId smId, FppTest_SmState_BasicU32::Signal signal, U32 value) {
void BasicU32Tester::FppTest_SmState_BasicU32_action_b(SmId smId, FppTest_SmState_BasicU32::Signal signal, U32 value) {
this->m_smStateBasicU32_action_b_history.push(signal, value);
}
@ -37,7 +37,7 @@ void BasicU32::FppTest_SmState_BasicU32_action_b(SmId smId, FppTest_SmState_Basi
// Tests
// ----------------------------------------------------------------------
void BasicU32::test() {
void BasicU32Tester::test() {
this->m_smStateBasicU32_action_a_history.clear();
this->m_smStateBasicU32_action_b_history.clear();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title BasicU32.hpp
// \title BasicU32Tester.hpp
// \author bocchino
// \brief hpp file for BasicU32 component implementation class
// \brief hpp file for BasicU32Tester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_BasicU32_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class BasicU32 : public BasicU32ComponentBase {
class BasicU32Tester : public BasicU32ComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class BasicU32 : public BasicU32ComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct BasicU32 object
BasicU32(const char* const compName //!< The component name
//! Construct BasicU32Tester object
BasicU32Tester(const char* const compName //!< The component name
);
//! Destroy BasicU32 object
~BasicU32();
//! Destroy BasicU32Tester object
~BasicU32Tester();
private:
// ----------------------------------------------------------------------

View File

@ -26,28 +26,28 @@ set(MOD_DEPS FppTest/state_machine/internal/harness)
register_fprime_module()
set(UT_SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/Basic.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuard.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardString.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestAbsType.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestArray.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestEnum.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestStruct.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardU32.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicInternal.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicSelf.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicString.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestAbsType.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestArray.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestEnum.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestStruct.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicU32.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Internal.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Polymorphism.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToChild.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToChoice.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToSelf.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToState.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardStringTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestAbsTypeTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestArrayTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestEnumTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardTestStructTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicGuardU32Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicInternalTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicSelfTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicStringTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestAbsTypeTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestArrayTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestEnumTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicTestStructTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/BasicU32Tester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/InternalTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/PolymorphismTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToChildTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToChoiceTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToSelfTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/StateToStateTester.cpp"
"${CMAKE_CURRENT_LIST_DIR}/main.cpp"
)
set(UT_MOD_DEPS STest)

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title Internal.cpp
// \title InternalTester.cpp
// \author bocchino
// \brief cpp file for Internal component implementation class
// \brief cpp file for InternalTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/Internal.hpp"
#include "FppTest/state_machine/internal_instance/state/InternalTester.hpp"
namespace FppTest {
@ -16,16 +16,16 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
Internal::Internal(const char* const compName)
InternalTester::InternalTester(const char* const compName)
: InternalComponentBase(compName), m_smStateInternal_action_a_history() {}
Internal::~Internal() {}
InternalTester::~InternalTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void Internal::FppTest_SmState_Internal_action_a(SmId smId, FppTest_SmState_Internal::Signal signal) {
void InternalTester::FppTest_SmState_Internal_action_a(SmId smId, FppTest_SmState_Internal::Signal signal) {
ASSERT_EQ(smId, SmId::smStateInternal);
this->m_smStateInternal_action_a_history.push(signal);
}
@ -34,14 +34,14 @@ void Internal::FppTest_SmState_Internal_action_a(SmId smId, FppTest_SmState_Inte
// Tests
// ----------------------------------------------------------------------
void Internal::testInit() {
void InternalTester::testInit() {
this->m_smStateInternal_action_a_history.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(smStateInternal_getState(), SmState_Internal::State::S1_S2);
ASSERT_EQ(this->m_smStateInternal_action_a_history.getSize(), 0);
}
void Internal::testS2_internal() {
void InternalTester::testS2_internal() {
this->m_smStateInternal_action_a_history.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(smStateInternal_getState(), SmState_Internal::State::S1_S2);
@ -53,7 +53,7 @@ void Internal::testS2_internal() {
ASSERT_EQ(this->m_smStateInternal_action_a_history.getItemAt(0), SmState_Internal::Signal::S1_internal);
}
void Internal::testS2_to_S3() {
void InternalTester::testS2_to_S3() {
this->m_smStateInternal_action_a_history.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(smStateInternal_getState(), SmState_Internal::State::S1_S2);
@ -64,7 +64,7 @@ void Internal::testS2_to_S3() {
ASSERT_EQ(this->m_smStateInternal_action_a_history.getSize(), 0);
}
void Internal::testS3_internal() {
void InternalTester::testS3_internal() {
this->m_smStateInternal_action_a_history.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(smStateInternal_getState(), SmState_Internal::State::S1_S2);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title Internal.hpp
// \title InternalTester.hpp
// \author bocchino
// \brief hpp file for Internal component implementation class
// \brief hpp file for InternalTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_Internal_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class Internal : public InternalComponentBase {
class InternalTester : public InternalComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class Internal : public InternalComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct Internal object
Internal(const char* const compName //!< The component name
//! Construct InternalTester object
InternalTester(const char* const compName //!< The component name
);
//! Destroy Internal object
~Internal();
//! Destroy InternalTester object
~InternalTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title Polymorphism.cpp
// \title PolymorphismTester.cpp
// \author bocchino
// \brief cpp file for Polymorphism component implementation class
// \brief cpp file for PolymorphismTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/Polymorphism.hpp"
#include "FppTest/state_machine/internal_instance/state/PolymorphismTester.hpp"
namespace FppTest {
@ -16,20 +16,20 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
Polymorphism::Polymorphism(const char* const compName) : PolymorphismComponentBase(compName) {}
PolymorphismTester::PolymorphismTester(const char* const compName) : PolymorphismComponentBase(compName) {}
Polymorphism::~Polymorphism() {}
PolymorphismTester::~PolymorphismTester() {}
// ----------------------------------------------------------------------
// Tests
// ----------------------------------------------------------------------
void Polymorphism::testInit() {
void PolymorphismTester::testInit() {
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStatePolymorphism_getState(), SmState_Polymorphism::State::S1_S2);
}
void Polymorphism::testS2_poly() {
void PolymorphismTester::testS2_poly() {
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStatePolymorphism_getState(), SmState_Polymorphism::State::S1_S2);
this->smStatePolymorphism_sendSignal_poly();
@ -38,7 +38,7 @@ void Polymorphism::testS2_poly() {
ASSERT_EQ(this->smStatePolymorphism_getState(), SmState_Polymorphism::State::S4);
}
void Polymorphism::testS2_to_S3() {
void PolymorphismTester::testS2_to_S3() {
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStatePolymorphism_getState(), SmState_Polymorphism::State::S1_S2);
this->smStatePolymorphism_sendSignal_S2_to_S3();
@ -47,7 +47,7 @@ void Polymorphism::testS2_to_S3() {
ASSERT_EQ(this->smStatePolymorphism_getState(), SmState_Polymorphism::State::S1_S3);
}
void Polymorphism::testS3_poly() {
void PolymorphismTester::testS3_poly() {
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStatePolymorphism_getState(), SmState_Polymorphism::State::S1_S2);
{

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title Polymorphism.hpp
// \title PolymorphismTester.hpp
// \author bocchino
// \brief hpp file for Polymorphism component implementation class
// \brief hpp file for PolymorphismTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_Polymorphism_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class Polymorphism : public PolymorphismComponentBase {
class PolymorphismTester : public PolymorphismComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -30,12 +30,12 @@ class Polymorphism : public PolymorphismComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct Polymorphism object
Polymorphism(const char* const compName //!< The component name
//! Construct PolymorphismTester object
PolymorphismTester(const char* const compName //!< The component name
);
//! Destroy Polymorphism object
~Polymorphism();
//! Destroy PolymorphismTester object
~PolymorphismTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title StateToChild.cpp
// \title StateToChildTester.cpp
// \author bocchino
// \brief cpp file for StateToChild component implementation class
// \brief cpp file for StateToChildTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/StateToChild.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToChildTester.hpp"
namespace FppTest {
@ -16,36 +16,40 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
StateToChild::StateToChild(const char* const compName)
StateToChildTester::StateToChildTester(const char* const compName)
: StateToChildComponentBase(compName), m_smStateStateToChild_actionHistory() {}
StateToChild::~StateToChild() {}
StateToChildTester::~StateToChildTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void StateToChild::FppTest_SmState_StateToChild_action_exitS2(SmId smId, FppTest_SmState_StateToChild::Signal signal) {
void StateToChildTester::FppTest_SmState_StateToChild_action_exitS2(SmId smId,
FppTest_SmState_StateToChild::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChild);
this->m_smStateStateToChild_actionHistory.push(signal, ActionId::EXIT_S2);
}
void StateToChild::FppTest_SmState_StateToChild_action_exitS3(SmId smId, FppTest_SmState_StateToChild::Signal signal) {
void StateToChildTester::FppTest_SmState_StateToChild_action_exitS3(SmId smId,
FppTest_SmState_StateToChild::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChild);
this->m_smStateStateToChild_actionHistory.push(signal, ActionId::EXIT_S3);
}
void StateToChild::FppTest_SmState_StateToChild_action_a(SmId smId, FppTest_SmState_StateToChild::Signal signal) {
void StateToChildTester::FppTest_SmState_StateToChild_action_a(SmId smId, FppTest_SmState_StateToChild::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChild);
this->m_smStateStateToChild_actionHistory.push(signal, ActionId::A);
}
void StateToChild::FppTest_SmState_StateToChild_action_enterS2(SmId smId, FppTest_SmState_StateToChild::Signal signal) {
void StateToChildTester::FppTest_SmState_StateToChild_action_enterS2(SmId smId,
FppTest_SmState_StateToChild::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChild);
this->m_smStateStateToChild_actionHistory.push(signal, ActionId::ENTER_S2);
}
void StateToChild::FppTest_SmState_StateToChild_action_enterS3(SmId smId, FppTest_SmState_StateToChild::Signal signal) {
void StateToChildTester::FppTest_SmState_StateToChild_action_enterS3(SmId smId,
FppTest_SmState_StateToChild::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChild);
this->m_smStateStateToChild_actionHistory.push(signal, ActionId::ENTER_S3);
}
@ -54,7 +58,7 @@ void StateToChild::FppTest_SmState_StateToChild_action_enterS3(SmId smId, FppTes
// Tests
// ----------------------------------------------------------------------
void StateToChild::testInit() {
void StateToChildTester::testInit() {
this->m_smStateStateToChild_actionHistory.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStateStateToChild_getState(), SmState_StateToChild::State::S1_S2);
@ -65,7 +69,7 @@ void StateToChild::testInit() {
ASSERT_EQ(actions.getItemAt(0), ActionId::ENTER_S2);
}
void StateToChild::testS2_to_S2() {
void StateToChildTester::testS2_to_S2() {
this->m_smStateStateToChild_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToChild_actionHistory.clear();
@ -85,7 +89,7 @@ void StateToChild::testS2_to_S2() {
ASSERT_EQ(actions.getItemAt(2), ActionId::ENTER_S2);
}
void StateToChild::testS2_to_S3() {
void StateToChildTester::testS2_to_S3() {
this->m_smStateStateToChild_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToChild_actionHistory.clear();
@ -104,7 +108,7 @@ void StateToChild::testS2_to_S3() {
ASSERT_EQ(actions.getItemAt(1), ActionId::ENTER_S3);
}
void StateToChild::testS3_to_S2() {
void StateToChildTester::testS3_to_S2() {
this->m_smStateStateToChild_actionHistory.clear();
this->init(queueDepth, instanceId);
{
@ -132,6 +136,7 @@ void StateToChild::testS3_to_S2() {
ASSERT_EQ(actions.getItemAt(1), ActionId::A);
ASSERT_EQ(actions.getItemAt(2), ActionId::ENTER_S2);
}
} // namespace SmInstanceState
} // namespace FppTest

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title StateToChild.hpp
// \title StateToChildTester.hpp
// \author bocchino
// \brief hpp file for StateToChild component implementation class
// \brief hpp file for StateToChildTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_StateToChild_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class StateToChild : public StateToChildComponentBase {
class StateToChildTester : public StateToChildComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class StateToChild : public StateToChildComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct StateToChild object
StateToChild(const char* const compName //!< The component name
//! Construct StateToChildTester object
StateToChildTester(const char* const compName //!< The component name
);
//! Destroy StateToChild object
~StateToChild();
//! Destroy StateToChildTester object
~StateToChildTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title StateToChoice.cpp
// \title StateToChoiceTester.cpp
// \author bocchino
// \brief cpp file for StateToChoice component implementation class
// \brief cpp file for StateToChoiceTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/StateToChoice.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToChoiceTester.hpp"
#include "Fw/Types/Assert.hpp"
namespace FppTest {
@ -17,58 +17,59 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
StateToChoice::StateToChoice(const char* const compName)
StateToChoiceTester::StateToChoiceTester(const char* const compName)
: StateToChoiceComponentBase(compName), m_smStateStateToChoice_actionHistory(), m_smStateStateToChoice_guard_g() {}
StateToChoice::~StateToChoice() {}
StateToChoiceTester::~StateToChoiceTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void StateToChoice::FppTest_SmState_StateToChoice_action_exitS1(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_exitS1(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::EXIT_S1);
}
void StateToChoice::FppTest_SmState_StateToChoice_action_exitS2(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_exitS2(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::EXIT_S2);
}
void StateToChoice::FppTest_SmState_StateToChoice_action_exitS3(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_exitS3(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::EXIT_S3);
}
void StateToChoice::FppTest_SmState_StateToChoice_action_a(SmId smId, FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_a(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::A);
}
void StateToChoice::FppTest_SmState_StateToChoice_action_enterS1(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_enterS1(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::ENTER_S1);
}
void StateToChoice::FppTest_SmState_StateToChoice_action_enterS2(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_enterS2(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::ENTER_S2);
}
void StateToChoice::FppTest_SmState_StateToChoice_action_enterS3(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_enterS3(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::ENTER_S3);
}
void StateToChoice::FppTest_SmState_StateToChoice_action_enterS4(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
void StateToChoiceTester::FppTest_SmState_StateToChoice_action_enterS4(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToChoice);
this->m_smStateStateToChoice_actionHistory.push(signal, ActionId::ENTER_S4);
}
@ -77,8 +78,8 @@ void StateToChoice::FppTest_SmState_StateToChoice_action_enterS4(SmId smId,
// Implementations for internal state machine guards
// ----------------------------------------------------------------------
bool StateToChoice ::FppTest_SmState_StateToChoice_guard_g(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) const {
bool StateToChoiceTester::FppTest_SmState_StateToChoice_guard_g(SmId smId,
FppTest_SmState_StateToChoice::Signal signal) const {
FW_ASSERT(smId == SmId::smStateStateToChoice, static_cast<FwAssertArgType>(smId));
return this->m_smStateStateToChoice_guard_g.call(signal);
}
@ -87,7 +88,7 @@ bool StateToChoice ::FppTest_SmState_StateToChoice_guard_g(SmId smId,
// Tests
// ----------------------------------------------------------------------
void StateToChoice::testInit() {
void StateToChoiceTester::testInit() {
this->m_smStateStateToChoice_actionHistory.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStateStateToChoice_getState(), SmState_StateToChoice::State::S1_S2);
@ -102,7 +103,7 @@ void StateToChoice::testInit() {
ASSERT_EQ(actions.getItemAt(1), ActionId::ENTER_S2);
}
void StateToChoice::testS2_to_C() {
void StateToChoiceTester::testS2_to_C() {
this->m_smStateStateToChoice_actionHistory.clear();
this->m_smStateStateToChoice_guard_g.reset();
this->m_smStateStateToChoice_guard_g.setReturnValue(true);
@ -125,7 +126,7 @@ void StateToChoice::testS2_to_C() {
ASSERT_EQ(actions.getItemAt(3), ActionId::ENTER_S4);
}
void StateToChoice::testS2_to_S3() {
void StateToChoiceTester::testS2_to_S3() {
this->m_smStateStateToChoice_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToChoice_actionHistory.clear();
@ -144,7 +145,7 @@ void StateToChoice::testS2_to_S3() {
ASSERT_EQ(actions.getItemAt(1), ActionId::ENTER_S3);
}
void StateToChoice::testS2_to_S4() {
void StateToChoiceTester::testS2_to_S4() {
this->m_smStateStateToChoice_actionHistory.clear();
this->m_smStateStateToChoice_guard_g.reset();
this->m_smStateStateToChoice_guard_g.setReturnValue(true);
@ -167,7 +168,7 @@ void StateToChoice::testS2_to_S4() {
ASSERT_EQ(actions.getItemAt(3), ActionId::ENTER_S4);
}
void StateToChoice::testS3_to_C() {
void StateToChoiceTester::testS3_to_C() {
this->m_smStateStateToChoice_actionHistory.clear();
this->m_smStateStateToChoice_guard_g.reset();
this->init(queueDepth, instanceId);
@ -197,7 +198,7 @@ void StateToChoice::testS3_to_C() {
ASSERT_EQ(actions.getItemAt(3), ActionId::ENTER_S4);
}
void StateToChoice::testS3_to_S4() {
void StateToChoiceTester::testS3_to_S4() {
this->m_smStateStateToChoice_actionHistory.clear();
this->m_smStateStateToChoice_guard_g.reset();
this->init(queueDepth, instanceId);

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title StateToChoice.hpp
// \title StateToChoiceTester.hpp
// \author bocchino
// \brief hpp file for StateToChoice component implementation class
// \brief hpp file for StateToChoiceTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_StateToChoice_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class StateToChoice : public StateToChoiceComponentBase {
class StateToChoiceTester : public StateToChoiceComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class StateToChoice : public StateToChoiceComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct StateToChoice object
StateToChoice(const char* const compName //!< The component name
//! Construct StateToChoiceTester object
StateToChoiceTester(const char* const compName //!< The component name
);
//! Destroy StateToChoice object
~StateToChoice();
//! Destroy StateToChoiceTester object
~StateToChoiceTester();
private:
// ----------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title StateToSelf.cpp
// \title StateToSelfTester.cpp
// \author bocchino
// \brief cpp file for StateToSelf component implementation class
// \brief cpp file for StateToSelfTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/StateToSelf.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToSelfTester.hpp"
namespace FppTest {
@ -16,46 +16,52 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
StateToSelf::StateToSelf(const char* const compName)
StateToSelfTester::StateToSelfTester(const char* const compName)
: StateToSelfComponentBase(compName), m_smStateStateToSelf_actionHistory() {}
StateToSelf::~StateToSelf() {}
StateToSelfTester::~StateToSelfTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void StateToSelf::FppTest_SmState_StateToSelf_action_exitS1(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
void StateToSelfTester::FppTest_SmState_StateToSelf_action_exitS1(SmId smId,
FppTest_SmState_StateToSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToSelf);
this->m_smStateStateToSelf_actionHistory.push(signal, ActionId::EXIT_S1);
}
void StateToSelf::FppTest_SmState_StateToSelf_action_exitS2(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
void StateToSelfTester::FppTest_SmState_StateToSelf_action_exitS2(SmId smId,
FppTest_SmState_StateToSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToSelf);
this->m_smStateStateToSelf_actionHistory.push(signal, ActionId::EXIT_S2);
}
void StateToSelf::FppTest_SmState_StateToSelf_action_exitS3(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
void StateToSelfTester::FppTest_SmState_StateToSelf_action_exitS3(SmId smId,
FppTest_SmState_StateToSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToSelf);
this->m_smStateStateToSelf_actionHistory.push(signal, ActionId::EXIT_S3);
}
void StateToSelf::FppTest_SmState_StateToSelf_action_a(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
void StateToSelfTester::FppTest_SmState_StateToSelf_action_a(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToSelf);
this->m_smStateStateToSelf_actionHistory.push(signal, ActionId::A);
}
void StateToSelf::FppTest_SmState_StateToSelf_action_enterS1(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
void StateToSelfTester::FppTest_SmState_StateToSelf_action_enterS1(SmId smId,
FppTest_SmState_StateToSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToSelf);
this->m_smStateStateToSelf_actionHistory.push(signal, ActionId::ENTER_S1);
}
void StateToSelf::FppTest_SmState_StateToSelf_action_enterS2(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
void StateToSelfTester::FppTest_SmState_StateToSelf_action_enterS2(SmId smId,
FppTest_SmState_StateToSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToSelf);
this->m_smStateStateToSelf_actionHistory.push(signal, ActionId::ENTER_S2);
}
void StateToSelf::FppTest_SmState_StateToSelf_action_enterS3(SmId smId, FppTest_SmState_StateToSelf::Signal signal) {
void StateToSelfTester::FppTest_SmState_StateToSelf_action_enterS3(SmId smId,
FppTest_SmState_StateToSelf::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToSelf);
this->m_smStateStateToSelf_actionHistory.push(signal, ActionId::ENTER_S3);
}
@ -64,7 +70,7 @@ void StateToSelf::FppTest_SmState_StateToSelf_action_enterS3(SmId smId, FppTest_
// Tests
// ----------------------------------------------------------------------
void StateToSelf::testInit() {
void StateToSelfTester::testInit() {
this->m_smStateStateToSelf_actionHistory.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStateStateToSelf_getState(), SmState_StateToSelf::State::S1_S2);
@ -79,7 +85,7 @@ void StateToSelf::testInit() {
ASSERT_EQ(actions.getItemAt(1), ActionId::ENTER_S2);
}
void StateToSelf::testS2_to_S1() {
void StateToSelfTester::testS2_to_S1() {
this->m_smStateStateToSelf_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToSelf_actionHistory.clear();
@ -101,7 +107,7 @@ void StateToSelf::testS2_to_S1() {
ASSERT_EQ(actions.getItemAt(4), ActionId::ENTER_S2);
}
void StateToSelf::testS2_to_S3() {
void StateToSelfTester::testS2_to_S3() {
this->m_smStateStateToSelf_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToSelf_actionHistory.clear();
@ -120,7 +126,7 @@ void StateToSelf::testS2_to_S3() {
ASSERT_EQ(actions.getItemAt(1), ActionId::ENTER_S3);
}
void StateToSelf::testS3_to_S1() {
void StateToSelfTester::testS3_to_S1() {
this->m_smStateStateToSelf_actionHistory.clear();
this->init(queueDepth, instanceId);
{

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title StateToSelf.hpp
// \title StateToSelfTester.hpp
// \author bocchino
// \brief hpp file for StateToSelf component implementation class
// \brief hpp file for StateToSelfTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_StateToSelf_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class StateToSelf : public StateToSelfComponentBase {
class StateToSelfTester : public StateToSelfComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class StateToSelf : public StateToSelfComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct StateToSelf object
StateToSelf(const char* const compName //!< The component name
//! Construct StateToSelfTester object
StateToSelfTester(const char* const compName //!< The component name
);
//! Destroy StateToSelf object
~StateToSelf();
//! Destroy StateToSelfTester object
~StateToSelfTester();
private:
// ----------------------------------------------------------------------
@ -52,9 +52,9 @@ class StateToSelf : public StateToSelfComponentBase {
enum class ActionId { EXIT_S1, EXIT_S2, EXIT_S3, A, ENTER_S1, ENTER_S2, ENTER_S3 };
private:
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
//! Implementation for action exitS1 of state machine FppTest_SmState_StateToSelf
//!
//! Exit S1

View File

@ -1,12 +1,12 @@
// ======================================================================
// \title StateToState.cpp
// \title StateToStateTester.cpp
// \author bocchino
// \brief cpp file for StateToState component implementation class
// \brief cpp file for StateToStateTester component implementation class
// ======================================================================
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/StateToState.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToStateTester.hpp"
namespace FppTest {
@ -16,56 +16,64 @@ namespace SmInstanceState {
// Component construction and destruction
// ----------------------------------------------------------------------
StateToState::StateToState(const char* const compName)
StateToStateTester::StateToStateTester(const char* const compName)
: StateToStateComponentBase(compName), m_smStateStateToState_actionHistory() {}
StateToState::~StateToState() {}
StateToStateTester::~StateToStateTester() {}
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
void StateToState::FppTest_SmState_StateToState_action_exitS1(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_exitS1(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::EXIT_S1);
}
void StateToState::FppTest_SmState_StateToState_action_exitS2(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_exitS2(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::EXIT_S2);
}
void StateToState::FppTest_SmState_StateToState_action_exitS3(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_exitS3(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::EXIT_S3);
}
void StateToState::FppTest_SmState_StateToState_action_a(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_a(SmId smId, FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::A);
}
void StateToState::FppTest_SmState_StateToState_action_enterS1(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_enterS1(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::ENTER_S1);
}
void StateToState::FppTest_SmState_StateToState_action_enterS2(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_enterS2(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::ENTER_S2);
}
void StateToState::FppTest_SmState_StateToState_action_enterS3(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_enterS3(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::ENTER_S3);
}
void StateToState::FppTest_SmState_StateToState_action_enterS4(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_enterS4(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::ENTER_S4);
}
void StateToState::FppTest_SmState_StateToState_action_enterS5(SmId smId, FppTest_SmState_StateToState::Signal signal) {
void StateToStateTester::FppTest_SmState_StateToState_action_enterS5(SmId smId,
FppTest_SmState_StateToState::Signal signal) {
ASSERT_EQ(smId, SmId::smStateStateToState);
this->m_smStateStateToState_actionHistory.push(signal, ActionId::ENTER_S5);
}
@ -74,7 +82,7 @@ void StateToState::FppTest_SmState_StateToState_action_enterS5(SmId smId, FppTes
// Tests
// ----------------------------------------------------------------------
void StateToState::testInit() {
void StateToStateTester::testInit() {
this->m_smStateStateToState_actionHistory.clear();
this->init(queueDepth, instanceId);
ASSERT_EQ(this->smStateStateToState_getState(), SmState_StateToState::State::S1_S2);
@ -89,7 +97,7 @@ void StateToState::testInit() {
ASSERT_EQ(actions.getItemAt(1), ActionId::ENTER_S2);
}
void StateToState::testS2_to_S3() {
void StateToStateTester::testS2_to_S3() {
this->m_smStateStateToState_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToState_actionHistory.clear();
@ -108,7 +116,7 @@ void StateToState::testS2_to_S3() {
ASSERT_EQ(actions.getItemAt(1), ActionId::ENTER_S3);
}
void StateToState::testS2_to_S4() {
void StateToStateTester::testS2_to_S4() {
this->m_smStateStateToState_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToState_actionHistory.clear();
@ -130,7 +138,7 @@ void StateToState::testS2_to_S4() {
ASSERT_EQ(actions.getItemAt(4), ActionId::ENTER_S5);
}
void StateToState::testS2_to_S5() {
void StateToStateTester::testS2_to_S5() {
this->m_smStateStateToState_actionHistory.clear();
this->init(queueDepth, instanceId);
this->m_smStateStateToState_actionHistory.clear();
@ -152,7 +160,7 @@ void StateToState::testS2_to_S5() {
ASSERT_EQ(actions.getItemAt(4), ActionId::ENTER_S5);
}
void StateToState::testS3_to_S4() {
void StateToStateTester::testS3_to_S4() {
this->m_smStateStateToState_actionHistory.clear();
this->init(queueDepth, instanceId);
{
@ -182,7 +190,7 @@ void StateToState::testS3_to_S4() {
ASSERT_EQ(actions.getItemAt(4), ActionId::ENTER_S5);
}
void StateToState::testS3_to_S5() {
void StateToStateTester::testS3_to_S5() {
this->m_smStateStateToState_actionHistory.clear();
this->init(queueDepth, instanceId);
{

View File

@ -1,7 +1,7 @@
// ======================================================================
// \title StateToState.hpp
// \title StateToStateTester.hpp
// \author bocchino
// \brief hpp file for StateToState component implementation class
// \brief hpp file for StateToStateTester component implementation class
// ======================================================================
#ifndef FppTest_SmInstanceState_StateToState_HPP
@ -14,7 +14,7 @@ namespace FppTest {
namespace SmInstanceState {
class StateToState : public StateToStateComponentBase {
class StateToStateTester : public StateToStateComponentBase {
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
@ -33,12 +33,12 @@ class StateToState : public StateToStateComponentBase {
// Component construction and destruction
// ----------------------------------------------------------------------
//! Construct StateToState object
StateToState(const char* const compName //!< The component name
//! Construct StateToStateTester object
StateToStateTester(const char* const compName //!< The component name
);
//! Destroy StateToState object
~StateToState();
//! Destroy StateToStateTester object
~StateToStateTester();
private:
// ----------------------------------------------------------------------
@ -52,9 +52,9 @@ class StateToState : public StateToStateComponentBase {
enum class ActionId { EXIT_S1, EXIT_S2, EXIT_S3, A, ENTER_S1, ENTER_S2, ENTER_S3, ENTER_S4, ENTER_S5 };
private:
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Implementations for internal state machine actions
// ----------------------------------------------------------------------
//! Implementation for action exitS1 of state machine FppTest_SmState_StateToState
//!
//! Exit S1

View File

@ -4,287 +4,287 @@
#include <gtest/gtest.h>
#include "FppTest/state_machine/internal_instance/state/Basic.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuard.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardString.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestAbsType.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestArray.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestEnum.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestStruct.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardU32.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicInternal.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicSelf.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicString.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestAbsType.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestArray.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestEnum.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestStruct.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicU32.hpp"
#include "FppTest/state_machine/internal_instance/state/Internal.hpp"
#include "FppTest/state_machine/internal_instance/state/Polymorphism.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToChild.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToChoice.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToSelf.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToState.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardStringTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestAbsTypeTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestArrayTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestEnumTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTestStructTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicGuardU32Tester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicInternalTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicSelfTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicStringTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestAbsTypeTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestArrayTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestEnumTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTestStructTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicTester.hpp"
#include "FppTest/state_machine/internal_instance/state/BasicU32Tester.hpp"
#include "FppTest/state_machine/internal_instance/state/InternalTester.hpp"
#include "FppTest/state_machine/internal_instance/state/PolymorphismTester.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToChildTester.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToChoiceTester.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToSelfTester.hpp"
#include "FppTest/state_machine/internal_instance/state/StateToStateTester.hpp"
#include "STest/STest/Random/Random.hpp"
TEST(Basic, Test) {
FppTest::SmInstanceState::Basic basic("basic");
FppTest::SmInstanceState::BasicTester basic("basic");
basic.test();
}
TEST(BasicGuard, False) {
FppTest::SmInstanceState::BasicGuard basicGuard("basicGuard");
FppTest::SmInstanceState::BasicGuardTester basicGuard("basicGuard");
basicGuard.testFalse();
}
TEST(BasicGuard, True) {
FppTest::SmInstanceState::BasicGuard basicGuard("basicGuard");
FppTest::SmInstanceState::BasicGuardTester basicGuard("basicGuard");
basicGuard.testTrue();
}
TEST(BasicGuardString, False) {
FppTest::SmInstanceState::BasicGuardString basicGuardString("basicGuardString");
FppTest::SmInstanceState::BasicGuardStringTester basicGuardString("basicGuardString");
basicGuardString.testFalse();
}
TEST(BasicGuardString, True) {
FppTest::SmInstanceState::BasicGuardString basicGuardString("basicGuardString");
FppTest::SmInstanceState::BasicGuardStringTester basicGuardString("basicGuardString");
basicGuardString.testTrue();
}
TEST(BasicGuardTestAbsType, False) {
FppTest::SmInstanceState::BasicGuardTestAbsType basicGuardTestAbsType("basicGuardTestAbsType");
FppTest::SmInstanceState::BasicGuardTestAbsTypeTester basicGuardTestAbsType("basicGuardTestAbsType");
basicGuardTestAbsType.testFalse();
}
TEST(BasicGuardTestAbsType, Overflow) {
FppTest::SmInstanceState::BasicGuardTestAbsType basicGuardTestAbsType("basicGuardTestAbsType");
FppTest::SmInstanceState::BasicGuardTestAbsTypeTester basicGuardTestAbsType("basicGuardTestAbsType");
basicGuardTestAbsType.testOverflow();
}
TEST(BasicGuardTestAbsType, True) {
FppTest::SmInstanceState::BasicGuardTestAbsType basicGuardTestAbsType("basicGuardTestAbsType");
FppTest::SmInstanceState::BasicGuardTestAbsTypeTester basicGuardTestAbsType("basicGuardTestAbsType");
basicGuardTestAbsType.testTrue();
}
TEST(BasicGuardTestArray, False) {
FppTest::SmInstanceState::BasicGuardTestArray basicGuardTestArray("basicGuardTestArray");
FppTest::SmInstanceState::BasicGuardTestArrayTester basicGuardTestArray("basicGuardTestArray");
basicGuardTestArray.testFalse();
}
TEST(BasicGuardTestArray, True) {
FppTest::SmInstanceState::BasicGuardTestArray basicGuardTestArray("basicGuardTestArray");
FppTest::SmInstanceState::BasicGuardTestArrayTester basicGuardTestArray("basicGuardTestArray");
basicGuardTestArray.testTrue();
}
TEST(BasicGuardTestEnum, False) {
FppTest::SmInstanceState::BasicGuardTestEnum basicGuardTestEnum("basicGuardTestEnum");
FppTest::SmInstanceState::BasicGuardTestEnumTester basicGuardTestEnum("basicGuardTestEnum");
basicGuardTestEnum.testFalse();
}
TEST(BasicGuardTestEnum, True) {
FppTest::SmInstanceState::BasicGuardTestEnum basicGuardTestEnum("basicGuardTestEnum");
FppTest::SmInstanceState::BasicGuardTestEnumTester basicGuardTestEnum("basicGuardTestEnum");
basicGuardTestEnum.testTrue();
}
TEST(BasicGuardTestStruct, False) {
FppTest::SmInstanceState::BasicGuardTestStruct basicGuardTestStruct("basicGuardTestStruct");
FppTest::SmInstanceState::BasicGuardTestStructTester basicGuardTestStruct("basicGuardTestStruct");
basicGuardTestStruct.testFalse();
}
TEST(BasicGuardTestStruct, True) {
FppTest::SmInstanceState::BasicGuardTestStruct basicGuardTestStruct("basicGuardTestStruct");
FppTest::SmInstanceState::BasicGuardTestStructTester basicGuardTestStruct("basicGuardTestStruct");
basicGuardTestStruct.testTrue();
}
TEST(BasicGuardU32, False) {
FppTest::SmInstanceState::BasicGuardU32 basicGuardU32("basicGuardU32");
FppTest::SmInstanceState::BasicGuardU32Tester basicGuardU32("basicGuardU32");
basicGuardU32.testFalse();
}
TEST(BasicGuardU32, True) {
FppTest::SmInstanceState::BasicGuardU32 basicGuardU32("basicGuardU32");
FppTest::SmInstanceState::BasicGuardU32Tester basicGuardU32("basicGuardU32");
basicGuardU32.testTrue();
}
TEST(BasicInternal, Test) {
FppTest::SmInstanceState::BasicInternal basicInternal("basicInternal");
FppTest::SmInstanceState::BasicInternalTester basicInternal("basicInternal");
basicInternal.test();
}
TEST(BasicSelf, Test) {
FppTest::SmInstanceState::BasicSelf basicSelf("basicSelf");
FppTest::SmInstanceState::BasicSelfTester basicSelf("basicSelf");
basicSelf.test();
}
TEST(BasicString, Test) {
FppTest::SmInstanceState::BasicString basicString("basicString");
FppTest::SmInstanceState::BasicStringTester basicString("basicString");
basicString.test();
}
TEST(BasicTestAbsType, Test) {
FppTest::SmInstanceState::BasicTestAbsType basicTestAbsType("basicTestAbsType");
FppTest::SmInstanceState::BasicTestAbsTypeTester basicTestAbsType("basicTestAbsType");
basicTestAbsType.test();
}
TEST(BasicTestArray, Test) {
FppTest::SmInstanceState::BasicTestArray basicTestArray("basicTestArray");
FppTest::SmInstanceState::BasicTestArrayTester basicTestArray("basicTestArray");
basicTestArray.test();
}
TEST(BasicTestEnum, Test) {
FppTest::SmInstanceState::BasicTestEnum basicTestEnum("basicTestEnum");
FppTest::SmInstanceState::BasicTestEnumTester basicTestEnum("basicTestEnum");
basicTestEnum.test();
}
TEST(BasicTestStruct, Test) {
FppTest::SmInstanceState::BasicTestStruct basicTestStruct("basicTestStruct");
FppTest::SmInstanceState::BasicTestStructTester basicTestStruct("basicTestStruct");
basicTestStruct.test();
}
TEST(BasicU32, Test) {
FppTest::SmInstanceState::BasicU32 basicU32("basicU32");
FppTest::SmInstanceState::BasicU32Tester basicU32("basicU32");
basicU32.test();
}
TEST(Internal, Init) {
FppTest::SmInstanceState::Internal internal("internal");
FppTest::SmInstanceState::InternalTester internal("internal");
internal.testInit();
}
TEST(Internal, S2_internal) {
FppTest::SmInstanceState::Internal internal("internal");
FppTest::SmInstanceState::InternalTester internal("internal");
internal.testS2_internal();
}
TEST(Internal, S2_to_S3) {
FppTest::SmInstanceState::Internal internal("internal");
FppTest::SmInstanceState::InternalTester internal("internal");
internal.testS2_to_S3();
}
TEST(Internal, S3_internal) {
FppTest::SmInstanceState::Internal internal("internal");
FppTest::SmInstanceState::InternalTester internal("internal");
internal.testS3_internal();
}
TEST(Polymorphism, Init) {
FppTest::SmInstanceState::Polymorphism polymorphism("polymorphism");
FppTest::SmInstanceState::PolymorphismTester polymorphism("polymorphism");
polymorphism.testInit();
}
TEST(Polymorphism, S2_poly) {
FppTest::SmInstanceState::Polymorphism polymorphism("polymorphism");
FppTest::SmInstanceState::PolymorphismTester polymorphism("polymorphism");
polymorphism.testS2_poly();
}
TEST(Polymorphism, S2_to_S3) {
FppTest::SmInstanceState::Polymorphism polymorphism("polymorphism");
FppTest::SmInstanceState::PolymorphismTester polymorphism("polymorphism");
polymorphism.testS2_to_S3();
}
TEST(Polymorphism, S3_poly) {
FppTest::SmInstanceState::Polymorphism polymorphism("polymorphism");
FppTest::SmInstanceState::PolymorphismTester polymorphism("polymorphism");
polymorphism.testS3_poly();
}
TEST(StateToChild, Init) {
FppTest::SmInstanceState::StateToChild stateToChild("stateToChild");
FppTest::SmInstanceState::StateToChildTester stateToChild("stateToChild");
stateToChild.testInit();
}
TEST(StateToChild, S2_to_S2) {
FppTest::SmInstanceState::StateToChild stateToChild("stateToChild");
FppTest::SmInstanceState::StateToChildTester stateToChild("stateToChild");
stateToChild.testS2_to_S2();
}
TEST(StateToChild, S2_to_S3) {
FppTest::SmInstanceState::StateToChild stateToChild("stateToChild");
FppTest::SmInstanceState::StateToChildTester stateToChild("stateToChild");
stateToChild.testS2_to_S3();
}
TEST(StateToChild, S3_to_S2) {
FppTest::SmInstanceState::StateToChild stateToChild("stateToChild");
FppTest::SmInstanceState::StateToChildTester stateToChild("stateToChild");
stateToChild.testS3_to_S2();
}
TEST(StateToChoice, Init) {
FppTest::SmInstanceState::StateToChoice stateToChoice("stateToChoice");
FppTest::SmInstanceState::StateToChoiceTester stateToChoice("stateToChoice");
stateToChoice.testInit();
}
TEST(StateToChoice, S2_to_C) {
FppTest::SmInstanceState::StateToChoice stateToChoice("stateToChoice");
FppTest::SmInstanceState::StateToChoiceTester stateToChoice("stateToChoice");
stateToChoice.testS2_to_C();
}
TEST(StateToChoice, S2_to_S4) {
FppTest::SmInstanceState::StateToChoice stateToChoice("stateToChoice");
FppTest::SmInstanceState::StateToChoiceTester stateToChoice("stateToChoice");
stateToChoice.testS2_to_S4();
}
TEST(StateToChoice, S2_to_S3) {
FppTest::SmInstanceState::StateToChoice stateToChoice("stateToChoice");
FppTest::SmInstanceState::StateToChoiceTester stateToChoice("stateToChoice");
stateToChoice.testS2_to_S3();
}
TEST(StateToChoice, S3_to_C) {
FppTest::SmInstanceState::StateToChoice stateToChoice("stateToChoice");
FppTest::SmInstanceState::StateToChoiceTester stateToChoice("stateToChoice");
stateToChoice.testS3_to_C();
}
TEST(StateToChoice, S3_to_S4) {
FppTest::SmInstanceState::StateToChoice stateToChoice("stateToChoice");
FppTest::SmInstanceState::StateToChoiceTester stateToChoice("stateToChoice");
stateToChoice.testS3_to_S4();
}
TEST(StateToSelf, Init) {
FppTest::SmInstanceState::StateToSelf stateToSelf("stateToSelf");
FppTest::SmInstanceState::StateToSelfTester stateToSelf("stateToSelf");
stateToSelf.testInit();
}
TEST(StateToSelf, S2_to_S1) {
FppTest::SmInstanceState::StateToSelf stateToSelf("stateToSelf");
FppTest::SmInstanceState::StateToSelfTester stateToSelf("stateToSelf");
stateToSelf.testS2_to_S1();
}
TEST(StateToSelf, S2_to_S3) {
FppTest::SmInstanceState::StateToSelf stateToSelf("stateToSelf");
FppTest::SmInstanceState::StateToSelfTester stateToSelf("stateToSelf");
stateToSelf.testS2_to_S3();
}
TEST(StateToSelf, S3_to_S1) {
FppTest::SmInstanceState::StateToSelf stateToSelf("stateToSelf");
FppTest::SmInstanceState::StateToSelfTester stateToSelf("stateToSelf");
stateToSelf.testS3_to_S1();
}
TEST(StateToState, Init) {
FppTest::SmInstanceState::StateToState stateToState("stateToState");
FppTest::SmInstanceState::StateToStateTester stateToState("stateToState");
stateToState.testInit();
}
TEST(StateToState, S2_to_S3) {
FppTest::SmInstanceState::StateToState stateToState("stateToState");
FppTest::SmInstanceState::StateToStateTester stateToState("stateToState");
stateToState.testS2_to_S3();
}
TEST(StateToState, S2_to_S4) {
FppTest::SmInstanceState::StateToState stateToState("stateToState");
FppTest::SmInstanceState::StateToStateTester stateToState("stateToState");
stateToState.testS2_to_S4();
}
TEST(StateToState, S2_to_S5) {
FppTest::SmInstanceState::StateToState stateToState("stateToState");
FppTest::SmInstanceState::StateToStateTester stateToState("stateToState");
stateToState.testS2_to_S5();
}
TEST(StateToState, S3_to_S4) {
FppTest::SmInstanceState::StateToState stateToState("stateToState");
FppTest::SmInstanceState::StateToStateTester stateToState("stateToState");
stateToState.testS3_to_S4();
}
TEST(StateToState, S3_to_S5) {
FppTest::SmInstanceState::StateToState stateToState("stateToState");
FppTest::SmInstanceState::StateToStateTester stateToState("stateToState");
stateToState.testS3_to_S5();
}