diff options
Diffstat (limited to 'src/profiling/test/SendCounterPacketTests.hpp')
-rw-r--r-- | src/profiling/test/SendCounterPacketTests.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp index cd41418e2c..4395d81d16 100644 --- a/src/profiling/test/SendCounterPacketTests.hpp +++ b/src/profiling/test/SendCounterPacketTests.hpp @@ -67,11 +67,9 @@ public: Packet ReadPacket(uint32_t timeout) override { - // Simulate a delay in the reading process - std::this_thread::sleep_for(std::chrono::milliseconds(timeout)); - + // Simulate a delay in the reading process. The default timeout is way too long. + std::this_thread::sleep_for(std::chrono::milliseconds(5)); std::lock_guard<std::mutex> lock(m_Mutex); - return std::move(m_Packet); } @@ -84,6 +82,12 @@ public: return writtenData; } + const bool HasWrittenData() + { + std::lock_guard<std::mutex> lock(m_Mutex); + return !m_WrittenData.empty(); + } + void Clear() { std::lock_guard<std::mutex> lock(m_Mutex); |