PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
test_cyclicMore.cpp File Reference

Additional unit tests for the PROFINET RTC1 cyclic IO controller. More...

#include <gtest/gtest.h>
#include <array>
#include <cstdint>
#include <future>
#include <memory>
#include <optional>
#include <stdexcept>
#include <string>
#include <utility>
#include "mocks/cyclic_raw_ethernet_socket_stub.h"
#include "mocks/mockRawEthernetSocket.h"
#include "profinet/cyclic.h"
#include "profinet/rt.h"
+ Include dependency graph for test_cyclicMore.cpp:

Go to the source code of this file.

Classes

class  profinet::cyclic::CyclicControllerTestAccess
 Narrow private-access adapter used only by cyclic controller tests. More...
 
class  profinet::cyclic::CyclicStateTests
 Fixture for state-transition and lifecycle behavior. More...
 
class  profinet::cyclic::CyclicStatsTests
 Fixture for statistics and snapshots. More...
 
class  profinet::cyclic::CyclicDataTests
 Fixture for input data and status access. More...
 
class  profinet::cyclic::CyclicCallbackTests
 Fixture for input callbacks. More...
 
class  profinet::cyclic::CyclicFrameTests
 Fixture for input Ethernet parsing and cycle-counter tracking. More...
 
class  profinet::cyclic::CyclicWatchdogTests
 Fixture for watchdog and RX-loop behavior. More...
 
class  profinet::cyclic::CyclicTxTests
 Fixture for TX behavior and generated frame validation. More...
 

Namespaces

namespace  profinet
 
namespace  profinet::cyclic
 

Functions

 profinet::cyclic::TEST_F (CyclicStateTests, StopDoesNotDestroyRxSocketBeforeRxThreadExits)
 
 profinet::cyclic::TEST_F (CyclicStateTests, StopIsIdempotent)
 
 profinet::cyclic::TEST_F (CyclicStateTests, CanStartAgainAfterStop)
 
 profinet::cyclic::TEST_F (CyclicStateTests, ToStringReturnsUnknownForInvalidValue)
 
 profinet::cyclic::TEST_F (CyclicStateTests, TransitionCallsCallbackForStateChange)
 
 profinet::cyclic::TEST_F (CyclicStateTests, TransitionSkipsCallbackForSameState)
 
 profinet::cyclic::TEST_F (CyclicStateTests, TransitionSwallowsCallbackException)
 
 profinet::cyclic::TEST_F (CyclicStateTests, StartRejectsInvalidStartingStates)
 
 profinet::cyclic::TEST_F (CyclicStateTests, StartAcceptsFaultState)
 
 profinet::cyclic::TEST_F (CyclicStateTests, StartAcceptsStoppedState)
 
 profinet::cyclic::TEST_F (CyclicStateTests, StopDoesNothingWhenNotRunning)
 
 profinet::cyclic::TEST_F (CyclicStateTests, StartAndStopCompleteNormalLifecycle)
 
 profinet::cyclic::TEST_F (CyclicStateTests, FailedStartLeavesStoppedState)
 
 profinet::cyclic::TEST_F (CyclicStateTests, FailedStartCanBeRetried)
 
 profinet::cyclic::TEST_F (CyclicStatsTests, AverageCycleTimeReturnsIntegerAverage)
 
 profinet::cyclic::TEST_F (CyclicStatsTests, AverageCycleTimeReturnsZeroWhenNoCycles)
 
 profinet::cyclic::TEST_F (CyclicStatsTests, SnapshotAverageCycleTimeReturnsZeroWhenNoCycles)
 
 profinet::cyclic::TEST_F (CyclicStatsTests, StatsSnapshotCopiesAllFields)
 
 profinet::cyclic::TEST_F (CyclicStatsTests, ResetRestoresInitialValues)
 
 profinet::cyclic::TEST_F (CyclicDataTests, GetInputDataReturnsNulloptForUnknownObject)
 
 profinet::cyclic::TEST_F (CyclicDataTests, GetInputDataReturnsGoodInput)
 
 profinet::cyclic::TEST_F (CyclicDataTests, GetInputDataRejectsBadInputByDefault)
 
 profinet::cyclic::TEST_F (CyclicDataTests, GetInputStatusReturnsNulloptForUnknownObject)
 
 profinet::cyclic::TEST_F (CyclicDataTests, GetInputStatusReturnsReceivedIops)
 
 profinet::cyclic::TEST_F (CyclicDataTests, IsInputGoodReturnsFalseForUnknownObject)
 
 profinet::cyclic::TEST_F (CyclicDataTests, IsInputGoodReturnsTrueForGoodInput)
 
 profinet::cyclic::TEST_F (CyclicDataTests, IsInputGoodReturnsFalseForBadInput)
 
 profinet::cyclic::TEST_F (CyclicDataTests, SetOutputDataAcceptsIdleState)
 
 profinet::cyclic::TEST_F (CyclicDataTests, SetOutputDataRejectsStoppedState)
 
 profinet::cyclic::TEST_F (CyclicDataTests, SetOutputDataRejectsFaultState)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputStatusCallbackRunsOnGoodTransition)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputStatusCallbackSkipsUnchangedStatus)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputStatusCallbackRunsOnBadTransition)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputStatusCallbackSwallowsException)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputDataCallbackRunsForGoodInput)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputDataCallbackSkipsBadInput)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputDataCallbackSkipsEmptyData)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, InputDataCallbackSwallowsException)
 
 profinet::cyclic::TEST_F (CyclicCallbackTests, TimeoutAndErrorCallbacksCanBeRegistered)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, RejectsTooShortEthernetFrame)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, RejectsUnexpectedEtherType)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, RejectsUnexpectedSourceMac)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, RejectsMalformedRtFrame)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, RejectsUnexpectedFrameId)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, AcceptsVlanTaggedInputFrame)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, RejectsInvalidDataStatus)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, RejectsNonZeroTransferStatus)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, DISABLED_ValidInputRestoresIocsGoodState)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, SkipsObjectWithInvalidIopsOffset)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, SkipsObjectWithInvalidDataRange)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, TrackCycleCounterInitializesOnFirstFrame)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, TrackCycleCounterCountsDuplicate)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, TrackCycleCounterAcceptsExpectedStep)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, TrackCycleCounterCountsForwardGap)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, TrackCycleCounterCountsOutOfOrder)
 
 profinet::cyclic::TEST_F (CyclicFrameTests, TrackCycleCounterHandlesZeroStep)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, WatchdogTimeoutUpdatesStatistics)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, MonitoringOnlyWatchdogKeepsIocsGood)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, WatchdogFaultsAtConfiguredThreshold)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, WatchdogDoesNotTransitionWhenAlreadyFaulted)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, TimeoutCallbackSwallowsException)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, WatchdogDoesNotRepeatBadTransition)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, RxLoopProcessesValidFrame)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, RxLoopStopsWithoutSocket)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, RxLoopReportsSocketException)
 
 profinet::cyclic::TEST_F (CyclicWatchdogTests, RxLoopHandlesWatchdogTimeout)
 
 profinet::cyclic::TEST_F (CyclicTxTests, TxLoopRecordsCycleTiming)
 
 profinet::cyclic::TEST_F (CyclicTxTests, TxCycleSendsFrameAndUpdatesStatistics)
 
 profinet::cyclic::TEST_F (CyclicTxTests, TxCycleSendsInFault)
 
 profinet::cyclic::TEST_F (CyclicTxTests, SendOutputFrameWithoutSocketDoesNotThrow)
 
 profinet::cyclic::TEST_F (CyclicTxTests, SendOutputFrameReportsSocketError)
 
 profinet::cyclic::TEST_F (CyclicTxTests, SendOutputFrameUsesDataStatusOverride)
 
 profinet::cyclic::TEST_F (CyclicTxTests, SendStopFramesGeneratesStopFrameCount)
 
 profinet::cyclic::TEST_F (CyclicTxTests, SendStopFramesWithoutSocketDoesNothing)
 
 profinet::cyclic::TEST_F (CyclicTxTests, SendStopFramesStopsAfterSendErrorCallbackThrows)
 
 profinet::cyclic::TEST_F (CyclicTxTests, SetOutputDataIsReflectedInTransmittedFrame)
 
 profinet::cyclic::TEST_F (CyclicStateTests, CallbackCanBeReplacedWhileRunning)
 
 profinet::cyclic::TEST_F (CyclicStateTests, ClearedCallbackIsNotInvoked)
 
 profinet::cyclic::TEST_F (CyclicStateTests, CallbackMayRequestStopWithoutDeadlock)
 

Detailed Description

Additional unit tests for the PROFINET RTC1 cyclic IO controller.

Provides deterministic coverage for lifecycle transitions, data/status access, callbacks, TX/RX paths, watchdog handling, cycle-counter tracking, malformed Ethernet/RT frames and cyclic stop-frame generation.

Tests use socket mocks and deterministic socket stubs so they do not depend on a real network interface or platform-specific packet transport.

Definition in file test_cyclicMore.cpp.