| 271 | } |
| 272 | |
| 273 | TEST_F(MultiThreadUnitTests, testMultiThreadSerialStreamReadWrite) |
| 274 | { |
| 275 | SCOPED_TRACE("Test Multi-Thread Serial Stream Communication.") ; |
| 276 | |
| 277 | failureRate = 0 ; |
| 278 | loopCount = 0 ; |
| 279 | |
| 280 | for (size_t i = 0; i < TEST_ITERATIONS; i++) |
| 281 | { |
| 282 | testMultiThreadSerialStreamReadWrite() ; |
| 283 | } |
| 284 | |
| 285 | const auto failRate = ( |
| 286 | 100. * static_cast<double>(failureRate) / |
| 287 | static_cast<double>(loopCount) |
| 288 | ) ; |
| 289 | |
| 290 | // If the serial communication fail rate is greater than 0.0001% consider it a failed test. |
| 291 | if (failRate > 0.0001) |
| 292 | { |
| 293 | std::cout << "\t SerialStream Failure Rate = " << failRate << "%" << std::endl; |
| 294 | ADD_FAILURE() ; |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | TEST_F(MultiThreadUnitTests, testMultiThreadSerialPortReadWrite) |
| 299 | { |
nothing calls this directly
no outgoing calls
no test coverage detected