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

GoogleMock implementation of IRawEthernetSocket. More...

#include <mockRawEthernetSocket.h>

+ Inheritance diagram for MockRawEthernetSocket:
+ Collaboration diagram for MockRawEthernetSocket:

Public Member Functions

 MOCK_METHOD (void, Send,(const std::vector< std::uint8_t > &frame),(override))
 Mocked raw Ethernet frame transmission operation.
 
 MOCK_METHOD (std::vector< std::uint8_t >, Recv,(),(override))
 Mock raw Ethernet frame reception.
 
 MOCK_METHOD (void, SetTimeout,(std::chrono::milliseconds timeout),(override))
 Mock receive-timeout configuration.
 
- Public Member Functions inherited from profinet::IRawEthernetSocket
virtual ~IRawEthernetSocket ()=default
 Virtual destructor for polymorphic use.
 
virtual void Send (const std::vector< std::uint8_t > &frame)=0
 Send one complete raw Ethernet frame.
 
virtual std::vector< std::uint8_t > Recv ()=0
 Receive one raw Ethernet frame.
 
virtual void SetTimeout (std::chrono::milliseconds timeout)=0
 Set the receive timeout.
 

Detailed Description

GoogleMock implementation of IRawEthernetSocket.

Used by unit tests in place of the production raw Ethernet socket. No network interface or elevated socket privileges are required.

Example:

StrictMock<MockRawEthernetSocket> socket;
EXPECT_CALL(socket, Send(::testing::_))
.Times(1);
virtual void Send(const std::vector< std::uint8_t > &frame)=0
Send one complete raw Ethernet frame.

Definition at line 40 of file mockRawEthernetSocket.h.

Member Function Documentation

◆ MOCK_METHOD() [1/3]

MockRawEthernetSocket::MOCK_METHOD ( std::vector< std::uint8_t >  ,
Recv  ,
()  ,
(override)   
)

Mock raw Ethernet frame reception.

◆ MOCK_METHOD() [2/3]

MockRawEthernetSocket::MOCK_METHOD ( void  ,
Send  ,
(const std::vector< std::uint8_t > &frame)  ,
(override)   
)

Mocked raw Ethernet frame transmission operation.

◆ MOCK_METHOD() [3/3]

MockRawEthernetSocket::MOCK_METHOD ( void  ,
SetTimeout  ,
(std::chrono::milliseconds timeout)  ,
(override)   
)

Mock receive-timeout configuration.


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