From 0251aa9e63b4a644b74014537dec1d57a6f7bab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Tue, 14 Feb 2023 14:49:00 +0100 Subject: [PATCH] fixed linking issue in arping and shm test (#659) Co-authored-by: Erik Frojdh --- slsDetectorSoftware/tests/test-SharedMemory.cpp | 2 +- slsReceiverSoftware/src/Arping.cpp | 4 ++-- slsReceiverSoftware/src/Arping.h | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/slsDetectorSoftware/tests/test-SharedMemory.cpp b/slsDetectorSoftware/tests/test-SharedMemory.cpp index 2ddd6167f..682abbfa4 100644 --- a/slsDetectorSoftware/tests/test-SharedMemory.cpp +++ b/slsDetectorSoftware/tests/test-SharedMemory.cpp @@ -101,7 +101,7 @@ TEST_CASE("Move SharedMemory", "[detector]") { shm2 = std::move(shm); // shm is now a moved from object! CHECK(shm2()->x == 9); - CHECK(shm() == nullptr); + REQUIRE_THROWS(shm()); // trying to access should throw instead of returning a nullptr CHECK(shm2.getName() == std::string("/slsDetectorPackage_detector_") + std::to_string(shm_id)); shm2.removeSharedMemory(); diff --git a/slsReceiverSoftware/src/Arping.cpp b/slsReceiverSoftware/src/Arping.cpp index 0f8fca2ba..98c2c2993 100644 --- a/slsReceiverSoftware/src/Arping.cpp +++ b/slsReceiverSoftware/src/Arping.cpp @@ -85,8 +85,8 @@ void Arping::ProcessExecution() { if (!error.empty()) { LOG(logERROR) << error; } - - std::this_thread::sleep_for(std::chrono::seconds(timeIntervalSeconds)); + const auto interval = std::chrono::seconds(60); + std::this_thread::sleep_for(interval); } } diff --git a/slsReceiverSoftware/src/Arping.h b/slsReceiverSoftware/src/Arping.h index e9f454dab..bd6ea21a6 100644 --- a/slsReceiverSoftware/src/Arping.h +++ b/slsReceiverSoftware/src/Arping.h @@ -36,7 +36,6 @@ class Arping { std::vector(MAX_NUMBER_OF_LISTENING_THREADS); std::atomic runningFlag{false}; std::atomic childPid{0}; - static const int timeIntervalSeconds = 60; }; } // namespace sls