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

Unit tests for the PROFINET alarm listener and alarm endpoint. More...

#include <gtest/gtest.h>
#include <cstdint>
#include <functional>
#include <memory>
#include "mocks/alarmListenerTestAccess.h"
#include "mocks/mockRawEthernetSocket.h"
#include "profinet/alarmListener.h"
+ Include dependency graph for test_alarmListener.cpp:

Go to the source code of this file.

Classes

class  profinet::AlarmListenerTests
 

Namespaces

namespace  profinet
 

Functions

 profinet::TEST (AlarmEndpointTests, DefaultTransportIsLayer2)
 
 profinet::TEST (AlarmEndpointTests, AllFieldsCanBeConfigured)
 
 profinet::TEST_F (AlarmListenerTests, InitializesWithEndpoint)
 
 profinet::TEST_F (AlarmListenerTests, InitializesWithoutCallbacks)
 
 profinet::TEST_F (AlarmListenerTests, AddLambaCallbackRegistersCallback)
 
 profinet::TEST_F (AlarmListenerTests, AddCallbackRegistersCallback)
 
 profinet::TEST_F (AlarmListenerTests, AddEmptyCallbackDoesNothing)
 
 profinet::TEST_F (AlarmListenerTests, RemoveCallback)
 
 profinet::TEST_F (AlarmListenerTests, RemoveNonexistentCallbackDoesNotThrow)
 
 profinet::TEST_F (AlarmListenerTests, RemoveEmptyCallbackDoesNothing)
 
 profinet::TEST_F (AlarmListenerTests, IsRunningInitiallyFalse)
 
 profinet::TEST_F (AlarmListenerTests, IsRunningReflectsState)
 
 profinet::TEST_F (AlarmListenerTests, ControllerMacDefaultsToZero)
 
 profinet::TEST_F (AlarmListenerTests, AcceptsCustomControllerMac)
 
 profinet::TEST (AlarmFrameIdTests, HighPriorityAlarmFrameId)
 
 profinet::TEST (AlarmFrameIdTests, LowPriorityAlarmFrameId)
 
 profinet::TEST_F (AlarmListenerTests, FailedStartLeavesListenerStopped)
 
 profinet::TEST_F (AlarmListenerTests, StartAfterFailedStartSucceeds)
 
 profinet::TEST_F (AlarmListenerTests, StopIsIdempotent)
 

Detailed Description

Unit tests for the PROFINET alarm listener and alarm endpoint.

Tests the configuration and lifecycle behavior of AlarmEndpoint and AlarmListener.

The tests cover:

  • AlarmEndpoint default and explicitly configured fields.
  • AlarmListener initialization and running state.
  • AlarmListener callback registration and removal.
  • Default and explicitly configured controller MAC addresses.
  • PROFINET alarm frame ID constants.

Tests that require actual Ethernet or UDP traffic are intentionally not covered here. Those behaviors are exercised separately through the listener transport tests using an injected IR​awEthernetSocket.

Definition in file test_alarmListener.cpp.