|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Concurrency and lifetime regression tests for sanitizer builds. More...
#include <gtest/gtest.h>#include <atomic>#include <chrono>#include <cstdint>#include <memory>#include <thread>#include <vector>#include "mocks/mockRawEthernetSocket.h"#include "profinet/cyclic.h"#include "profinet/rt.h"
Include dependency graph for test_sanitizerConcurrency.cpp:Go to the source code of this file.
Functions | |
| TEST (SanitizerConcurrencyTest, ConcurrentStatisticsSnapshotIsRaceFree) | |
| TEST (SanitizerConcurrencyTest, ConcurrentOutputDataWritersAreRaceFree) | |
| TEST (SanitizerConcurrencyTest, RepeatedStartStopJoinsWorkers) | |
| TEST (SanitizerConcurrencyTest, DestructionAfterWorkerActivityIsClean) | |
Concurrency and lifetime regression tests for sanitizer builds.
These tests exercise APIs documented as thread-safe and the cyclic worker lifecycle. They are intended primarily for ThreadSanitizer, but also stress object lifetime and allocation paths under AddressSanitizer.
Definition in file test_sanitizerConcurrency.cpp.
| TEST | ( | SanitizerConcurrencyTest | , |
| ConcurrentOutputDataWritersAreRaceFree | |||
| ) |
SetOutputData is documented as thread-safe. Multiple writers stress the output-buffer synchronization and allocation paths.
Definition at line 114 of file test_sanitizerConcurrency.cpp.
References controller, and length.
| TEST | ( | SanitizerConcurrencyTest | , |
| ConcurrentStatisticsSnapshotIsRaceFree | |||
| ) |
The previous version called Reset() through the const Stats() API, which could never compile. This test instead exercises the public snapshot API concurrently with the real cyclic worker threads.
Definition at line 75 of file test_sanitizerConcurrency.cpp.
References controller, rx, and tx.
| TEST | ( | SanitizerConcurrencyTest | , |
| DestructionAfterWorkerActivityIsClean | |||
| ) |
Repetition increases the chance of exposing use-after-free and shutdown-ordering defects under ASan and TSan.
Definition at line 179 of file test_sanitizerConcurrency.cpp.
References controller, rx, and tx.
| TEST | ( | SanitizerConcurrencyTest | , |
| RepeatedStartStopJoinsWorkers | |||
| ) |
Mock sockets keep this test independent of raw-Ethernet privileges.
Definition at line 156 of file test_sanitizerConcurrency.cpp.
References controller, rx, and tx.