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

Unit tests for PROFINET Vendor ID lookup utilities. More...

#include <gtest/gtest.h>
#include "profinet/vendors.h"
+ Include dependency graph for test_vendors.cpp:

Go to the source code of this file.

Classes

class  VendorsTest
 

Functions

 TEST_F (VendorsTest, KnownVendorIdResolvesToName)
 
 TEST_F (VendorsTest, UnknownVendorIdReturnsNulloptOrFallbackString)
 

Detailed Description

Unit tests for PROFINET Vendor ID lookup utilities.

Verifies vendor name lookup behavior provided by vendors.h.

The tests cover:

  • Resolving a known PROFINET vendor ID to a vendor name.
  • Handling unknown vendor IDs through std::nullopt or the formatted "Unknown (0xXXXX)" fallback returned by GetVendorName().

Definition in file test_vendors.cpp.

Function Documentation

◆ TEST_F() [1/2]

TEST_F ( VendorsTest  ,
KnownVendorIdResolvesToName   
)
Test:
known vendor id resolves to a name

Definition at line 23 of file test_vendors.cpp.

References profinet::LookupVendor().

+ Here is the call graph for this function:

◆ TEST_F() [2/2]

TEST_F ( VendorsTest  ,
UnknownVendorIdReturnsNulloptOrFallbackString   
)
Test:
unknown vendor id returns nullopt / fallback string

Definition at line 32 of file test_vendors.cpp.

References profinet::GetVendorName(), and profinet::LookupVendor().

+ Here is the call graph for this function: