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

Tests for platform-independent interface and executable-path utilities. More...

#include <gtest/gtest.h>
#include <array>
#include <cstdint>
#include <cstdlib>
#include <filesystem>
#include <string>
#include "profinet/exceptions.h"
#include "profinet/util.h"
+ Include dependency graph for test_platform.cpp:

Go to the source code of this file.

Macros

#define PROFINET_TEST_INTERFACE   ""
 

Functions

 TEST (PlatformTests, GetInterfaceMacRejectsEmptyInterface)
 
 TEST (PlatformTests, GetInterfaceMacRejectsUnknownInterface)
 
 TEST (PlatformTests, GetInterfaceMacReturnsSixByteAddress)
 
 TEST (PlatformTests, MacAddressProviderUsesPortableInterfaceLookup)
 
 TEST (PlatformTests, GetExecutableDirectoryReturnsExistingAbsoluteDirectory)
 
 TEST (PlatformTests, GetExecutableDirectoryIsStable)
 

Detailed Description

Tests for platform-independent interface and executable-path utilities.

Definition in file test_platform.cpp.

Macro Definition Documentation

◆ PROFINET_TEST_INTERFACE

#define PROFINET_TEST_INTERFACE   ""

Definition at line 16 of file test_platform.cpp.

Function Documentation

◆ TEST() [1/6]

TEST ( PlatformTests  ,
GetExecutableDirectoryIsStable   
)
Test:
Verifies that repeated executable-directory lookups remain stable.

Definition at line 83 of file test_platform.cpp.

References profinet::GetExecutableDirectory().

+ Here is the call graph for this function:

◆ TEST() [2/6]

TEST ( PlatformTests  ,
GetExecutableDirectoryReturnsExistingAbsoluteDirectory   
)
Test:
Verifies that the executable directory is absolute and exists.

Definition at line 73 of file test_platform.cpp.

References profinet::GetExecutableDirectory().

+ Here is the call graph for this function:

◆ TEST() [3/6]

TEST ( PlatformTests  ,
GetInterfaceMacRejectsEmptyInterface   
)
Test:
Verifies that an empty interface name is rejected.

Definition at line 31 of file test_platform.cpp.

References profinet::GetInterfaceMac().

+ Here is the call graph for this function:

◆ TEST() [4/6]

TEST ( PlatformTests  ,
GetInterfaceMacRejectsUnknownInterface   
)
Test:
Verifies that an unknown interface name is rejected.

Definition at line 37 of file test_platform.cpp.

References profinet::GetInterfaceMac().

+ Here is the call graph for this function:

◆ TEST() [5/6]

TEST ( PlatformTests  ,
GetInterfaceMacReturnsSixByteAddress   
)
Test:
Verifies that the configured interface exposes a six-byte MAC address.

Definition at line 43 of file test_platform.cpp.

References profinet::GetInterfaceMac(), and profinet::macAddressLength.

+ Here is the call graph for this function:

◆ TEST() [6/6]

TEST ( PlatformTests  ,
MacAddressProviderUsesPortableInterfaceLookup   
)
Test:
Verifies that MacAddressProvider delegates to GetInterfaceMac().

Definition at line 58 of file test_platform.cpp.

References profinet::GetInterfaceMac(), and profinet::MacAddressProvider::GetMac().

+ Here is the call graph for this function: