20.08
|
#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 <boost/numeric/conversion/cast.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 102 of file SendCounterPacketTests.cpp.
BOOST_AUTO_TEST_CASE | ( | MockSendCounterPacketTest | ) |
Definition at line 104 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 152 of file SendCounterPacketTests.cpp.
References MockBufferManager::GetReadableBuffer(), armnn::profiling::ReadUint16(), armnn::profiling::ReadUint32(), and SendCounterPacket::SendPeriodicCounterSelectionPacket().
BOOST_AUTO_TEST_CASE | ( | SendPeriodicCounterCapturePacketTest | ) |
Definition at line 213 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 290 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 434 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateDeviceRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidDeviceRecordTest | ) |
Definition at line 466 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateDeviceRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateCounterSetRecordTest | ) |
Definition at line 487 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCounterSetRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCounterSetRecordTest | ) |
Definition at line 519 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCounterSetRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateEventRecordTest | ) |
Definition at line 540 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 667 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 773 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest2 | ) |
Definition at line 812 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidEventRecordTest3 | ) |
Definition at line 851 of file SendCounterPacketTests.cpp.
References ARMNN_ASSERT, and SendCounterPacketTest::CreateEventRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateCategoryRecordTest | ) |
Definition at line 890 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 1100 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCategoryRecordTest().
BOOST_AUTO_TEST_CASE | ( | CreateInvalidCategoryRecordTest2 | ) |
Definition at line 1121 of file SendCounterPacketTests.cpp.
References SendCounterPacketTest::CreateCategoryRecordTest().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest1 | ) |
Definition at line 1160 of file SendCounterPacketTests.cpp.
References CounterDirectory::GetDeviceCount(), CounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest2 | ) |
Definition at line 1186 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 1661 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetDeviceCount(), MockCounterDirectory::RegisterDevice(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest4 | ) |
Definition at line 1679 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetCounterSetCount(), MockCounterDirectory::RegisterCounterSet(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest5 | ) |
Definition at line 1697 of file SendCounterPacketTests.cpp.
References MockCounterDirectory::GetCategoryCount(), MockCounterDirectory::RegisterCategory(), and SendCounterPacket::SendCounterDirectoryPacket().
BOOST_AUTO_TEST_CASE | ( | SendCounterDirectoryPacketTest6 | ) |
Definition at line 1715 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 1747 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 1796 of file SendCounterPacketTests.cpp.
References SendThread::IsRunning(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadTest1 | ) |
Definition at line 1820 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 1928 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 2046 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 2149 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 2196 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 2255 of file SendCounterPacketTests.cpp.
References SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket2 | ) |
Definition at line 2269 of file SendCounterPacketTests.cpp.
References SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket3 | ) |
Definition at line 2284 of file SendCounterPacketTests.cpp.
References MockProfilingConnection::CheckForPacket(), GetStreamMetaDataPacketSize(), MockProfilingConnection::GetWrittenDataSize(), SendThread::Start(), and SendThread::Stop().
BOOST_AUTO_TEST_CASE | ( | SendThreadSendStreamMetadataPacket4 | ) |
Definition at line 2309 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.