PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::AlarmListenerRtaIntegrationTest Class Reference

Test fixture for multi-frame RTA alarm exchanges. More...

+ Inheritance diagram for profinet::AlarmListenerRtaIntegrationTest:
+ Collaboration diagram for profinet::AlarmListenerRtaIntegrationTest:

Protected Member Functions

void SetUp () override
 Construct the listener with a mocked Layer 2 transport.
 
void Feed (Bytes frame)
 Inject one Ethernet frame into the listener.
 

Protected Attributes

std::unique_ptr< testing::StrictMock< MockRawEthernetSocket > > socket
 Mock Ethernet transport pointer owned by the listener.
 
StrictMock< MockRawEthernetSocket > * mockSocket = nullptr
 Mock Ethernet transport owned by the listener.
 
std::unique_ptr< AlarmListener > listener
 Listener under test.
 
std::unique_ptr< asio::io_context > ioContext
 Shared ASIO context.
 

Detailed Description

Test fixture for multi-frame RTA alarm exchanges.

Uses the same injected Ethernet transport as AlarmListenerRtaTest but keeps the fixture separate because the tests represent stateful multi-frame exchanges rather than single-frame parsing.

Definition at line 323 of file test_alarmListenerRta.cpp.

Member Function Documentation

◆ Feed()

void profinet::AlarmListenerRtaIntegrationTest::Feed ( Bytes  frame)
inlineprotected

Inject one Ethernet frame into the listener.

Parameters
frameComplete Ethernet frame.

Definition at line 348 of file test_alarmListenerRta.cpp.

References frame, profinet::AlarmListenerTestAccess::HandleLayer2Frame(), listener, and mockSocket.

+ Here is the call graph for this function:

◆ SetUp()

void profinet::AlarmListenerRtaIntegrationTest::SetUp ( )
inlineoverrideprotected

Construct the listener with a mocked Layer 2 transport.

Definition at line 327 of file test_alarmListenerRta.cpp.

References profinet::AlarmEndpoint::controllerRef, profinet::AlarmEndpoint::deviceMac, profinet::AlarmEndpoint::deviceRef, profinet::AlarmEndpoint::interface, ioContext, listener, mockSocket, profinet::AlarmListenerTestAccess::SetSock(), socket, and profinet::AlarmEndpoint::transport.

+ Here is the call graph for this function:

Member Data Documentation

◆ ioContext

std::unique_ptr<asio::io_context> profinet::AlarmListenerRtaIntegrationTest::ioContext
protected

Shared ASIO context.

Definition at line 364 of file test_alarmListenerRta.cpp.

Referenced by SetUp().

◆ listener

std::unique_ptr<AlarmListener> profinet::AlarmListenerRtaIntegrationTest::listener
protected

Listener under test.

Definition at line 361 of file test_alarmListenerRta.cpp.

Referenced by Feed(), and SetUp().

◆ mockSocket

StrictMock<MockRawEthernetSocket>* profinet::AlarmListenerRtaIntegrationTest::mockSocket = nullptr
protected

Mock Ethernet transport owned by the listener.

Definition at line 358 of file test_alarmListenerRta.cpp.

Referenced by Feed(), and SetUp().

◆ socket

std::unique_ptr<testing::StrictMock<MockRawEthernetSocket> > profinet::AlarmListenerRtaIntegrationTest::socket
protected

Mock Ethernet transport pointer owned by the listener.

Definition at line 355 of file test_alarmListenerRta.cpp.

Referenced by SetUp().


The documentation for this class was generated from the following file: