|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Test fixture for ProfinetScanner. More...
Inheritance diagram for profinet::device::ProfinetScannerTest:
Collaboration diagram for profinet::device::ProfinetScannerTest:Classes | |
| struct | TestScanDevice |
| Test description used to construct a synthetic DCP discovery response. More... | |
Protected Member Functions | |
| void | SetUp () override |
| Creates the scanner with a mock DCP scanner. | |
| void | ConfigureScanResults (const dcp::ResponseMap &responses, double timeoutSec) |
| Configure the mock DCP scanner to return the supplied responses. | |
| dcp::ResponseMap | CreateScanResponses (std::initializer_list< TestScanDevice > devices) |
| Create synthetic DCP discovery responses for scanner tests. | |
Static Protected Member Functions | |
| static double | GetDeviceTimeout (const ProfinetDevice &device) |
Protected Attributes | |
| MockDcpScanner * | mockDcpScanner = nullptr |
| std::unique_ptr< MockDcpScanner > | scanner |
| MockMacAddressProvider * | mockMacAddressProvider = nullptr |
| std::unique_ptr< MockMacAddressProvider > | macAddressProvider |
Static Protected Attributes | |
| static constexpr MacAddress | kMacA {0x02, 0x00, 0x00, 0x00, 0x00, 0x0A} |
Test fixture for ProfinetScanner.
Definition at line 253 of file test_device.cpp.
|
inlineprotected |
Configure the mock DCP scanner to return the supplied responses.
| responses | DCP discovery responses to return. |
| timeoutSec | Expected discovery timeout. |
Definition at line 269 of file test_device.cpp.
References mockDcpScanner, and profinet::device::Scan().
Here is the call graph for this function:
|
inlineprotected |
Create synthetic DCP discovery responses for scanner tests.
The generated response contains the DCP blocks required by DCPDeviceDescription to populate the device MAC address, station name, and IP address. This helper does not perform network communication.
| devices | Device descriptions to include in the response. |
Definition at line 296 of file test_device.cpp.
References profinet::Device, profinet::Ip, profinet::Ip2String(), profinet::IpParameter, profinet::dcp::MakeBlockKey(), profinet::Name, and profinet::String2Mac().
Here is the call graph for this function:
|
inlinestaticprotected |
Definition at line 315 of file test_device.cpp.
References profinet::device::ProfinetDevice::timeout.
|
inlineoverrideprotected |
Creates the scanner with a mock DCP scanner.
Definition at line 257 of file test_device.cpp.
References macAddressProvider, mockDcpScanner, mockMacAddressProvider, and scanner.
|
staticconstexprprotected |
Definition at line 325 of file test_device.cpp.
|
protected |
Definition at line 324 of file test_device.cpp.
Referenced by SetUp().
|
protected |
Definition at line 320 of file test_device.cpp.
Referenced by ConfigureScanResults(), and SetUp().
|
protected |
Definition at line 323 of file test_device.cpp.
Referenced by SetUp().
|
protected |
Definition at line 321 of file test_device.cpp.
Referenced by SetUp().