|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Shared fixture for EthernetPacketBackend tests. More...
#include <ethernetPacketBackendTestFixture.h>
Inheritance diagram for profinet::EthernetPacketBackendTestFixture:
Collaboration diagram for profinet::EthernetPacketBackendTestFixture:Protected Types | |
| using | Backend = AsioEthernetSocket::EthernetPacketBackend |
| Backend implementation under test. | |
Protected Member Functions | |
| std::unique_ptr< Backend > | CreateBackend (const std::string &interface, std::uint16_t ethertype=0U) |
| Construct one backend instance for the supplied interface. | |
| bool | MatchesEtherType (const Backend &backend, const std::vector< std::uint8_t > &frame) const |
| Query the backend EtherType matcher through the test seam. | |
| void | SetUp () override |
| Start the external Asio execution context. | |
| void | TearDown () override |
| Stop the external Asio execution context. | |
Static Protected Member Functions | |
| static std::optional< std::string > | GetTestInterface () |
| Return the explicitly configured live-test interface. | |
Protected Attributes | |
| asio::io_context | ioContext |
| Asio execution context used by the backend. | |
| std::unique_ptr< AsioIoContextRunner > | runner |
| External Asio worker used by synchronous Recv() operations. | |
Shared fixture for EthernetPacketBackend tests.
The packet backend is private to AsioEthernetSocket because it is an implementation detail of the public transport. This fixture is declared as a test-only friend so the backend's own validation and VLAN matching logic can be tested without exposing the backend in the production API.
Definition at line 29 of file ethernetPacketBackendTestFixture.h.
|
protected |
Backend implementation under test.
Definition at line 33 of file ethernetPacketBackendTestFixture.h.
|
inlineprotected |
Construct one backend instance for the supplied interface.
| interface | Network interface or packet-capture device name. |
| ethertype | EtherType filter; zero accepts all frame types. |
Definition at line 40 of file ethernetPacketBackendTestFixture.h.
References ioContext.
|
inlinestaticprotected |
Return the explicitly configured live-test interface.
Definition at line 58 of file ethernetPacketBackendTestFixture.h.
|
inlineprotected |
Query the backend EtherType matcher through the test seam.
| backend | Backend under test. |
| frame | Complete or partial Ethernet frame. |
Definition at line 50 of file ethernetPacketBackendTestFixture.h.
References frame, and profinet::AsioEthernetSocket::EthernetPacketBackend::MatchesEtherType().
Here is the call graph for this function:
|
inlineoverrideprotected |
Start the external Asio execution context.
Definition at line 77 of file ethernetPacketBackendTestFixture.h.
|
inlineoverrideprotected |
Stop the external Asio execution context.
Definition at line 83 of file ethernetPacketBackendTestFixture.h.
References runner.
|
protected |
Asio execution context used by the backend.
Definition at line 71 of file ethernetPacketBackendTestFixture.h.
Referenced by CreateBackend(), and SetUp().
|
protected |
External Asio worker used by synchronous Recv() operations.
Definition at line 74 of file ethernetPacketBackendTestFixture.h.
Referenced by SetUp(), and TearDown().