diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-02 12:50:57 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-08 15:53:43 +0100 |
commit | 54fb957c9640d61ab575d7acfc4c430a15123315 (patch) | |
tree | 51ce829032913af068071be0dcfff7c7bef409b7 /src/profiling/test/SendCounterPacketTests.hpp | |
parent | c4728ad356b73915588c971f6de38f4493078397 (diff) | |
download | armnn-54fb957c9640d61ab575d7acfc4c430a15123315.tar.gz |
IVGCVSW-3937 Add the necessary components to the ProfilingService class to
process a connection to an external profiling service (e.g. gatord)
* Added the required components (CommandHandlerRegistry, CommandHandler,
SendCounterPacket, ...) to the ProfilingService class
* Reworked the ProfilingService::Run procedure and renamed it to Update
* Handling all states but Active in the Run method (future work)
* Updated the unit and tests accordingly
* Added component tests to check that the Connection Acknowledged packet
is handled correctly
* Added test util classes, made the default constructor/destructor protected
to superclass a ProfilingService object
* Added IProfilingConnectionFactory interface
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: I010d94b18980c9e6394253f4b2bbe4fe5bb3fe4f
Diffstat (limited to 'src/profiling/test/SendCounterPacketTests.hpp')
-rw-r--r-- | src/profiling/test/SendCounterPacketTests.hpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp index cae02b064d..48bab025dd 100644 --- a/src/profiling/test/SendCounterPacketTests.hpp +++ b/src/profiling/test/SendCounterPacketTests.hpp @@ -24,9 +24,11 @@ class MockProfilingConnection : public IProfilingConnection public: MockProfilingConnection() : m_IsOpen(true) + , m_WrittenData() + , m_Packet() {} - bool IsOpen() override { return m_IsOpen; } + bool IsOpen() const override { return m_IsOpen; } void Close() override { m_IsOpen = false; } @@ -40,8 +42,19 @@ public: m_WrittenData.push_back(length); return true; } + bool WritePacket(Packet&& packet) + { + m_Packet = std::move(packet); + return true; + } - Packet ReadPacket(uint32_t timeout) override { return Packet(); } + Packet ReadPacket(uint32_t timeout) override + { + // Simulate a delay in the reading process + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + + return std::move(m_Packet); + } const std::vector<uint32_t>& GetWrittenData() const { return m_WrittenData; } @@ -50,6 +63,7 @@ public: private: bool m_IsOpen; std::vector<uint32_t> m_WrittenData; + Packet m_Packet; }; class MockPacketBuffer : public IPacketBuffer |