21.05
|
#include "ProfilingMocks.hpp"
#include "ProfilingTestUtils.hpp"
#include "SendCounterPacketTests.hpp"
#include <BufferManager.hpp>
#include <CounterDirectory.hpp>
#include <common/include/EncodeVersion.hpp>
#include <ProfilingUtils.hpp>
#include <SendCounterPacket.hpp>
#include <Processes.hpp>
#include <armnn/Exceptions.hpp>
#include <armnn/Conversion.hpp>
#include <armnn/Utils.hpp>
#include <common/include/Constants.hpp>
#include <boost/test/unit_test.hpp>
#include <chrono>
Go to the source code of this file.
Typedefs | |
using | PacketType = MockProfilingConnection::PacketType |
Functions | |
BOOST_AUTO_TEST_CASE (MockSendCounterPacketTest) | |
BOOST_AUTO_TEST_CASE (SendPeriodicCounterSelectionPacketTest) | |
BOOST_AUTO_TEST_CASE (SendPeriodicCounterCapturePacketTest) | |
BOOST_AUTO_TEST_CASE (SendStreamMetaDataPacketTest) | |
BOOST_AUTO_TEST_CASE (CreateDeviceRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidDeviceRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateCounterSetRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidCounterSetRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateEventRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateEventRecordNoUnitsTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidEventRecordTest1) | |
BOOST_AUTO_TEST_CASE (CreateInvalidEventRecordTest2) | |
BOOST_AUTO_TEST_CASE (CreateInvalidEventRecordTest3) | |
BOOST_AUTO_TEST_CASE (CreateCategoryRecordTest) | |
BOOST_AUTO_TEST_CASE (CreateInvalidCategoryRecordTest1) | |
BOOST_AUTO_TEST_CASE (CreateInvalidCategoryRecordTest2) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest1) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest2) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest3) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest4) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest5) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest6) | |
BOOST_AUTO_TEST_CASE (SendCounterDirectoryPacketTest7) | |
BOOST_AUTO_TEST_CASE (SendThreadTest0) | |
BOOST_AUTO_TEST_CASE (SendThreadTest1) | |
BOOST_AUTO_TEST_CASE (SendThreadTest2) | |
BOOST_AUTO_TEST_CASE (SendThreadTest3) | |
BOOST_AUTO_TEST_CASE (SendCounterPacketTestWithSendThread) | |
BOOST_AUTO_TEST_CASE (SendThreadBufferTest) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket1) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket2) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket3) | |
BOOST_AUTO_TEST_CASE (SendThreadSendStreamMetadataPacket4) | |
Definition at line 100 of file SendCounterPacketTests.cpp.
BOOST_AUTO_TEST_CASE | ( | MockSendCounterPacketTest | ) |
Definition at line 102 of file SendCounterPacketTests.cpp.
References MockBufferManager::GetReadableBuffer(), MockBufferManager::MarkRead(), MockSendCounterPacket::SendCounterDirectoryPacket(), MockSendCounterPacket::SendPeriodicCounterCapturePacket(), MockSendCounterPacket::SendPeriodicCounterSelectionPacket(), and MockSendCounterPacket::SendStreamMetaDataPacket().
BOOST_AUTO_TEST_CASE | ( | SendPeriodicCounterSelectionPacketTest | ) |
Definition at line 150 of file SendCounterPacketTests.cpp.
References MockBufferManager::GetReadableBuffer(), armnn::profiling::ReadUint16(), armnn::profiling::ReadUint32(), and SendCounterPacket::SendPeriodicCounterSelectionPacket().
BOOST_AUTO_TEST_CASE | ( | SendPeriodicCounterCapturePacketTest | ) |
Definition at line 211 of file SendCounterPacketTests.cpp.
References MockBufferManager::GetReadableBuffer(), armnn::profiling::ReadUint16(), armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), and SendCounterPacket::SendPeriodicCounterCapturePacket().
BOOST_AUTO_TEST_CASE | ( | SendStreamMetaDataPacketTest | ) |
Definition at line 288 of file SendCounterPacketTests.cpp.
References armnn::profiling::ConstructHeader(), armnnUtils::Processes::GetCurrentId(), armnn::profiling::GetHardwareVersion(), armnn::profiling::GetProcessName(), MockBufferManager::GetReadableBuffer(), armnn::profiling::GetSoftwareInfo(), armnn::profiling::GetSoftwareVersion(), MAX_METADATA_PACKET_LENGTH, armnn::numeric_cast(), armnn::profiling::ReadUint32(), and SendCounterPacket::SendStreamMetaDataPacket().
BOOST_AUTO_TEST_CASE | ( | CreateDeviceRecordTest | ) |
Definition at line 432 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateDeviceRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidDeviceRecordTest | ) |
Definition at line 464 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateDeviceRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateCounterSetRecordTest | ) |
Definition at line 485 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCounterSetRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCounterSetRecordTest | ) |
Definition at line 517 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCounterSetRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateEventRecordTest | ) |
Definition at line 538 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, ARMNN_NO_CONVERSION_WARN_BEGIN, ARMNN_NO_CONVERSION_WARN_END, SendCounterPacketTest::CreateEventRecordTest(), and armnn::profiling::uint32_t_size.
BOOST_AUTO_TEST_CASE | ( | CreateEventRecordNoUnitsTest | ) |
Definition at line 665 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, ARMNN_NO_CONVERSION_WARN_BEGIN, ARMNN_NO_CONVERSION_WARN_END, SendCounterPacketTest::CreateEventRecordTest(), and armnn::profiling::uint32_t_size.
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest1 | ) |
Definition at line 771 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest2 | ) |
Definition at line 810 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest3 | ) |
Definition at line 849 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateCategoryRecordTest | ) |
Definition at line 888 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, ARMNN_NO_CONVERSION_WARN_BEGIN, ARMNN_NO_CONVERSION_WARN_END, SendCounterPacketTest::CreateCategoryRecordTest(), Counter::m_MaxCounterUid, Counter::m_Name, Counter::m_Uid, armnn::numeric_cast(), and armnn::profiling::uint32_t_size.
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCategoryRecordTest1 | ) |
Definition at line 1098 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCategoryRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCategoryRecordTest2 | ) |
Definition at line 1119 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCategoryRecordTest().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest1 | ) |
Definition at line 1158 of file SendCounterPacketTests.cpp.
References CounterDirectory::GetDeviceCount(), CounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest2 | ) |
Definition at line 1184 of file SendCounterPacketTests.cpp.
References CounterDirectory::GetCategoryCount(), CounterDirectory::GetCounterCount(), CounterDirectory::GetCounterSetCount(), CounterDirectory::GetDeviceCount(), MockBufferManager::GetReadableBuffer(), Device::m_Uid, CounterSet::m_Uid, armnn::profiling::ReadUint32(), CounterDirectory::RegisterCategory(), CounterDirectory::RegisterCounter(), CounterDirectory::RegisterCounterSet(), CounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest3 | ) |
Definition at line 1659 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetDeviceCount(), MockCounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest4 | ) |
Definition at line 1677 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetCounterSetCount(), MockCounterDirectory::RegisterCounterSet(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest5 | ) |
Definition at line 1695 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetCategoryCount(), MockCounterDirectory::RegisterCategory(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest6 | ) |
Definition at line 1713 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetCategoryCount(), MockCounterDirectory::GetCounterSetCount(), MockCounterDirectory::GetDeviceCount(), MockCounterDirectory::RegisterCategory(), MockCounterDirectory::RegisterCounterSet(), MockCounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest7 | ) |
Definition at line 1745 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetCategoryCount(), MockCounterDirectory::GetCounterCount(), MockCounterDirectory::GetCounterSetCount(), MockCounterDirectory::GetDeviceCount(), Device::m_Uid, CounterSet::m_Uid, MockCounterDirectory::RegisterCategory(), MockCounterDirectory::RegisterCounter(), MockCounterDirectory::RegisterCounterSet(), MockCounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest0 | ) |
Definition at line 1794 of file SendCounterPacketTests.cpp.
References SendThread::IsRunning(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest1 | ) |
Definition at line 1818 of file SendCounterPacketTests.cpp.
References MockStreamCounterBuffer::GetCommittedSize(), MockStreamCounterBuffer::GetReadableSize(), MockStreamCounterBuffer::GetReadSize(), GetStreamMetaDataPacketSize(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendPeriodicCounterSelectionPacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::SetReadyToRead(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest2 | ) |
Definition at line 1926 of file SendCounterPacketTests.cpp.
References MockStreamCounterBuffer::GetCommittedSize(), MockStreamCounterBuffer::GetReadableSize(), MockStreamCounterBuffer::GetReadSize(), GetStreamMetaDataPacketSize(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendPeriodicCounterSelectionPacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::SetReadyToRead(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest3 | ) |
Definition at line 2044 of file SendCounterPacketTests.cpp.
References MockStreamCounterBuffer::GetCommittedSize(), MockStreamCounterBuffer::GetReadableSize(), MockStreamCounterBuffer::GetReadSize(), GetStreamMetaDataPacketSize(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendPeriodicCounterSelectionPacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::SetReadyToRead(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendCounterPacketTestWithSendThread | ) |
Definition at line 2147 of file SendCounterPacketTests.cpp.
References MockProfilingConnection::CheckForPacket(), GetStreamMetaDataPacketSize(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadBufferTest | ) |
Definition at line 2194 of file SendCounterPacketTests.cpp.
References MockProfilingConnection::CheckForPacket(), BufferManager::Commit(), BufferManager::GetReadableBuffer(), GetStreamMetaDataPacketSize(), MockProfilingConnection::GetWrittenDataSize(), BufferManager::Reserve(), SendCounterPacket::SendCounterDirectoryPacket(), SendCounterPacket::SendPeriodicCounterCapturePacket(), SendCounterPacket::SendStreamMetaDataPacket(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket1 | ) |
Definition at line 2253 of file SendCounterPacketTests.cpp.
References SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket2 | ) |
Definition at line 2267 of file SendCounterPacketTests.cpp.
References SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket3 | ) |
Definition at line 2282 of file SendCounterPacketTests.cpp.
References MockProfilingConnection::CheckForPacket(), GetStreamMetaDataPacketSize(), MockProfilingConnection::GetWrittenDataSize(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket4 | ) |
Definition at line 2307 of file SendCounterPacketTests.cpp.
References BOOST_AUTO_TEST_SUITE_END(), MockProfilingConnection::CheckForPacket(), MockProfilingConnection::Clear(), ProfilingStateMachine::GetCurrentState(), GetStreamMetaDataPacketSize(), MockProfilingConnection::GetWrittenDataSize(), SendThread::SetReadyToRead(), SendThread::Start(), SendThread::Stop(), and armnn::profiling::WaitingForAck.