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

Unit tests for PROFINET DCP name decoding, qualifiers, response codes, and DHCP block parsing. More...

#include <gtest/gtest.h>
#include <algorithm>
#include "mocks/mockRawEthernetSocket.h"
#include "profinet/dcp.h"
#include "profinet/exceptions.h"
+ Include dependency graph for test_dcp.cpp:

Go to the source code of this file.

Namespaces

namespace  profinet
 
namespace  profinet::dcp
 

Functions

 profinet::dcp::TEST (DcpTest, DecodeDeviceRoleUnknown)
 
 profinet::dcp::TEST (DcpTest, DecodeDeviceRoleIoDevice)
 
 profinet::dcp::TEST (DcpTest, DecodeDeviceRoleIoController)
 
 profinet::dcp::TEST (DcpTest, DecodeDeviceRoleIoMultidevice)
 
 profinet::dcp::TEST (DcpTest, DecodeDeviceRolePnSupervisor)
 
 profinet::dcp::TEST (DcpTest, DecodeDeviceRoleAllRoles)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameKnownOptionAndSuboption)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameKnownDeviceAndDhcpSuboptions)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameKnownControlAndDeviceInitiativeSuboptions)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameKnownOptionUnknownSuboption)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameKnownOptionWithoutSuboptionTable)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameVendorOption)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameUnknownOption)
 
 profinet::dcp::TEST (DcpTest, IpBlockInfoGetNameDefinedValues)
 
 profinet::dcp::TEST (DcpTest, IpBlockInfoGetNameUnknown)
 
 profinet::dcp::TEST (DcpTest, IpBlockInfoHasConflict)
 
 profinet::dcp::TEST (DcpTest, IpBlockInfoIsDhcp)
 
 profinet::dcp::TEST (DcpTest, BlockQualifierGetNameTemporary)
 
 profinet::dcp::TEST (DcpTest, BlockQualifierGetNamePermanent)
 
 profinet::dcp::TEST (DcpTest, BlockQualifierGetNameUnknown)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierApplicationData)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierCommunicationParameter)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierEngineeringParameter)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierAllStoredData)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierEngineeringParameterSecondRange)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierFactory)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierRestoreData)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierUnknown)
 
 profinet::dcp::TEST (DcpTest, DeviceInitiativeNoHello)
 
 profinet::dcp::TEST (DcpTest, DeviceInitiativeIssueHello)
 
 profinet::dcp::TEST (DcpTest, DeviceInitiativeUnknown)
 
 profinet::dcp::TEST (DcpTest, DcpResponseCodeGetNameDefinedValues)
 
 profinet::dcp::TEST (DcpTest, DcpResponseCodeGetNameUnknown)
 
 profinet::dcp::TEST (DcpTest, GetDcpBlockErrorNameDefinedValues)
 
 profinet::dcp::TEST (DcpTest, GetDcpBlockErrorNameUnknown)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseHostname)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseClientId)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseVendorSpecific)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseFqdn)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseUuid)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseUuidTooShort)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseUuidMinimumLength)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseUnknownSuboption)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseUnknownSuboptionEmptyPayload)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockKnownSuboptionNames)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsTooShortFrame)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsMalformedEthernetHeader)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsShortVlanFrame)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseAcceptsVlanFrame)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsUnexpectedVlanInnerEtherType)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsUnexpectedEtherType)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsMalformedDcpHeader)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsUnsupportedService)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseRejectsUnexpectedService)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseWithoutResponseBlockReturnsSuccess)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseExtractsThreeByteBlockError)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseExtractsShortBlockError)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseEmptyResponseBlockReturnsSuccess)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseSkipsNonResponseBlocks)
 
 profinet::dcp::TEST (DcpTest, ParseSetResponseUsesFirstResponseBlock)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseReturnsSuccessfulResponse)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresEmptyFrame)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresShortFrame)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresMalformedEthernetFrame)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresWrongDestinationMac)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresShortVlanPayload)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresWrongVlanInnerEtherType)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresWrongEtherType)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseAcceptsVlanResponse)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseIgnoresUnexpectedServiceType)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponsePropagatesDcpError)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseReturnsBlockError)
 
 profinet::dcp::TEST (DcpTest, RecvSetResponseTimesOut)
 
 profinet::dcp::TEST (DcpTest, DeviceRoleNameDefinedValues)
 
 profinet::dcp::TEST (DcpTest, DeviceRoleNameUnknown)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameUnknownSuboptionForAllTypedOptionGroups)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameOptionsWithoutSuboptions)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameUint16OptionOverload)
 
 profinet::dcp::TEST (DcpTest, GetBlockNameDeviceInitiativeSuboption)
 
 profinet::dcp::TEST (DcpTest, MakeBlockKeyRawOption)
 
 profinet::dcp::TEST (DcpTest, MakeBlockKeyGenericSuboption)
 
 profinet::dcp::TEST (DcpTest, MakeBlockKeyIpSuboption)
 
 profinet::dcp::TEST (DcpTest, MakeBlockKeyDeviceSuboption)
 
 profinet::dcp::TEST (DcpTest, MakeBlockKeyControlSuboption)
 
 profinet::dcp::TEST (DcpTest, MakeBlockKeyDhcpSuboption)
 
 profinet::dcp::TEST (DcpTest, MakeBlockKeyDeviceInitiativeSuboption)
 
 profinet::dcp::TEST (DcpTest, DeviceRoleBitwiseOr)
 
 profinet::dcp::TEST (DcpTest, DeviceRoleBitwiseAndPresent)
 
 profinet::dcp::TEST (DcpTest, DeviceRoleBitwiseAndAbsent)
 
 profinet::dcp::TEST (DcpTest, ResetModeBitwiseOr)
 
 profinet::dcp::TEST (DcpTest, ResetModeBitwiseAndPresent)
 
 profinet::dcp::TEST (DcpTest, ResetModeBitwiseAndAbsent)
 
 profinet::dcp::TEST (DcpTest, IpBlockInfoBitHelpersHandleUnknownCombinations)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierUnknownEnumValue)
 
 profinet::dcp::TEST (DcpTest, ResetQualifierZeroIsUnknown)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseUnknownEnumValue)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseEmptyHostname)
 
 profinet::dcp::TEST (DcpTest, DcpDhcpBlockParseEmptyFqdn)
 
 profinet::dcp::TEST (DCPDeviceDescriptionTest, ToStringIncludesAllPopulatedFields)
 
 profinet::dcp::TEST (DCPDeviceDescriptionTest, ToStringOmitsUnsetOptionalFields)
 
 profinet::dcp::TEST (DCPDeviceDescriptionTest, ToStringFormatsDhcpBlockVariants)
 
 profinet::dcp::TEST (DCPDeviceDescriptionTest, ConstructorDecodesAllSupportedBlocks)
 
 profinet::dcp::TEST (DCPDeviceDescriptionTest, ConstructorIgnoresIncompleteOptionalBlocks)
 
 profinet::dcp::TEST (DCPDeviceDescriptionTest, ConstructorHandlesLegacyTwelveByteIpBlock)
 
 profinet::dcp::TEST (DCPDeviceDescriptionTest, ConstructorUsesLegacyIpLayoutForThirteenByteBlock)
 
 profinet::dcp::TEST (DcpTest, BuildSetParamRequestBuildsTemporaryOddLengthName)
 
 profinet::dcp::TEST (DcpTest, BuildSetParamRequestBuildsPermanentEvenLengthName)
 
 profinet::dcp::TEST (DcpTest, BuildSetParamRequestRejectsIpParameter)
 
 profinet::dcp::TEST (DcpTest, BuildSetParamRequestRejectsUnknownParameter)
 
 profinet::dcp::TEST (DcpTest, BuildSetParamRequestRejectsOverlongStationName)
 
 profinet::dcp::TEST (DcpTest, BuildSetParamRequestAcceptsMaximumStationName)
 
 profinet::dcp::TEST (DcpTest, BuildDcpSignalRequestBuildsCorrectWireFormat)
 
 profinet::dcp::TEST (DcpTest, ParamsContainsSupportedParameters)
 
 profinet::dcp::TEST (DcpTest, GetParamThrowsForUnknownParameter)
 
 profinet::dcp::TEST (DcpTest, GetParamReturnsMatchingParameter)
 
 profinet::dcp::TEST (DcpTest, GetParamReturnsNulloptWhenParameterIsMissing)
 
 profinet::dcp::TEST (DcpTest, GetParamReturnsNulloptOnTimeout)
 
 profinet::dcp::TEST (DcpTest, SetParamReturnsTrueForSuccessfulResponse)
 
 profinet::dcp::TEST (DcpTest, SetParamThrowsForDeviceBlockError)
 
 profinet::dcp::TEST (DcpTest, SetParamReturnsFalseOnTimeout)
 
 profinet::dcp::TEST (DcpTest, SetParamBuildsTemporaryRequest)
 
 profinet::dcp::TEST (DcpTest, SetIpReturnsFalseOnTimeout)
 
 profinet::dcp::TEST (DcpTest, SetIpRejectsInvalidIpAddress)
 
 profinet::dcp::TEST (DcpTest, SetIpEncodesPermanentQualifier)
 
 profinet::dcp::TEST (DcpTest, SetIpEncodesTemporaryQualifier)
 
 profinet::dcp::TEST (DcpTest, SendRequestBuildsIdentifyRequest)
 
 profinet::dcp::TEST (DcpTest, SetIpBuildsPermanentIpBlock)
 
 profinet::dcp::TEST (DcpTest, ReadResponseSetsExpectedSocketTimeout)
 
 profinet::dcp::TEST (DcpTest, ReadResponseReturnsValidResponse)
 
 profinet::dcp::TEST (DcpTest, ReadResponseAcceptsAnyXidWhenExpectedXidIsNotSpecified)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresUnexpectedXid)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresEmptyData)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresShortEthernetFrame)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresMalformedEthernetFrame)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresWrongDestination)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresShortVlanPayload)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresWrongVlanInnerEtherType)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresWrongEtherType)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresMalformedDcpHeader)
 
 profinet::dcp::TEST (DcpTest, ReadResponseIgnoresUnsuccessfulServiceType)
 
 profinet::dcp::TEST (DcpTest, ReadResponseParsesValidVlanResponse)
 
 profinet::dcp::TEST (DcpTest, ReadResponseUsesEmptyBlockRegionForShortDcpLength)
 
 profinet::dcp::TEST (DcpTest, ReadResponseLimitsBlockRegionToDcpLength)
 
 profinet::dcp::TEST (DcpTest, ReadResponseProcessesMultipleResponsesWhenOnceIsFalse)
 
 profinet::dcp::TEST (DcpTest, ReadResponseStopsAfterFirstValidResponseWhenOnceIsTrue)
 
 profinet::dcp::TEST (DcpTest, ReadResponseContinuesAfterIgnoredFrames)
 
 profinet::dcp::TEST (DcpTest, ReadResponseReturnsEmptyMapOnTimeout)
 
 profinet::dcp::TEST (DcpTest, SendHelloBuildsCompleteHelloFrame)
 
 profinet::dcp::TEST (DcpTest, SendHelloAddsPaddingForOddLengthStationName)
 
 profinet::dcp::TEST (DcpTest, SendHelloEncodesCombinedDeviceRole)
 
 profinet::dcp::TEST (DcpTest, SendHelloEncodesDeviceId)
 
 profinet::dcp::TEST (DcpTest, SendHelloRejectsInvalidIpAddress)
 
 profinet::dcp::TEST (DcpTest, SendHelloRejectsInvalidNetmask)
 
 profinet::dcp::TEST (DcpTest, SendHelloRejectsInvalidGateway)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloSetsExpectedSocketTimeout)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloReturnsValidDevice)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloInvokesCallbackForValidDevice)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloDoesNotInvokeEmptyCallback)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloParsesValidVlanHello)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresEmptyData)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresShortEthernetFrame)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresMalformedEthernetFrame)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresShortVlanPayload)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresWrongVlanInnerEtherType)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresWrongEtherType)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresShortPnioPayload)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresMalformedDcpHeader)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresNonHelloServiceId)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloIgnoresNonRequestServiceType)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloContinuesAfterIgnoredFrame)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloReturnsMultipleDevices)
 
 profinet::dcp::TEST (DcpTest, ReceiveHelloReturnsEmptyOnTimeout)
 
 profinet::dcp::TEST (DcpTest, SignalDeviceReturnsTrueForSuccessfulResponse)
 
 profinet::dcp::TEST (DcpTest, SignalDeviceThrowsForBlockError)
 
 profinet::dcp::TEST (DcpTest, SignalDeviceReturnsFalseOnTimeout)
 
 profinet::dcp::TEST (DcpTest, SignalDeviceRejectsInvalidTargetMac)
 
 profinet::dcp::TEST (DcpTest, ResetToFactoryReturnsTrueForSuccessfulResponse)
 
 profinet::dcp::TEST (DcpTest, ResetToFactoryEncodesCombinedResetMode)
 
 profinet::dcp::TEST (DcpTest, ResetToFactoryReturnsFalseOnTimeout)
 
 profinet::dcp::TEST (DcpTest, ResetToFactoryThrowsForBlockError)
 
 profinet::dcp::TEST (DcpTest, ResetToFactoryRejectsInvalidTargetMac)
 
 profinet::dcp::TEST (DcpTest, GetParamSendsCorrectGetRequest)
 

Detailed Description

Unit tests for PROFINET DCP name decoding, qualifiers, response codes, and DHCP block parsing.

Definition in file test_dcp.cpp.

Variable Documentation

◆ length

◆ option

◆ payload

Bytes payload

Definition at line 392 of file test_dcp.cpp.

Referenced by profinet::sim::VirtualAumaValve::BuildAlarmNotificationBlock(), profinet::cyclic::ReceivedIopsTest::BuildInputFrame(), profinet::rpc::RPCCon::CreateNrd(), profinet::rpc::RpcTests::CreateRpc(), profinet::cyclic::CyclicDataTests::DeliverInput(), profinet::cyclic::CyclicCallbackTests::DeliverInput(), profinet::rpc::RpcTests::InvokeCreateNrd(), profinet::rt::CyclicDataBuilder::Load(), profinet::rpc::RpcTests::MakeDcpBlock(), profinet::rpc::RpcTests::MakeDcpResponseFrame(), profinet::rpc::RpcTests::MakeIodResponsePayload(), profinet::sim::VirtualProfinetRpcDevice::MakeNrd(), MakeNrdResponse(), profinet::cyclic::ReceivedIopsTest::MakePayload(), profinet::rpc::RpcTests::MakeRawRpcHeader(), MakeRpcResponse(), profinet::ParseAlarmNotification(), profinet::dcp::ParseSetResponse(), profinet::AlarmListener::ProcessAlarm(), profinet::rpc::RPCCon::ReadIm0(), profinet::rpc::RPCCon::ReadIm1(), profinet::rpc::RPCCon::ReadIm10(), profinet::rpc::RPCCon::ReadIm11(), profinet::rpc::RPCCon::ReadIm12(), profinet::rpc::RPCCon::ReadIm13(), profinet::rpc::RPCCon::ReadIm14(), profinet::rpc::RPCCon::ReadIm15(), profinet::rpc::RPCCon::ReadIm2(), profinet::rpc::RPCCon::ReadIm3(), profinet::rpc::RPCCon::ReadIm4(), profinet::rpc::RPCCon::ReadIm5(), profinet::rpc::RPCCon::ReadIm6(), profinet::rpc::RPCCon::ReadIm7(), profinet::rpc::RPCCon::ReadIm8(), profinet::rpc::RPCCon::ReadIm9(), profinet::dcp::ReadResponse(), profinet::dcp::ReceiveHello(), profinet::dcp::RecvSetResponse(), profinet::sim::VirtualAumaValve::SendInputFrame(), profinet::cyclic::CyclicController::SendOutputFrame(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::dcp::TEST(), profinet::TEST(), profinet::TEST(), profinet::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::sim::TEST(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), profinet::dcp::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), profinet::rpc::TEST_F(), and profinet::rpc::RPCCon::WriteMultiple().

◆ suboption