From 1625efc870f1a8b7c6e6382277ddbb245f91a294 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Thu, 10 Jun 2021 18:24:34 +0100 Subject: IVGCVSW-5963 'Move unit tests to new framework' * Used doctest in ArmNN unit tests Signed-off-by: Sadik Armagan Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a --- src/profiling/test/BufferTests.cpp | 195 +- .../test/FileOnlyProfilingDecoratorTests.cpp | 26 +- ...ProfilingConnectionDumpToFileDecoratorTests.cpp | 40 +- src/profiling/test/ProfilingGuidTest.cpp | 90 +- src/profiling/test/ProfilingTestUtils.cpp | 273 +-- src/profiling/test/ProfilingTests.cpp | 1908 ++++++++++---------- src/profiling/test/ProfilingTests.hpp | 8 +- src/profiling/test/SendCounterPacketTests.cpp | 694 +++---- src/profiling/test/SendTimelinePacketTests.cpp | 248 +-- src/profiling/test/TimelinePacketTests.cpp | 296 +-- src/profiling/test/TimelineUtilityMethodsTests.cpp | 96 +- 11 files changed, 1940 insertions(+), 1934 deletions(-) (limited to 'src/profiling/test') diff --git a/src/profiling/test/BufferTests.cpp b/src/profiling/test/BufferTests.cpp index 7a92ee19e5..e3abe862e4 100644 --- a/src/profiling/test/BufferTests.cpp +++ b/src/profiling/test/BufferTests.cpp @@ -11,17 +11,17 @@ #include -#include +#include using namespace armnn::profiling; -BOOST_AUTO_TEST_SUITE(BufferTests) - -BOOST_AUTO_TEST_CASE(PacketBufferTest0) +TEST_SUITE("BufferTests") +{ +TEST_CASE("PacketBufferTest0") { IPacketBufferPtr packetBuffer = std::make_unique(512); - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); // Write data to the buffer WriteUint32(packetBuffer, 0, 10); @@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE(PacketBufferTest0) packetBuffer->Commit(16); // Size of buffer is equal to committed data - BOOST_TEST(packetBuffer->GetSize() == 16); + CHECK(packetBuffer->GetSize() == 16); // Read data from the buffer auto readBuffer = packetBuffer->GetReadableData(); @@ -43,23 +43,23 @@ BOOST_AUTO_TEST_CASE(PacketBufferTest0) uint32_t readData3 = ReadUint32(readBuffer, 12); // Check that data is correct - BOOST_TEST(readData0 == 10); - BOOST_TEST(readData1 == 20); - BOOST_TEST(readData2 == 30); - BOOST_TEST(readData3 == 40); + CHECK(readData0 == 10); + CHECK(readData1 == 20); + CHECK(readData2 == 30); + CHECK(readData3 == 40); // Mark read packetBuffer->MarkRead(); // Size of buffer become 0 after marked read - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); } -BOOST_AUTO_TEST_CASE(PacketBufferTest1) +TEST_CASE("PacketBufferTest1") { IPacketBufferPtr packetBuffer = std::make_unique(512); - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); // Write data to the buffer using GetWritableData auto writeBuffer = packetBuffer->GetWritableData(); @@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE(PacketBufferTest1) packetBuffer->Commit(16); - BOOST_TEST(packetBuffer->GetSize() == 16); + CHECK(packetBuffer->GetSize() == 16); // Read data from the buffer auto readBuffer = packetBuffer->GetReadableData(); @@ -79,20 +79,21 @@ BOOST_AUTO_TEST_CASE(PacketBufferTest1) uint32_t readData2 = ReadUint32(readBuffer, 8); uint32_t readData3 = ReadUint32(readBuffer, 12); - BOOST_TEST(readData0 == 10); - BOOST_TEST(readData1 == 20); - BOOST_TEST(readData2 == 30); - BOOST_TEST(readData3 == 40); + CHECK(readData0 == 10); + CHECK(readData1 == 20); + CHECK(readData2 == 30); + CHECK(readData3 == 40); packetBuffer->MarkRead(); - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); } -BOOST_AUTO_TEST_CASE(PacketBufferReleaseTest) { +TEST_CASE("PacketBufferReleaseTest") +{ IPacketBufferPtr packetBuffer = std::make_unique(512); - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); auto writeBuffer = packetBuffer->GetWritableData(); @@ -104,48 +105,48 @@ BOOST_AUTO_TEST_CASE(PacketBufferReleaseTest) { packetBuffer->Release(); // Size of buffer become 0 after release - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); } -BOOST_AUTO_TEST_CASE(PacketBufferCommitErrorTest) +TEST_CASE("PacketBufferCommitErrorTest") { IPacketBufferPtr packetBuffer = std::make_unique(8); // Cannot commit data bigger than the max size of the buffer - BOOST_CHECK_THROW(packetBuffer->Commit(16);, armnn::RuntimeException); + CHECK_THROWS_AS(packetBuffer->Commit(16);, armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(BufferReserveTest) +TEST_CASE("BufferReserveTest") { BufferManager bufferManager(1, 512); unsigned int reservedSize = 0; auto packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); } -BOOST_AUTO_TEST_CASE(BufferReserveExceedingSpaceTest) +TEST_CASE("BufferReserveExceedingSpaceTest") { BufferManager bufferManager(1, 512); unsigned int reservedSize = 0; // Cannot reserve buffer bigger than maximum buffer size auto reservedBuffer = bufferManager.Reserve(1024, reservedSize); - BOOST_TEST(reservedSize == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize == 0); + CHECK(!reservedBuffer.get()); } -BOOST_AUTO_TEST_CASE(BufferExhaustionTest) +TEST_CASE("BufferExhaustionTest") { BufferManager bufferManager(1, 512); unsigned int reservedSize = 0; auto packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); // Cannot reserve buffer when buffer is not available // NOTE: because the buffer manager now has surge capacity of @@ -154,43 +155,43 @@ BOOST_AUTO_TEST_CASE(BufferExhaustionTest) packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the second buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the third buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); auto reservedBuffer = bufferManager.Reserve(512, reservedSize); - BOOST_TEST(reservedSize == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize == 0); + CHECK(!reservedBuffer.get()); } -BOOST_AUTO_TEST_CASE(BufferReserveMultipleTest) +TEST_CASE("BufferReserveMultipleTest") { BufferManager bufferManager(3, 512); unsigned int reservedSize0 = 0; auto packetBuffer0 = bufferManager.Reserve(512, reservedSize0); // Successfully reserved the buffer with requested size - BOOST_TEST(reservedSize0 == 512); - BOOST_TEST(packetBuffer0.get()); + CHECK(reservedSize0 == 512); + CHECK(packetBuffer0.get()); unsigned int reservedSize1 = 0; auto packetBuffer1 = bufferManager.Reserve(128, reservedSize1); // Successfully reserved the buffer with requested size - BOOST_TEST(reservedSize1 == 128); - BOOST_TEST(packetBuffer1.get()); + CHECK(reservedSize1 == 128); + CHECK(packetBuffer1.get()); unsigned int reservedSize2 = 0; auto packetBuffer2 = bufferManager.Reserve(512, reservedSize2); // Successfully reserved the buffer with requested size - BOOST_TEST(reservedSize2 == 512); - BOOST_TEST(packetBuffer2.get()); + CHECK(reservedSize2 == 512); + CHECK(packetBuffer2.get()); // NOTE: the buffer now has a surge capacity of initial size * 3 // so we can grab 9 of them prior to exhaustion now @@ -201,33 +202,33 @@ BOOST_AUTO_TEST_CASE(BufferReserveMultipleTest) auto packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the third buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); } // Cannot reserve when buffer is not available unsigned int reservedSize3 = 0; auto reservedBuffer = bufferManager.Reserve(512, reservedSize3); - BOOST_TEST(reservedSize3 == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize3 == 0); + CHECK(!reservedBuffer.get()); } -BOOST_AUTO_TEST_CASE(BufferReleaseTest) +TEST_CASE("BufferReleaseTest") { BufferManager bufferManager(2, 512); unsigned int reservedSize0 = 0; auto packetBuffer0 = bufferManager.Reserve(512, reservedSize0); // Successfully reserved the buffer with requested size - BOOST_TEST(reservedSize0 == 512); - BOOST_TEST(packetBuffer0.get()); + CHECK(reservedSize0 == 512); + CHECK(packetBuffer0.get()); unsigned int reservedSize1 = 0; auto packetBuffer1 = bufferManager.Reserve(128, reservedSize1); // Successfully reserved the buffer with requested size - BOOST_TEST(reservedSize1 == 128); - BOOST_TEST(packetBuffer1.get()); + CHECK(reservedSize1 == 128); + CHECK(packetBuffer1.get()); // NOTE: now that we have a surge capacity of up to // initial size * 3 we need to allocate four more @@ -239,39 +240,39 @@ BOOST_AUTO_TEST_CASE(BufferReleaseTest) auto packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the third buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); } // Cannot reserve when buffer is not available unsigned int reservedSize2 = 0; auto reservedBuffer = bufferManager.Reserve(512, reservedSize2); - BOOST_TEST(reservedSize2 == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize2 == 0); + CHECK(!reservedBuffer.get()); bufferManager.Release(packetBuffer0); // Buffer should become available after release auto packetBuffer2 = bufferManager.Reserve(128, reservedSize2); - BOOST_TEST(reservedSize2 == 128); - BOOST_TEST(packetBuffer2.get()); + CHECK(reservedSize2 == 128); + CHECK(packetBuffer2.get()); } -BOOST_AUTO_TEST_CASE(BufferCommitTest) +TEST_CASE("BufferCommitTest") { BufferManager bufferManager(2, 512); unsigned int reservedSize0 = 0; auto packetBuffer0 = bufferManager.Reserve(512, reservedSize0); - BOOST_TEST(reservedSize0 == 512); - BOOST_TEST(packetBuffer0.get()); + CHECK(reservedSize0 == 512); + CHECK(packetBuffer0.get()); unsigned int reservedSize1 = 0; auto packetBuffer1 = bufferManager.Reserve(128, reservedSize1); - BOOST_TEST(reservedSize1 == 128); - BOOST_TEST(packetBuffer1.get()); + CHECK(reservedSize1 == 128); + CHECK(packetBuffer1.get()); // NOTE: now that we have a surge capacity of up to // initial size * 3 we need to allocate four more @@ -283,43 +284,43 @@ BOOST_AUTO_TEST_CASE(BufferCommitTest) auto packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the third buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); } unsigned int reservedSize2 = 0; auto reservedBuffer = bufferManager.Reserve(512, reservedSize2); - BOOST_TEST(reservedSize2 == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize2 == 0); + CHECK(!reservedBuffer.get()); bufferManager.Commit(packetBuffer0, 256); // Buffer should become readable after commit auto packetBuffer2 = bufferManager.GetReadableBuffer(); - BOOST_TEST(packetBuffer2.get()); - BOOST_TEST(packetBuffer2->GetSize() == 256); + CHECK(packetBuffer2.get()); + CHECK(packetBuffer2->GetSize() == 256); // Buffer not set back to available list after commit unsigned int reservedSize = 0; reservedBuffer = bufferManager.Reserve(512, reservedSize); - BOOST_TEST(reservedSize == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize == 0); + CHECK(!reservedBuffer.get()); } -BOOST_AUTO_TEST_CASE(BufferMarkReadTest) +TEST_CASE("BufferMarkReadTest") { BufferManager bufferManager(2, 512); unsigned int reservedSize0 = 0; auto packetBuffer0 = bufferManager.Reserve(512, reservedSize0); - BOOST_TEST(reservedSize0 == 512); - BOOST_TEST(packetBuffer0.get()); + CHECK(reservedSize0 == 512); + CHECK(packetBuffer0.get()); unsigned int reservedSize1 = 0; auto packetBuffer1 = bufferManager.Reserve(128, reservedSize1); - BOOST_TEST(reservedSize1 == 128); - BOOST_TEST(packetBuffer1.get()); + CHECK(reservedSize1 == 128); + CHECK(packetBuffer1.get()); // NOTE: now that we have a surge capacity of up to // initial size * 3 we need to allocate four more @@ -331,45 +332,45 @@ BOOST_AUTO_TEST_CASE(BufferMarkReadTest) auto packetBuffer = bufferManager.Reserve(512, reservedSize); // Successfully reserved the third buffer with requested size - BOOST_TEST(reservedSize == 512); - BOOST_TEST(packetBuffer.get()); + CHECK(reservedSize == 512); + CHECK(packetBuffer.get()); } // Cannot reserve when buffer is not available unsigned int reservedSize2 = 0; auto reservedBuffer = bufferManager.Reserve(512, reservedSize2); - BOOST_TEST(reservedSize2 == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize2 == 0); + CHECK(!reservedBuffer.get()); bufferManager.Commit(packetBuffer0, 256); // Buffer should become readable after commit auto packetBuffer2 = bufferManager.GetReadableBuffer(); - BOOST_TEST(packetBuffer2.get()); - BOOST_TEST(packetBuffer2->GetSize() == 256); + CHECK(packetBuffer2.get()); + CHECK(packetBuffer2->GetSize() == 256); // Buffer not set back to available list after commit reservedBuffer = bufferManager.Reserve(512, reservedSize2); - BOOST_TEST(reservedSize2 == 0); - BOOST_TEST(!reservedBuffer.get()); + CHECK(reservedSize2 == 0); + CHECK(!reservedBuffer.get()); bufferManager.MarkRead(packetBuffer2); //Buffer should set back to available list after marked read and can be reserved auto readBuffer = bufferManager.GetReadableBuffer(); - BOOST_TEST(!readBuffer); + CHECK(!readBuffer); unsigned int reservedSize3 = 0; auto packetBuffer3 = bufferManager.Reserve(56, reservedSize3); - BOOST_TEST(reservedSize3 == 56); - BOOST_TEST(packetBuffer3.get()); + CHECK(reservedSize3 == 56); + CHECK(packetBuffer3.get()); } -BOOST_AUTO_TEST_CASE(ReadSwTraceMessageExceptionTest0) +TEST_CASE("ReadSwTraceMessageExceptionTest0") { IPacketBufferPtr packetBuffer = std::make_unique(512); - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); // Write zero data to the buffer WriteUint32(packetBuffer, 0, 0); @@ -382,16 +383,16 @@ BOOST_AUTO_TEST_CASE(ReadSwTraceMessageExceptionTest0) unsigned int uint32_t_size = sizeof(uint32_t); unsigned int offset = uint32_t_size; - BOOST_CHECK_THROW(arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), + CHECK_THROWS_AS(arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), arm::pipe::ProfilingException); } -BOOST_AUTO_TEST_CASE(ReadSwTraceMessageExceptionTest1) +TEST_CASE("ReadSwTraceMessageExceptionTest1") { IPacketBufferPtr packetBuffer = std::make_unique(512); - BOOST_TEST(packetBuffer->GetSize() == 0); + CHECK(packetBuffer->GetSize() == 0); // Write data to the buffer WriteUint32(packetBuffer, 0, 10); @@ -404,9 +405,9 @@ BOOST_AUTO_TEST_CASE(ReadSwTraceMessageExceptionTest1) unsigned int uint32_t_size = sizeof(uint32_t); unsigned int offset = uint32_t_size; - BOOST_CHECK_THROW(arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), + CHECK_THROWS_AS(arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), arm::pipe::ProfilingException); } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp b/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp index 813bb49b72..5827c0db9b 100644 --- a/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp +++ b/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp @@ -11,7 +11,7 @@ #include #include "TestTimelinePacketHandler.hpp" -#include +#include #include #include @@ -33,9 +33,9 @@ class FileOnlyHelperService : public ProfilingService armnn::profiling::ProfilingService m_ProfilingService; }; -BOOST_AUTO_TEST_SUITE(FileOnlyProfilingDecoratorTests) - -BOOST_AUTO_TEST_CASE(TestFileOnlyProfiling) +TEST_SUITE("FileOnlyProfilingDecoratorTests") +{ +TEST_CASE("TestFileOnlyProfiling") { // Get all registered backends std::vector suitableBackends = GetSuitableBackendRegistered(); @@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE(TestFileOnlyProfiling) // Load it into the runtime. It should succeed. armnn::NetworkId netId; - BOOST_TEST(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); + CHECK(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); // Creates structures for input & output. std::vector inputData(16); @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(TestFileOnlyProfiling) for (auto &error : model.GetErrors()) { std::cout << error.what() << std::endl; } - BOOST_TEST(model.GetErrors().empty()); + CHECK(model.GetErrors().empty()); std::vector desc = GetModelDescription(model); std::vector expectedOutput; expectedOutput.push_back("Entity [0] name = input type = layer"); @@ -147,11 +147,11 @@ BOOST_AUTO_TEST_CASE(TestFileOnlyProfiling) expectedOutput.push_back("Entity [55] type = workload_execution"); expectedOutput.push_back(" event: [59] class [start_of_life]"); expectedOutput.push_back(" event: [61] class [end_of_life]"); - BOOST_TEST(CompareOutput(desc, expectedOutput)); + CHECK(CompareOutput(desc, expectedOutput)); } } -BOOST_AUTO_TEST_CASE(DumpOutgoingValidFileEndToEnd) +TEST_CASE("DumpOutgoingValidFileEndToEnd") { // Get all registered backends std::vector suitableBackends = GetSuitableBackendRegistered(); @@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE(DumpOutgoingValidFileEndToEnd) // Create a temporary file name. fs::path tempPath = armnnUtils::Filesystem::NamedTempFile("DumpOutgoingValidFileEndToEnd_CaptureFile.txt"); // Make sure the file does not exist at this point - BOOST_CHECK(!fs::exists(tempPath)); + CHECK(!fs::exists(tempPath)); armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; @@ -202,7 +202,7 @@ BOOST_AUTO_TEST_CASE(DumpOutgoingValidFileEndToEnd) // Load it into the runtime. It should succeed. armnn::NetworkId netId; - BOOST_TEST(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); + CHECK(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); // Creates structures for input & output. std::vector inputData(16); @@ -231,13 +231,13 @@ BOOST_AUTO_TEST_CASE(DumpOutgoingValidFileEndToEnd) GetProfilingService(&runtime).ResetExternalProfilingOptions(options.m_ProfilingOptions, true); // The output file size should be greater than 0. - BOOST_CHECK(fs::file_size(tempPath) > 0); + CHECK(fs::file_size(tempPath) > 0); // NOTE: would be an interesting exercise to take this file and decode it // Delete the tmp file. - BOOST_CHECK(fs::remove(tempPath)); + CHECK(fs::remove(tempPath)); } } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp b/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp index 2ebba5d8d1..c2fcf1c228 100644 --- a/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp +++ b/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include using namespace armnn::profiling; @@ -74,27 +74,27 @@ std::vector ReadDumpFile(const std::string& dumpFileName) } // anonymous namespace -BOOST_AUTO_TEST_SUITE(ProfilingConnectionDumpToFileDecoratorTests) - -BOOST_AUTO_TEST_CASE(DumpIncomingInvalidFile) +TEST_SUITE("ProfilingConnectionDumpToFileDecoratorTests") +{ +TEST_CASE("DumpIncomingInvalidFile") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_IncomingCaptureFile = "/"; options.m_OutgoingCaptureFile = ""; ProfilingConnectionDumpToFileDecorator decorator(std::make_unique(), options, false); - BOOST_CHECK_THROW(decorator.ReadPacket(0), armnn::RuntimeException); + CHECK_THROWS_AS(decorator.ReadPacket(0), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(DumpIncomingInvalidFileIgnoreErrors) +TEST_CASE("DumpIncomingInvalidFileIgnoreErrors") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_IncomingCaptureFile = "/"; options.m_OutgoingCaptureFile = ""; ProfilingConnectionDumpToFileDecorator decorator(std::make_unique(), options, true); - BOOST_CHECK_NO_THROW(decorator.ReadPacket(0)); + CHECK_NOTHROW(decorator.ReadPacket(0)); } -BOOST_AUTO_TEST_CASE(DumpIncomingValidFile) +TEST_CASE("DumpIncomingValidFile") { fs::path fileName = armnnUtils::Filesystem::NamedTempFile("Armnn-DumpIncomingValidFileTest-TempFile"); @@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(DumpIncomingValidFile) // NOTE: unique_ptr is needed here because operator=() is deleted for Packet std::unique_ptr packet; - BOOST_CHECK_NO_THROW(packet = std::make_unique(decorator.ReadPacket(0))); + CHECK_NOTHROW(packet = std::make_unique(decorator.ReadPacket(0))); decorator.Close(); @@ -116,33 +116,33 @@ BOOST_AUTO_TEST_CASE(DumpIncomingValidFile) // check if the data read back from the dump file matches the original constexpr unsigned int bytesToSkip = 2u * sizeof(uint32_t); // skip header and packet length int diff = std::strncmp(data.data() + bytesToSkip, packetData, g_DataLength); - BOOST_CHECK(diff == 0); + CHECK(diff == 0); fs::remove(fileName); } -BOOST_AUTO_TEST_CASE(DumpOutgoingInvalidFile) +TEST_CASE("DumpOutgoingInvalidFile") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_IncomingCaptureFile = ""; options.m_OutgoingCaptureFile = "/"; ProfilingConnectionDumpToFileDecorator decorator(std::make_unique(), options, false); - BOOST_CHECK_THROW(decorator.WritePacket(g_DataPtr, g_DataLength), armnn::RuntimeException); + CHECK_THROWS_AS(decorator.WritePacket(g_DataPtr, g_DataLength), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(DumpOutgoingInvalidFileIgnoreErrors) +TEST_CASE("DumpOutgoingInvalidFileIgnoreErrors") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_IncomingCaptureFile = ""; options.m_OutgoingCaptureFile = "/"; ProfilingConnectionDumpToFileDecorator decorator(std::make_unique(), options, true); - BOOST_CHECK_NO_THROW(decorator.WritePacket(g_DataPtr, g_DataLength)); + CHECK_NOTHROW(decorator.WritePacket(g_DataPtr, g_DataLength)); bool success = decorator.WritePacket(g_DataPtr, g_DataLength); - BOOST_CHECK(!success); + CHECK(!success); } -BOOST_AUTO_TEST_CASE(DumpOutgoingValidFile) +TEST_CASE("DumpOutgoingValidFile") { fs::path fileName = armnnUtils::Filesystem::NamedTempFile("Armnn-DumpOutgoingValidFileTest-TempFile"); @@ -153,8 +153,8 @@ BOOST_AUTO_TEST_CASE(DumpOutgoingValidFile) ProfilingConnectionDumpToFileDecorator decorator(std::make_unique(), options, false); bool success = false; - BOOST_CHECK_NO_THROW(success = decorator.WritePacket(g_DataPtr, g_DataLength)); - BOOST_CHECK(success); + CHECK_NOTHROW(success = decorator.WritePacket(g_DataPtr, g_DataLength)); + CHECK(success); decorator.Close(); @@ -162,8 +162,8 @@ BOOST_AUTO_TEST_CASE(DumpOutgoingValidFile) // check if the data read back from the dump file matches the original int diff = std::strncmp(data.data(), g_Data.data(), g_DataLength); - BOOST_CHECK(diff == 0); + CHECK(diff == 0); fs::remove(fileName); } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/ProfilingGuidTest.cpp b/src/profiling/test/ProfilingGuidTest.cpp index d70e0d5547..07a0985591 100644 --- a/src/profiling/test/ProfilingGuidTest.cpp +++ b/src/profiling/test/ProfilingGuidTest.cpp @@ -8,75 +8,75 @@ #include #include -#include +#include #include #include using namespace armnn::profiling; -BOOST_AUTO_TEST_SUITE(ProfilingGuidTests) - -BOOST_AUTO_TEST_CASE(GuidTest) +TEST_SUITE("ProfilingGuidTests") +{ +TEST_CASE("GuidTest") { ProfilingGuid guid0(0); ProfilingGuid guid1(1); ProfilingGuid guid2(1); - BOOST_TEST(guid0 != guid1); - BOOST_TEST(guid1 == guid2); - BOOST_TEST(guid0 < guid1); - BOOST_TEST(guid0 <= guid1); - BOOST_TEST(guid1 <= guid2); - BOOST_TEST(guid1 > guid0); - BOOST_TEST(guid1 >= guid0); - BOOST_TEST(guid1 >= guid2); + CHECK(guid0 != guid1); + CHECK(guid1 == guid2); + CHECK(guid0 < guid1); + CHECK(guid0 <= guid1); + CHECK(guid1 <= guid2); + CHECK(guid1 > guid0); + CHECK(guid1 >= guid0); + CHECK(guid1 >= guid2); } -BOOST_AUTO_TEST_CASE(StaticGuidTest) +TEST_CASE("StaticGuidTest") { ProfilingStaticGuid guid0(0); ProfilingStaticGuid guid1(1); ProfilingStaticGuid guid2(1); - BOOST_TEST(guid0 != guid1); - BOOST_TEST(guid1 == guid2); - BOOST_TEST(guid0 < guid1); - BOOST_TEST(guid0 <= guid1); - BOOST_TEST(guid1 <= guid2); - BOOST_TEST(guid1 > guid0); - BOOST_TEST(guid1 >= guid0); - BOOST_TEST(guid1 >= guid2); + CHECK(guid0 != guid1); + CHECK(guid1 == guid2); + CHECK(guid0 < guid1); + CHECK(guid0 <= guid1); + CHECK(guid1 <= guid2); + CHECK(guid1 > guid0); + CHECK(guid1 >= guid0); + CHECK(guid1 >= guid2); } -BOOST_AUTO_TEST_CASE(DynamicGuidTest) +TEST_CASE("DynamicGuidTest") { ProfilingDynamicGuid guid0(0); ProfilingDynamicGuid guid1(1); ProfilingDynamicGuid guid2(1); - BOOST_TEST(guid0 != guid1); - BOOST_TEST(guid1 == guid2); - BOOST_TEST(guid0 < guid1); - BOOST_TEST(guid0 <= guid1); - BOOST_TEST(guid1 <= guid2); - BOOST_TEST(guid1 > guid0); - BOOST_TEST(guid1 >= guid0); - BOOST_TEST(guid1 >= guid2); + CHECK(guid0 != guid1); + CHECK(guid1 == guid2); + CHECK(guid0 < guid1); + CHECK(guid0 <= guid1); + CHECK(guid1 <= guid2); + CHECK(guid1 > guid0); + CHECK(guid1 >= guid0); + CHECK(guid1 >= guid2); } void CheckStaticGuid(uint64_t guid, uint64_t expectedGuid) { - BOOST_TEST(guid == expectedGuid); - BOOST_TEST(guid >= MIN_STATIC_GUID); + CHECK(guid == expectedGuid); + CHECK(guid >= MIN_STATIC_GUID); } void CheckDynamicGuid(uint64_t guid, uint64_t expectedGuid) { - BOOST_TEST(guid == expectedGuid); - BOOST_TEST(guid < MIN_STATIC_GUID); + CHECK(guid == expectedGuid); + CHECK(guid < MIN_STATIC_GUID); } -BOOST_AUTO_TEST_CASE(StaticGuidGeneratorCollisionTest) +TEST_CASE("StaticGuidGeneratorCollisionTest") { ProfilingGuidGenerator generator; std::set guids; @@ -93,11 +93,11 @@ BOOST_AUTO_TEST_CASE(StaticGuidGeneratorCollisionTest) // message rather than error in this case. if (guid == ProfilingGuid(armnn::profiling::MIN_STATIC_GUID)) { - BOOST_WARN("MIN_STATIC_GUID returned more than once from GenerateStaticId."); + WARN("MIN_STATIC_GUID returned more than once from GenerateStaticId."); } else { - BOOST_ERROR(fmt::format("GUID collision occurred: {} -> {}", str, guid)); + FAIL(fmt::format("GUID collision occurred: {} -> {}", str, guid)); } break; } @@ -105,24 +105,24 @@ BOOST_AUTO_TEST_CASE(StaticGuidGeneratorCollisionTest) } } -BOOST_AUTO_TEST_CASE(StaticGuidGeneratorTest) +TEST_CASE("StaticGuidGeneratorTest") { ProfilingGuidGenerator generator; ProfilingStaticGuid staticGuid0 = generator.GenerateStaticId("name"); CheckStaticGuid(staticGuid0, LabelsAndEventClasses::NAME_GUID); - BOOST_TEST(staticGuid0 != generator.GenerateStaticId("Name")); + CHECK(staticGuid0 != generator.GenerateStaticId("Name")); ProfilingStaticGuid staticGuid1 = generator.GenerateStaticId("type"); CheckStaticGuid(staticGuid1, LabelsAndEventClasses::TYPE_GUID); - BOOST_TEST(staticGuid1 != generator.GenerateStaticId("Type")); + CHECK(staticGuid1 != generator.GenerateStaticId("Type")); ProfilingStaticGuid staticGuid2 = generator.GenerateStaticId("index"); CheckStaticGuid(staticGuid2, LabelsAndEventClasses::INDEX_GUID); - BOOST_TEST(staticGuid2 != generator.GenerateStaticId("Index")); + CHECK(staticGuid2 != generator.GenerateStaticId("Index")); } -BOOST_AUTO_TEST_CASE(DynamicGuidGeneratorTest) +TEST_CASE("DynamicGuidGeneratorTest") { ProfilingGuidGenerator generator; @@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE(DynamicGuidGeneratorTest) } } -BOOST_AUTO_TEST_CASE (ProfilingGuidThreadTest) +TEST_CASE("ProfilingGuidThreadTest") { ProfilingGuidGenerator profilingGuidGenerator; @@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE (ProfilingGuidThreadTest) t3.join(); uint64_t guid = profilingGuidGenerator.NextGuid(); - BOOST_CHECK(guid == 3000u); + CHECK(guid == 3000u); } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp index faa86e55bf..0d8e9ef7bc 100644 --- a/src/profiling/test/ProfilingTestUtils.cpp +++ b/src/profiling/test/ProfilingTestUtils.cpp @@ -7,6 +7,7 @@ #include "ProfilingUtils.hpp" #include +#include #include #include @@ -16,7 +17,7 @@ #include -#include +#include uint32_t GetStreamMetaDataPacketSize() { @@ -84,16 +85,16 @@ void VerifyTimelineHeaderBinary(const unsigned char* readableData, uint32_t timelineBinaryPacketClass = (timelineBinaryPacketHeaderWord0 >> 19) & 0x0000007F; uint32_t timelineBinaryPacketType = (timelineBinaryPacketHeaderWord0 >> 16) & 0x00000007; uint32_t timelineBinaryPacketStreamId = (timelineBinaryPacketHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(timelineBinaryPacketFamily == 1); - BOOST_CHECK(timelineBinaryPacketClass == 0); - BOOST_CHECK(timelineBinaryPacketType == 1); - BOOST_CHECK(timelineBinaryPacketStreamId == 0); + CHECK(timelineBinaryPacketFamily == 1); + CHECK(timelineBinaryPacketClass == 0); + CHECK(timelineBinaryPacketType == 1); + CHECK(timelineBinaryPacketStreamId == 0); offset += uint32_t_size; uint32_t timelineBinaryPacketHeaderWord1 = ReadUint32(readableData, offset); uint32_t timelineBinaryPacketSequenceNumber = (timelineBinaryPacketHeaderWord1 >> 24) & 0x00000001; uint32_t timelineBinaryPacketDataLength = (timelineBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(timelineBinaryPacketSequenceNumber == 0); - BOOST_CHECK(timelineBinaryPacketDataLength == packetDataLength); + CHECK(timelineBinaryPacketSequenceNumber == 0); + CHECK(timelineBinaryPacketDataLength == packetDataLength); offset += uint32_t_size; } @@ -111,27 +112,27 @@ ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional guid, // Check the decl id uint32_t eventClassDeclId = ReadUint32(readableData, offset); - BOOST_CHECK(eventClassDeclId == 0); + CHECK(eventClassDeclId == 0); // Check the profiling GUID offset += uint32_t_size; uint64_t readProfilingGuid = ReadUint64(readableData, offset); if (guid.has_value()) { - BOOST_CHECK(readProfilingGuid == guid.value()); + CHECK(readProfilingGuid == guid.value()); } else { armnn::profiling::ProfilingService profilingService; - BOOST_CHECK(readProfilingGuid == profilingService.GetStaticId(label)); + CHECK(readProfilingGuid == profilingService.GetStaticId(label)); } // Check the SWTrace label offset += uint64_t_size; uint32_t swTraceLabelLength = ReadUint32(readableData, offset); - BOOST_CHECK(swTraceLabelLength == label_size + 1); // Label length including the null-terminator + CHECK(swTraceLabelLength == label_size + 1); // Label length including the null-terminator offset += uint32_t_size; - BOOST_CHECK(std::memcmp(readableData + offset, // Offset to the label in the buffer + CHECK(std::memcmp(readableData + offset, // Offset to the label in the buffer label.data(), // The original label swTraceLabelLength - 1) == 0); // The length of the label @@ -155,16 +156,16 @@ void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, // Check the decl id uint32_t eventClassDeclId = ReadUint32(readableData, offset); - BOOST_CHECK(eventClassDeclId == 2); + CHECK(eventClassDeclId == 2); // Check the profiling GUID offset += uint32_t_size; uint64_t readProfilingGuid = ReadUint64(readableData, offset); - BOOST_CHECK(readProfilingGuid == guid); + CHECK(readProfilingGuid == guid); offset += uint64_t_size; uint64_t readProfiilngNameGuid = ReadUint64(readableData, offset); - BOOST_CHECK(readProfiilngNameGuid == nameGuid); + CHECK(readProfiilngNameGuid == nameGuid); // Update the offset to allow parsing to be continued after this function returns offset += uint64_t_size; @@ -196,7 +197,7 @@ void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relati relationshipTypeUint = 3; break; default: - BOOST_ERROR("Unknown relationship type"); + FAIL("Unknown relationship type"); } // Utils @@ -205,23 +206,23 @@ void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relati // Check the decl id uint32_t eventClassDeclId = ReadUint32(readableData, offset); - BOOST_CHECK(eventClassDeclId == 3); + CHECK(eventClassDeclId == 3); // Check the relationship type offset += uint32_t_size; uint32_t readRelationshipTypeUint = ReadUint32(readableData, offset); - BOOST_CHECK(readRelationshipTypeUint == relationshipTypeUint); + CHECK(readRelationshipTypeUint == relationshipTypeUint); // Check the relationship GUID offset += uint32_t_size; uint64_t readRelationshipGuid = ReadUint64(readableData, offset); if (relationshipGuid.has_value()) { - BOOST_CHECK(readRelationshipGuid == relationshipGuid.value()); + CHECK(readRelationshipGuid == relationshipGuid.value()); } else { - BOOST_CHECK(readRelationshipGuid != ProfilingGuid(0)); + CHECK(readRelationshipGuid != ProfilingGuid(0)); } // Check the head GUID of the relationship @@ -229,11 +230,11 @@ void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relati uint64_t readHeadRelationshipGuid = ReadUint64(readableData, offset); if (headGuid.has_value()) { - BOOST_CHECK(readHeadRelationshipGuid == headGuid.value()); + CHECK(readHeadRelationshipGuid == headGuid.value()); } else { - BOOST_CHECK(readHeadRelationshipGuid != ProfilingGuid(0)); + CHECK(readHeadRelationshipGuid != ProfilingGuid(0)); } // Check the tail GUID of the relationship @@ -241,11 +242,11 @@ void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relati uint64_t readTailRelationshipGuid = ReadUint64(readableData, offset); if (tailGuid.has_value()) { - BOOST_CHECK(readTailRelationshipGuid == tailGuid.value()); + CHECK(readTailRelationshipGuid == tailGuid.value()); } else { - BOOST_CHECK(readTailRelationshipGuid != ProfilingGuid(0)); + CHECK(readTailRelationshipGuid != ProfilingGuid(0)); } // Check the attribute GUID of the relationship @@ -253,11 +254,11 @@ void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relati uint64_t readAttributeRelationshipGuid = ReadUint64(readableData, offset); if (attributeGuid.has_value()) { - BOOST_CHECK(readAttributeRelationshipGuid == attributeGuid.value()); + CHECK(readAttributeRelationshipGuid == attributeGuid.value()); } else { - BOOST_CHECK(readAttributeRelationshipGuid == ProfilingGuid(0)); + CHECK(readAttributeRelationshipGuid == ProfilingGuid(0)); } // Update the offset to allow parsing to be continued after this function returns @@ -277,7 +278,7 @@ ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional guid, // Reading TimelineEntityClassBinaryPacket // Check the decl_id uint32_t entityDeclId = ReadUint32(readableData, offset); - BOOST_CHECK(entityDeclId == 1); + CHECK(entityDeclId == 1); // Check the profiling GUID offset += uint32_t_size; @@ -285,11 +286,11 @@ ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional guid, if (guid.has_value()) { - BOOST_CHECK(readProfilingGuid == guid.value()); + CHECK(readProfilingGuid == guid.value()); } else { - BOOST_CHECK(readProfilingGuid != ProfilingGuid(0)); + CHECK(readProfilingGuid != ProfilingGuid(0)); } offset += uint64_t_size; @@ -313,18 +314,18 @@ ProfilingGuid VerifyTimelineEventBinaryPacket(Optional timestamp, // Reading TimelineEventBinaryPacket // Check the decl_id uint32_t entityDeclId = ReadUint32(readableData, offset); - BOOST_CHECK(entityDeclId == 4); + CHECK(entityDeclId == 4); // Check the timestamp offset += uint32_t_size; uint64_t readTimestamp = ReadUint64(readableData, offset); if (timestamp.has_value()) { - BOOST_CHECK(readTimestamp == timestamp.value()); + CHECK(readTimestamp == timestamp.value()); } else { - BOOST_CHECK(readTimestamp != 0); + CHECK(readTimestamp != 0); } // Check the thread id @@ -333,11 +334,11 @@ ProfilingGuid VerifyTimelineEventBinaryPacket(Optional timestamp, ReadBytes(readableData, offset, ThreadIdSize, readThreadId.data()); if (threadId.has_value()) { - BOOST_CHECK(readThreadId == threadId.value()); + CHECK(readThreadId == threadId.value()); } else { - BOOST_CHECK(readThreadId == armnnUtils::Threads::GetCurrentThreadId()); + CHECK(readThreadId == armnnUtils::Threads::GetCurrentThreadId()); } // Check the event GUID @@ -345,11 +346,11 @@ ProfilingGuid VerifyTimelineEventBinaryPacket(Optional timestamp, uint64_t readEventGuid = ReadUint64(readableData, offset); if (eventGuid.has_value()) { - BOOST_CHECK(readEventGuid == eventGuid.value()); + CHECK(readEventGuid == eventGuid.value()); } else { - BOOST_CHECK(readEventGuid != ProfilingGuid(0)); + CHECK(readEventGuid != ProfilingGuid(0)); } offset += uint64_t_size; @@ -436,28 +437,28 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) // Load it into the runtime. It should success. armnn::NetworkId netId; - BOOST_TEST(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); + CHECK(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); profiling::BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager(); auto readableBuffer = bufferManager.GetReadableBuffer(); // Profiling is enabled, the post-optimisation structure should be created - BOOST_CHECK(readableBuffer != nullptr); + CHECK(readableBuffer != nullptr); unsigned int size = readableBuffer->GetSize(); const unsigned char* readableData = readableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); unsigned int offset = 0; // Verify Header VerifyTimelineHeaderBinary(readableData, offset, size - 8); - BOOST_TEST_MESSAGE("HEADER OK"); + MESSAGE("HEADER OK"); // Post-optimisation network // Network entity VerifyTimelineEntityBinaryPacketData(optNetGuid, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK ENTITY OK"); + MESSAGE("NETWORK ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -467,7 +468,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK TYPE RELATIONSHIP OK"); + MESSAGE("NETWORK TYPE RELATIONSHIP OK"); // Network - START OF LIFE ProfilingGuid networkSolEventGuid = VerifyTimelineEventBinaryPacket(EmptyOptional(), @@ -475,7 +476,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("NETWORK START OF LIFE EVENT OK"); + MESSAGE("NETWORK START OF LIFE EVENT OK"); // Network - START OF LIFE event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -485,7 +486,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK START OF LIFE RELATIONSHIP OK"); + MESSAGE("NETWORK START OF LIFE RELATIONSHIP OK"); // Process ID Label int processID = armnnUtils::Processes::GetCurrentId(); @@ -493,7 +494,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) ss << processID; std::string processIdLabel = ss.str(); VerifyTimelineLabelBinaryPacketData(EmptyOptional(), processIdLabel, readableData, offset); - BOOST_TEST_MESSAGE("PROCESS ID LABEL OK"); + MESSAGE("PROCESS ID LABEL OK"); // Entity - Process ID relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -503,16 +504,16 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::PROCESS_ID_GUID, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK PROCESS ID RELATIONSHIP OK"); + MESSAGE("NETWORK PROCESS ID RELATIONSHIP OK"); // Input layer // Input layer entity VerifyTimelineEntityBinaryPacketData(input->GetGuid(), readableData, offset); - BOOST_TEST_MESSAGE("INPUT ENTITY OK"); + MESSAGE("INPUT ENTITY OK"); // Name Entity ProfilingGuid inputLabelGuid = VerifyTimelineLabelBinaryPacketData(EmptyOptional(), "input", readableData, offset); - BOOST_TEST_MESSAGE("INPUT NAME LABEL OK"); + MESSAGE("INPUT NAME LABEL OK"); // Entity - Name relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -522,7 +523,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::NAME_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT NAME RELATIONSHIP OK"); + MESSAGE("INPUT NAME RELATIONSHIP OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -532,7 +533,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT TYPE RELATIONSHIP OK"); + MESSAGE("INPUT TYPE RELATIONSHIP OK"); // Network - Input layer relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -542,7 +543,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK - INPUT CHILD RELATIONSHIP OK"); + MESSAGE("NETWORK - INPUT CHILD RELATIONSHIP OK"); // Conv2d layer // Conv2d layer entity @@ -551,7 +552,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) // Name entity ProfilingGuid conv2dNameLabelGuid = VerifyTimelineLabelBinaryPacketData( EmptyOptional(), "", readableData, offset); - BOOST_TEST_MESSAGE("CONV2D NAME LABEL OK"); + MESSAGE("CONV2D NAME LABEL OK"); // Entity - Name relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -561,7 +562,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::NAME_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D NAME RELATIONSHIP OK"); + MESSAGE("CONV2D NAME RELATIONSHIP OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -571,7 +572,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D TYPE RELATIONSHIP OK"); + MESSAGE("CONV2D TYPE RELATIONSHIP OK"); // Network - Conv2d layer relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -581,7 +582,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK - CONV2D CHILD RELATIONSHIP OK"); + MESSAGE("NETWORK - CONV2D CHILD RELATIONSHIP OK"); // Input layer - Conv2d layer relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -591,12 +592,12 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CONNECTION_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT - CONV2D LAYER CONNECTION OK"); + MESSAGE("INPUT - CONV2D LAYER CONNECTION OK"); // Conv2d workload // Conv2d workload entity ProfilingGuid conv2DWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD ENTITY OK"); + MESSAGE("CONV2D WORKLOAD ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -606,7 +607,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD TYPE RELATIONSHIP OK"); + MESSAGE("CONV2D WORKLOAD TYPE RELATIONSHIP OK"); // BackendId entity ProfilingGuid backendIdLabelGuid = VerifyTimelineLabelBinaryPacketData( @@ -620,7 +621,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::BACKENDID_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD BACKEND ID RELATIONSHIP OK"); + MESSAGE("CONV2D WORKLOAD BACKEND ID RELATIONSHIP OK"); // Conv2d layer - Conv2d workload relationship @@ -631,17 +632,17 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D LAYER - WORKLOAD CHILD RELATIONSHIP OK"); + MESSAGE("CONV2D LAYER - WORKLOAD CHILD RELATIONSHIP OK"); // Abs layer // Abs layer entity VerifyTimelineEntityBinaryPacketData(abs->GetGuid(), readableData, offset); - BOOST_TEST_MESSAGE("ABS ENTITY OK"); + MESSAGE("ABS ENTITY OK"); // Name entity ProfilingGuid absLabelGuid = VerifyTimelineLabelBinaryPacketData( EmptyOptional(), "abs", readableData, offset); - BOOST_TEST_MESSAGE("ABS NAME LABEL OK"); + MESSAGE("ABS NAME LABEL OK"); // Entity - Name relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -651,7 +652,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::NAME_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS LAYER - NAME RELATIONSHIP OK"); + MESSAGE("ABS LAYER - NAME RELATIONSHIP OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -661,7 +662,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS LAYER TYPE RELATIONSHIP OK"); + MESSAGE("ABS LAYER TYPE RELATIONSHIP OK"); // Network - Abs layer relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -671,7 +672,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK - ABS LAYER CHILD RELATIONSHIP OK"); + MESSAGE("NETWORK - ABS LAYER CHILD RELATIONSHIP OK"); // Conv2d layer - Abs layer relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -681,12 +682,12 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CONNECTION_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D LAYER - ABS LAYER CONNECTION OK"); + MESSAGE("CONV2D LAYER - ABS LAYER CONNECTION OK"); // Abs workload // Abs workload entity ProfilingGuid absWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD ENTITY OK"); + MESSAGE("ABS WORKLOAD ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -696,11 +697,11 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLAD TYPE RELATIONSHIP OK"); + MESSAGE("ABS WORKLAD TYPE RELATIONSHIP OK"); // BackendId entity VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset); - BOOST_TEST_MESSAGE("BACKEND ID LABEL OK"); + MESSAGE("BACKEND ID LABEL OK"); // Entity - BackendId relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -710,7 +711,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::BACKENDID_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD BACKEND ID RELATIONSHIP OK"); + MESSAGE("ABS WORKLOAD BACKEND ID RELATIONSHIP OK"); // Abs layer - Abs workload relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -720,12 +721,12 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS LAYER - WORKLOAD CHILD RELATIONSHIP OK"); + MESSAGE("ABS LAYER - WORKLOAD CHILD RELATIONSHIP OK"); // Output layer // Output layer entity VerifyTimelineEntityBinaryPacketData(output->GetGuid(), readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT LAYER ENTITY OK"); + MESSAGE("OUTPUT LAYER ENTITY OK"); // Name entity ProfilingGuid outputLabelGuid = VerifyTimelineLabelBinaryPacketData( @@ -739,7 +740,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::NAME_GUID, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT LAYER NAME RELATIONSHIP OK"); + MESSAGE("OUTPUT LAYER NAME RELATIONSHIP OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -749,7 +750,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT LAYER TYPE RELATIONSHIP OK"); + MESSAGE("OUTPUT LAYER TYPE RELATIONSHIP OK"); // Network - Output layer relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -759,7 +760,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK - OUTPUT LAYER CHILD RELATIONSHIP OK"); + MESSAGE("NETWORK - OUTPUT LAYER CHILD RELATIONSHIP OK"); // Abs layer - Output layer relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -769,7 +770,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CONNECTION_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS LAYER - OUTPUT LAYER CONNECTION OK"); + MESSAGE("ABS LAYER - OUTPUT LAYER CONNECTION OK"); bufferManager.MarkRead(readableBuffer); @@ -791,33 +792,33 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) // Get readable buffer for input workload auto inputReadableBuffer = bufferManager.GetReadableBuffer(); - BOOST_CHECK(inputReadableBuffer != nullptr); + CHECK(inputReadableBuffer != nullptr); // Get readable buffer for output workload auto outputReadableBuffer = bufferManager.GetReadableBuffer(); - BOOST_CHECK(outputReadableBuffer != nullptr); + CHECK(outputReadableBuffer != nullptr); // Get readable buffer for inference timeline auto inferenceReadableBuffer = bufferManager.GetReadableBuffer(); - BOOST_CHECK(inferenceReadableBuffer != nullptr); + CHECK(inferenceReadableBuffer != nullptr); // Validate input workload data size = inputReadableBuffer->GetSize(); - BOOST_CHECK(size == 164); + CHECK(size == 164); readableData = inputReadableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); offset = 0; // Verify Header VerifyTimelineHeaderBinary(readableData, offset, 156); - BOOST_TEST_MESSAGE("INPUT WORKLOAD HEADER OK"); + MESSAGE("INPUT WORKLOAD HEADER OK"); // Input workload // Input workload entity ProfilingGuid inputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -827,7 +828,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK"); // BackendId entity VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset); @@ -840,7 +841,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::BACKENDID_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD BACKEND ID RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD BACKEND ID RELATIONSHIP OK"); // Input layer - Input workload relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -850,27 +851,27 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT LAYER - INPUT WORKLOAD CHILD RELATIONSHIP OK"); + MESSAGE("INPUT LAYER - INPUT WORKLOAD CHILD RELATIONSHIP OK"); bufferManager.MarkRead(inputReadableBuffer); // Validate output workload data size = outputReadableBuffer->GetSize(); - BOOST_CHECK(size == 164); + CHECK(size == 164); readableData = outputReadableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); offset = 0; // Verify Header VerifyTimelineHeaderBinary(readableData, offset, 156); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD HEADER OK"); + MESSAGE("OUTPUT WORKLOAD HEADER OK"); // Output workload // Output workload entity ProfilingGuid outputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD ENTITY OK"); + MESSAGE("OUTPUT WORKLOAD ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -880,11 +881,11 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD TYPE RELATIONSHIP OK"); + MESSAGE("OUTPUT WORKLOAD TYPE RELATIONSHIP OK"); // BackendId entity VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD LABEL OK"); + MESSAGE("OUTPUT WORKLOAD LABEL OK"); // Entity - BackendId relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -894,7 +895,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::BACKENDID_GUID, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD BACKEND ID RELATIONSHIP OK"); + MESSAGE("OUTPUT WORKLOAD BACKEND ID RELATIONSHIP OK"); // Output layer - Output workload relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -904,28 +905,28 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT LAYER - OUTPUT WORKLOAD CHILD RELATIONSHIP OK"); + MESSAGE("OUTPUT LAYER - OUTPUT WORKLOAD CHILD RELATIONSHIP OK"); bufferManager.MarkRead(outputReadableBuffer); // Validate inference data size = inferenceReadableBuffer->GetSize(); - BOOST_CHECK(size == 1228 + 10 * ThreadIdSize); + CHECK(size == 1228 + 10 * ThreadIdSize); readableData = inferenceReadableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); offset = 0; // Verify Header VerifyTimelineHeaderBinary(readableData, offset, 1220 + 10 * ThreadIdSize); - BOOST_TEST_MESSAGE("INFERENCE HEADER OK"); + MESSAGE("INFERENCE HEADER OK"); // Inference timeline trace // Inference entity ProfilingGuid inferenceGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE ENTITY OK"); + MESSAGE("INFERENCE ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -935,7 +936,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE TYPE RELATIONSHIP OK"); + MESSAGE("INFERENCE TYPE RELATIONSHIP OK"); // Network - Inference relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -945,13 +946,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::EXECUTION_OF_GUID, readableData, offset); - BOOST_TEST_MESSAGE("NETWORK - INFERENCE EXECUTION_OF RELATIONSHIP OK"); + MESSAGE("NETWORK - INFERENCE EXECUTION_OF RELATIONSHIP OK"); // Start Inference life // Event packet - timeline, threadId, eventGuid ProfilingGuid inferenceEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE START OF LIFE EVENT OK"); + MESSAGE("INFERENCE START OF LIFE EVENT OK"); // Inference - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -961,14 +962,14 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE START OF LIFE RELATIONSHIP OK"); + MESSAGE("INFERENCE START OF LIFE RELATIONSHIP OK"); // Execution // Input workload execution // Input workload execution entity ProfilingGuid inputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION ENTITY OK"); + MESSAGE("INPUT WORKLOAD EXECUTION ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -978,7 +979,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); // Inference - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -988,7 +989,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK"); // Workload - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -998,13 +999,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::EXECUTION_OF_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK"); // Start Input workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid inputWorkloadExecutionSOLEventId = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT OK"); + MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT OK"); // Input workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1014,13 +1015,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK"); // End of Input workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid inputWorkloadExecutionEOLEventId = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT OK"); + MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT OK"); // Input workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1030,13 +1031,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK"); + MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK"); // Conv2d workload execution // Conv2d workload execution entity ProfilingGuid conv2DWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION ENTITY OK"); + MESSAGE("CONV2D WORKLOAD EXECUTION ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -1046,7 +1047,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); + MESSAGE("CONV2D WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); // Inference - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -1056,7 +1057,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE - CONV2D WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); + MESSAGE("INFERENCE - CONV2D WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); // Workload - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -1066,13 +1067,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::EXECUTION_OF_GUID, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD - CONV2D WORKLOAD EXECUTION RELATIONSHIP OK"); + MESSAGE("CONV2D WORKLOAD - CONV2D WORKLOAD EXECUTION RELATIONSHIP OK"); // Start Conv2d workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid conv2DWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE EVENT OK"); + MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE EVENT OK"); // Conv2d workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1082,13 +1083,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK"); + MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK"); // End of Conv2d workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid conv2DWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE EVENT OK"); + MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE EVENT OK"); // Conv2d workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1098,13 +1099,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK"); + MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK"); // Abs workload execution // Abs workload execution entity ProfilingGuid absWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD EXECUTION ENTITY OK"); + MESSAGE("ABS WORKLOAD EXECUTION ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -1114,7 +1115,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); + MESSAGE("ABS WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); // Inference - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -1124,7 +1125,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE - ABS WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); + MESSAGE("INFERENCE - ABS WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); // Workload - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -1134,13 +1135,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::EXECUTION_OF_GUID, readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD - ABS WORKLOAD EXECUTION RELATIONSHIP OK"); + MESSAGE("ABS WORKLOAD - ABS WORKLOAD EXECUTION RELATIONSHIP OK"); // Start Abs workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid absWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD EXECUTION START OF LIFE EVENT OK"); + MESSAGE("ABS WORKLOAD EXECUTION START OF LIFE EVENT OK"); // Abs workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1150,13 +1151,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK"); + MESSAGE("ABS WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK"); // End of Abs workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid absWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD EXECUTION END OF LIFE EVENT OK"); + MESSAGE("ABS WORKLOAD EXECUTION END OF LIFE EVENT OK"); // Abs workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1166,13 +1167,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("ABS WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK"); + MESSAGE("ABS WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK"); // Output workload execution // Output workload execution entity ProfilingGuid outputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION ENTITY OK"); + MESSAGE("OUTPUT WORKLOAD EXECUTION ENTITY OK"); // Entity - Type relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, @@ -1182,7 +1183,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::TYPE_GUID, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); + MESSAGE("OUTPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); // Inference - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -1192,7 +1193,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::CHILD_GUID, readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE - OUTPUT WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); + MESSAGE("INFERENCE - OUTPUT WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); // Workload - Workload execution relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, @@ -1202,13 +1203,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::EXECUTION_OF_GUID, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD - OUTPUT WORKLOAD EXECUTION EXECUTION_OF RELATIONSHIP OK"); + MESSAGE("OUTPUT WORKLOAD - OUTPUT WORKLOAD EXECUTION EXECUTION_OF RELATIONSHIP OK"); // Start Output workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid outputWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION START OF LIFE EVENT OK"); + MESSAGE("OUTPUT WORKLOAD EXECUTION START OF LIFE EVENT OK"); // Output workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1218,13 +1219,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK"); + MESSAGE("OUTPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK"); // End of Normalize workload execution life // Event packet - timeline, threadId, eventGuid ProfilingGuid outputWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION END OF LIFE EVENT OK"); + MESSAGE("OUTPUT WORKLOAD EXECUTION END OF LIFE EVENT OK"); // Output workload execution - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1234,13 +1235,13 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK"); + MESSAGE("OUTPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK"); // End of Inference life // Event packet - timeline, threadId, eventGuid ProfilingGuid inferenceEOLEventGuid = VerifyTimelineEventBinaryPacket( EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE END OF LIFE EVENT OK"); + MESSAGE("INFERENCE END OF LIFE EVENT OK"); // Inference - event relationship VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, @@ -1250,7 +1251,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, readableData, offset); - BOOST_TEST_MESSAGE("INFERENCE - END OF LIFE EVENT RELATIONSHIP OK"); + MESSAGE("INFERENCE - END OF LIFE EVENT RELATIONSHIP OK"); bufferManager.MarkRead(inferenceReadableBuffer); } diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index a4a25a84ad..e0629b3913 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -40,6 +40,8 @@ #include #include +#include + #include #include #include @@ -51,9 +53,9 @@ using namespace armnn::profiling; using PacketType = MockProfilingConnection::PacketType; -BOOST_AUTO_TEST_SUITE(ExternalProfiling) - -BOOST_AUTO_TEST_CASE(CheckCommandHandlerKeyComparisons) +TEST_SUITE("ExternalProfiling") +{ +TEST_CASE("CheckCommandHandlerKeyComparisons") { arm::pipe::CommandHandlerKey testKey1_0(1, 1, 1); arm::pipe::CommandHandlerKey testKey1_1(1, 1, 1); @@ -66,28 +68,28 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandlerKeyComparisons) arm::pipe::CommandHandlerKey testKey4(0, 2, 2); arm::pipe::CommandHandlerKey testKey5(0, 0, 2); - BOOST_CHECK(testKey1_0 > testKey0); - BOOST_CHECK(testKey1_0 == testKey1_1); - BOOST_CHECK(testKey1_0 < testKey1_2); + CHECK(testKey1_0 > testKey0); + CHECK(testKey1_0 == testKey1_1); + CHECK(testKey1_0 < testKey1_2); - BOOST_CHECK(testKey1 < testKey4); - BOOST_CHECK(testKey1 > testKey3); - BOOST_CHECK(testKey1 <= testKey4); - BOOST_CHECK(testKey1 >= testKey3); - BOOST_CHECK(testKey1 <= testKey2); - BOOST_CHECK(testKey1 >= testKey2); - BOOST_CHECK(testKey1 == testKey2); - BOOST_CHECK(testKey1 == testKey1); + CHECK(testKey1 < testKey4); + CHECK(testKey1 > testKey3); + CHECK(testKey1 <= testKey4); + CHECK(testKey1 >= testKey3); + CHECK(testKey1 <= testKey2); + CHECK(testKey1 >= testKey2); + CHECK(testKey1 == testKey2); + CHECK(testKey1 == testKey1); - BOOST_CHECK(!(testKey1 == testKey5)); - BOOST_CHECK(!(testKey1 != testKey1)); - BOOST_CHECK(testKey1 != testKey5); + CHECK(!(testKey1 == testKey5)); + CHECK(!(testKey1 != testKey1)); + CHECK(testKey1 != testKey5); - BOOST_CHECK(testKey1 == testKey2 && testKey2 == testKey1); - BOOST_CHECK(testKey0 == testKey1 && testKey1 == testKey2 && testKey0 == testKey2); + CHECK((testKey1 == testKey2 && testKey2 == testKey1)); + CHECK((testKey0 == testKey1 && testKey1 == testKey2 && testKey0 == testKey2)); - BOOST_CHECK(testKey1.GetPacketId() == 1); - BOOST_CHECK(testKey1.GetVersion() == 1); + CHECK(testKey1.GetPacketId() == 1); + CHECK(testKey1.GetVersion() == 1); std::vector vect = { arm::pipe::CommandHandlerKey(0, 0, 1), arm::pipe::CommandHandlerKey(0, 2, 0), @@ -103,10 +105,10 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandlerKeyComparisons) arm::pipe::CommandHandlerKey(0, 1, 1), arm::pipe::CommandHandlerKey(0, 2, 0), arm::pipe::CommandHandlerKey(0, 2, 0), arm::pipe::CommandHandlerKey(0, 2, 1) }; - BOOST_CHECK(vect == expectedVect); + CHECK(vect == expectedVect); } -BOOST_AUTO_TEST_CASE(CheckPacketKeyComparisons) +TEST_CASE("CheckPacketKeyComparisons") { arm::pipe::PacketKey key0(0, 0); arm::pipe::PacketKey key1(0, 0); @@ -116,22 +118,22 @@ BOOST_AUTO_TEST_CASE(CheckPacketKeyComparisons) arm::pipe::PacketKey key5(1, 0); arm::pipe::PacketKey key6(1, 1); - BOOST_CHECK(!(key0 < key1)); - BOOST_CHECK(!(key0 > key1)); - BOOST_CHECK(key0 <= key1); - BOOST_CHECK(key0 >= key1); - BOOST_CHECK(key0 == key1); - BOOST_CHECK(key0 < key2); - BOOST_CHECK(key2 < key3); - BOOST_CHECK(key3 > key0); - BOOST_CHECK(key4 == key5); - BOOST_CHECK(key4 > key0); - BOOST_CHECK(key5 < key6); - BOOST_CHECK(key5 <= key6); - BOOST_CHECK(key5 != key6); + CHECK(!(key0 < key1)); + CHECK(!(key0 > key1)); + CHECK(key0 <= key1); + CHECK(key0 >= key1); + CHECK(key0 == key1); + CHECK(key0 < key2); + CHECK(key2 < key3); + CHECK(key3 > key0); + CHECK(key4 == key5); + CHECK(key4 > key0); + CHECK(key5 < key6); + CHECK(key5 <= key6); + CHECK(key5 != key6); } -BOOST_AUTO_TEST_CASE(CheckCommandHandler) +TEST_CASE("CheckCommandHandler") { arm::pipe::PacketVersionResolver packetVersionResolver; ProfilingStateMachine profilingStateMachine; @@ -175,7 +177,7 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandler) std::this_thread::sleep_for(std::chrono::milliseconds(2)); } - BOOST_CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::Active); + CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::Active); // Close the thread again. commandHandler0.Stop(); @@ -206,7 +208,7 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandler) { if (timeSlept >= timeout) { - BOOST_FAIL("Timeout: The command handler loop did not stop after the timeout"); + FAIL("Timeout: The command handler loop did not stop after the timeout"); } std::this_thread::sleep_for(std::chrono::milliseconds(1)); timeSlept ++; @@ -214,14 +216,14 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandler) commandHandler1.Stop(); // The state machine should never have received the ack so will still be in WaitingForAck. - BOOST_CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck); // Now try sending a bad connection acknowledged packet TestProfilingConnectionBadAckPacket testProfilingConnectionBadAckPacket; commandHandler1.Start(testProfilingConnectionBadAckPacket); commandHandler1.Stop(); // This should also not change the state machine - BOOST_CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck); // Disable stop after timeout and now commandHandler1 should persist after a timeout commandHandler1.SetStopAfterTimeout(false); @@ -240,7 +242,7 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandler) commandHandler1.Stop(); // Even after the 3 exceptions the ack packet should have transitioned the command handler to active. - BOOST_CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::Active); + CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::Active); // A command handler that gets exceptions other than timeouts should keep going. CommandHandler commandHandler2(1, false, commandHandlerRegistry, packetVersionResolver); @@ -257,41 +259,41 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandler) std::this_thread::sleep_for(std::chrono::milliseconds(2)); } - BOOST_CHECK(commandHandler2.IsRunning()); + CHECK(commandHandler2.IsRunning()); commandHandler2.Stop(); } -BOOST_AUTO_TEST_CASE(CheckEncodeVersion) +TEST_CASE("CheckEncodeVersion") { arm::pipe::Version version1(12); - BOOST_CHECK(version1.GetMajor() == 0); - BOOST_CHECK(version1.GetMinor() == 0); - BOOST_CHECK(version1.GetPatch() == 12); + CHECK(version1.GetMajor() == 0); + CHECK(version1.GetMinor() == 0); + CHECK(version1.GetPatch() == 12); arm::pipe::Version version2(4108); - BOOST_CHECK(version2.GetMajor() == 0); - BOOST_CHECK(version2.GetMinor() == 1); - BOOST_CHECK(version2.GetPatch() == 12); + CHECK(version2.GetMajor() == 0); + CHECK(version2.GetMinor() == 1); + CHECK(version2.GetPatch() == 12); arm::pipe::Version version3(4198412); - BOOST_CHECK(version3.GetMajor() == 1); - BOOST_CHECK(version3.GetMinor() == 1); - BOOST_CHECK(version3.GetPatch() == 12); + CHECK(version3.GetMajor() == 1); + CHECK(version3.GetMinor() == 1); + CHECK(version3.GetPatch() == 12); arm::pipe::Version version4(0); - BOOST_CHECK(version4.GetMajor() == 0); - BOOST_CHECK(version4.GetMinor() == 0); - BOOST_CHECK(version4.GetPatch() == 0); + CHECK(version4.GetMajor() == 0); + CHECK(version4.GetMinor() == 0); + CHECK(version4.GetPatch() == 0); arm::pipe::Version version5(1, 0, 0); - BOOST_CHECK(version5.GetEncodedValue() == 4194304); + CHECK(version5.GetEncodedValue() == 4194304); } -BOOST_AUTO_TEST_CASE(CheckPacketClass) +TEST_CASE("CheckPacketClass") { uint32_t length = 4; std::unique_ptr packetData0 = std::make_unique(length); @@ -300,35 +302,35 @@ BOOST_AUTO_TEST_CASE(CheckPacketClass) arm::pipe::Packet packetTest0(472580096, length, packetData0); - BOOST_CHECK(packetTest0.GetHeader() == 472580096); - BOOST_CHECK(packetTest0.GetPacketFamily() == 7); - BOOST_CHECK(packetTest0.GetPacketId() == 43); - BOOST_CHECK(packetTest0.GetLength() == length); - BOOST_CHECK(packetTest0.GetPacketType() == 3); - BOOST_CHECK(packetTest0.GetPacketClass() == 5); + CHECK(packetTest0.GetHeader() == 472580096); + CHECK(packetTest0.GetPacketFamily() == 7); + CHECK(packetTest0.GetPacketId() == 43); + CHECK(packetTest0.GetLength() == length); + CHECK(packetTest0.GetPacketType() == 3); + CHECK(packetTest0.GetPacketClass() == 5); - BOOST_CHECK_THROW(arm::pipe::Packet packetTest1(472580096, 0, packetData1), arm::pipe::InvalidArgumentException); - BOOST_CHECK_NO_THROW(arm::pipe::Packet packetTest2(472580096, 0, nullPacketData)); + CHECK_THROWS_AS(arm::pipe::Packet packetTest1(472580096, 0, packetData1), arm::pipe::InvalidArgumentException); + CHECK_NOTHROW(arm::pipe::Packet packetTest2(472580096, 0, nullPacketData)); arm::pipe::Packet packetTest3(472580096, 0, nullPacketData); - BOOST_CHECK(packetTest3.GetLength() == 0); - BOOST_CHECK(packetTest3.GetData() == nullptr); + CHECK(packetTest3.GetLength() == 0); + CHECK(packetTest3.GetData() == nullptr); const unsigned char* packetTest0Data = packetTest0.GetData(); arm::pipe::Packet packetTest4(std::move(packetTest0)); - BOOST_CHECK(packetTest0.GetData() == nullptr); - BOOST_CHECK(packetTest4.GetData() == packetTest0Data); + CHECK(packetTest0.GetData() == nullptr); + CHECK(packetTest4.GetData() == packetTest0Data); - BOOST_CHECK(packetTest4.GetHeader() == 472580096); - BOOST_CHECK(packetTest4.GetPacketFamily() == 7); - BOOST_CHECK(packetTest4.GetPacketId() == 43); - BOOST_CHECK(packetTest4.GetLength() == length); - BOOST_CHECK(packetTest4.GetPacketType() == 3); - BOOST_CHECK(packetTest4.GetPacketClass() == 5); + CHECK(packetTest4.GetHeader() == 472580096); + CHECK(packetTest4.GetPacketFamily() == 7); + CHECK(packetTest4.GetPacketId() == 43); + CHECK(packetTest4.GetLength() == length); + CHECK(packetTest4.GetPacketType() == 3); + CHECK(packetTest4.GetPacketClass() == 5); } -BOOST_AUTO_TEST_CASE(CheckCommandHandlerFunctor) +TEST_CASE("CheckCommandHandlerFunctor") { // Hard code the version as it will be the same during a single profiling session uint32_t version = 1; @@ -353,11 +355,11 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandlerFunctor) // Check the order of the map is correct auto it = registry.begin(); - BOOST_CHECK(it->first == keyC); // familyId == 5 + CHECK(it->first == keyC); // familyId == 5 it++; - BOOST_CHECK(it->first == keyA); // familyId == 7 + CHECK(it->first == keyA); // familyId == 7 it++; - BOOST_CHECK(it->first == keyB); // familyId == 8 + CHECK(it->first == keyB); // familyId == 8 std::unique_ptr packetDataA; std::unique_ptr packetDataB; @@ -370,24 +372,24 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandlerFunctor) // Check the correct operator of derived class is called registry.at(arm::pipe::CommandHandlerKey( packetA.GetPacketFamily(), packetA.GetPacketId(), version))->operator()(packetA); - BOOST_CHECK(testFunctorA.GetCount() == 1); - BOOST_CHECK(testFunctorB.GetCount() == 0); - BOOST_CHECK(testFunctorC.GetCount() == 0); + CHECK(testFunctorA.GetCount() == 1); + CHECK(testFunctorB.GetCount() == 0); + CHECK(testFunctorC.GetCount() == 0); registry.at(arm::pipe::CommandHandlerKey( packetB.GetPacketFamily(), packetB.GetPacketId(), version))->operator()(packetB); - BOOST_CHECK(testFunctorA.GetCount() == 1); - BOOST_CHECK(testFunctorB.GetCount() == 1); - BOOST_CHECK(testFunctorC.GetCount() == 0); + CHECK(testFunctorA.GetCount() == 1); + CHECK(testFunctorB.GetCount() == 1); + CHECK(testFunctorC.GetCount() == 0); registry.at(arm::pipe::CommandHandlerKey( packetC.GetPacketFamily(), packetC.GetPacketId(), version))->operator()(packetC); - BOOST_CHECK(testFunctorA.GetCount() == 1); - BOOST_CHECK(testFunctorB.GetCount() == 1); - BOOST_CHECK(testFunctorC.GetCount() == 1); + CHECK(testFunctorA.GetCount() == 1); + CHECK(testFunctorB.GetCount() == 1); + CHECK(testFunctorC.GetCount() == 1); } -BOOST_AUTO_TEST_CASE(CheckCommandHandlerRegistry) +TEST_CASE("CheckCommandHandlerRegistry") { // Hard code the version as it will be the same during a single profiling session uint32_t version = 1; @@ -414,32 +416,32 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandlerRegistry) // Check the correct operator of derived class is called registry.GetFunctor(packetA.GetPacketFamily(), packetA.GetPacketId(), version)->operator()(packetA); - BOOST_CHECK(testFunctorA.GetCount() == 1); - BOOST_CHECK(testFunctorB.GetCount() == 0); - BOOST_CHECK(testFunctorC.GetCount() == 0); + CHECK(testFunctorA.GetCount() == 1); + CHECK(testFunctorB.GetCount() == 0); + CHECK(testFunctorC.GetCount() == 0); registry.GetFunctor(packetB.GetPacketFamily(), packetB.GetPacketId(), version)->operator()(packetB); - BOOST_CHECK(testFunctorA.GetCount() == 1); - BOOST_CHECK(testFunctorB.GetCount() == 1); - BOOST_CHECK(testFunctorC.GetCount() == 0); + CHECK(testFunctorA.GetCount() == 1); + CHECK(testFunctorB.GetCount() == 1); + CHECK(testFunctorC.GetCount() == 0); registry.GetFunctor(packetC.GetPacketFamily(), packetC.GetPacketId(), version)->operator()(packetC); - BOOST_CHECK(testFunctorA.GetCount() == 1); - BOOST_CHECK(testFunctorB.GetCount() == 1); - BOOST_CHECK(testFunctorC.GetCount() == 1); + CHECK(testFunctorA.GetCount() == 1); + CHECK(testFunctorB.GetCount() == 1); + CHECK(testFunctorC.GetCount() == 1); // Re-register an existing key with a new function registry.RegisterFunctor(&testFunctorC, testFunctorA.GetFamilyId(), testFunctorA.GetPacketId(), version); registry.GetFunctor(packetA.GetPacketFamily(), packetA.GetPacketId(), version)->operator()(packetC); - BOOST_CHECK(testFunctorA.GetCount() == 1); - BOOST_CHECK(testFunctorB.GetCount() == 1); - BOOST_CHECK(testFunctorC.GetCount() == 2); + CHECK(testFunctorA.GetCount() == 1); + CHECK(testFunctorB.GetCount() == 1); + CHECK(testFunctorC.GetCount() == 2); // Check that non-existent key returns nullptr for its functor - BOOST_CHECK_THROW(registry.GetFunctor(0, 0, 0), arm::pipe::ProfilingException); + CHECK_THROWS_AS(registry.GetFunctor(0, 0, 0), arm::pipe::ProfilingException); } -BOOST_AUTO_TEST_CASE(CheckPacketVersionResolver) +TEST_CASE("CheckPacketVersionResolver") { // Set up random number generator for generating packetId values std::random_device device; @@ -460,7 +462,7 @@ BOOST_AUTO_TEST_CASE(CheckPacketVersionResolver) const uint32_t packetId = distribution(generator); arm::pipe::Version resolvedVersion = packetVersionResolver.ResolvePacketVersion(familyId, packetId); - BOOST_TEST(resolvedVersion == expectedVersion); + CHECK(resolvedVersion == expectedVersion); } } @@ -471,64 +473,64 @@ void ProfilingCurrentStateThreadImpl(ProfilingStateMachine& states) states.TransitionToState(newState); } -BOOST_AUTO_TEST_CASE(CheckProfilingStateMachine) +TEST_CASE("CheckProfilingStateMachine") { ProfilingStateMachine profilingState1(ProfilingState::Uninitialised); profilingState1.TransitionToState(ProfilingState::Uninitialised); - BOOST_CHECK(profilingState1.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingState1.GetCurrentState() == ProfilingState::Uninitialised); ProfilingStateMachine profilingState2(ProfilingState::Uninitialised); profilingState2.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK(profilingState2.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingState2.GetCurrentState() == ProfilingState::NotConnected); ProfilingStateMachine profilingState3(ProfilingState::NotConnected); profilingState3.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK(profilingState3.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingState3.GetCurrentState() == ProfilingState::NotConnected); ProfilingStateMachine profilingState4(ProfilingState::NotConnected); profilingState4.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK(profilingState4.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingState4.GetCurrentState() == ProfilingState::WaitingForAck); ProfilingStateMachine profilingState5(ProfilingState::WaitingForAck); profilingState5.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK(profilingState5.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingState5.GetCurrentState() == ProfilingState::WaitingForAck); ProfilingStateMachine profilingState6(ProfilingState::WaitingForAck); profilingState6.TransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingState6.GetCurrentState() == ProfilingState::Active); + CHECK(profilingState6.GetCurrentState() == ProfilingState::Active); ProfilingStateMachine profilingState7(ProfilingState::Active); profilingState7.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK(profilingState7.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingState7.GetCurrentState() == ProfilingState::NotConnected); ProfilingStateMachine profilingState8(ProfilingState::Active); profilingState8.TransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingState8.GetCurrentState() == ProfilingState::Active); + CHECK(profilingState8.GetCurrentState() == ProfilingState::Active); ProfilingStateMachine profilingState9(ProfilingState::Uninitialised); - BOOST_CHECK_THROW(profilingState9.TransitionToState(ProfilingState::WaitingForAck), armnn::Exception); + CHECK_THROWS_AS(profilingState9.TransitionToState(ProfilingState::WaitingForAck), armnn::Exception); ProfilingStateMachine profilingState10(ProfilingState::Uninitialised); - BOOST_CHECK_THROW(profilingState10.TransitionToState(ProfilingState::Active), armnn::Exception); + CHECK_THROWS_AS(profilingState10.TransitionToState(ProfilingState::Active), armnn::Exception); ProfilingStateMachine profilingState11(ProfilingState::NotConnected); - BOOST_CHECK_THROW(profilingState11.TransitionToState(ProfilingState::Uninitialised), armnn::Exception); + CHECK_THROWS_AS(profilingState11.TransitionToState(ProfilingState::Uninitialised), armnn::Exception); ProfilingStateMachine profilingState12(ProfilingState::NotConnected); - BOOST_CHECK_THROW(profilingState12.TransitionToState(ProfilingState::Active), armnn::Exception); + CHECK_THROWS_AS(profilingState12.TransitionToState(ProfilingState::Active), armnn::Exception); ProfilingStateMachine profilingState13(ProfilingState::WaitingForAck); - BOOST_CHECK_THROW(profilingState13.TransitionToState(ProfilingState::Uninitialised), armnn::Exception); + CHECK_THROWS_AS(profilingState13.TransitionToState(ProfilingState::Uninitialised), armnn::Exception); ProfilingStateMachine profilingState14(ProfilingState::WaitingForAck); profilingState14.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK(profilingState14.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingState14.GetCurrentState() == ProfilingState::NotConnected); ProfilingStateMachine profilingState15(ProfilingState::Active); - BOOST_CHECK_THROW(profilingState15.TransitionToState(ProfilingState::Uninitialised), armnn::Exception); + CHECK_THROWS_AS(profilingState15.TransitionToState(ProfilingState::Uninitialised), armnn::Exception); ProfilingStateMachine profilingState16(armnn::profiling::ProfilingState::Active); - BOOST_CHECK_THROW(profilingState16.TransitionToState(ProfilingState::WaitingForAck), armnn::Exception); + CHECK_THROWS_AS(profilingState16.TransitionToState(ProfilingState::WaitingForAck), armnn::Exception); ProfilingStateMachine profilingState17(ProfilingState::Uninitialised); @@ -544,7 +546,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingStateMachine) thread4.join(); thread5.join(); - BOOST_TEST((profilingState17.GetCurrentState() == ProfilingState::NotConnected)); + CHECK((profilingState17.GetCurrentState() == ProfilingState::NotConnected)); } void CaptureDataWriteThreadImpl(Holder& holder, uint32_t capturePeriod, const std::vector& counterIds) @@ -557,7 +559,7 @@ void CaptureDataReadThreadImpl(const Holder& holder, CaptureData& captureData) captureData = holder.GetCaptureData(); } -BOOST_AUTO_TEST_CASE(CheckCaptureDataHolder) +TEST_CASE("CheckCaptureDataHolder") { std::map> periodIdMap; std::vector counterIds; @@ -571,14 +573,14 @@ BOOST_AUTO_TEST_CASE(CheckCaptureDataHolder) // Verify the read and write threads set the holder correctly // and retrieve the expected values Holder holder; - BOOST_CHECK((holder.GetCaptureData()).GetCapturePeriod() == 0); - BOOST_CHECK(((holder.GetCaptureData()).GetCounterIds()).empty()); + CHECK((holder.GetCaptureData()).GetCapturePeriod() == 0); + CHECK(((holder.GetCaptureData()).GetCounterIds()).empty()); // Check Holder functions std::thread thread1(CaptureDataWriteThreadImpl, std::ref(holder), 2, std::ref(periodIdMap[2])); thread1.join(); - BOOST_CHECK((holder.GetCaptureData()).GetCapturePeriod() == 2); - BOOST_CHECK((holder.GetCaptureData()).GetCounterIds() == periodIdMap[2]); + CHECK((holder.GetCaptureData()).GetCapturePeriod() == 2); + CHECK((holder.GetCaptureData()).GetCounterIds() == periodIdMap[2]); // NOTE: now that we have some initial values in the holder we don't have to worry // in the multi-threaded section below about a read thread accessing the holder // before any write thread has gotten to it so we read period = 0, counterIds empty @@ -588,8 +590,8 @@ BOOST_AUTO_TEST_CASE(CheckCaptureDataHolder) CaptureData captureData; std::thread thread2(CaptureDataReadThreadImpl, std::ref(holder), std::ref(captureData)); thread2.join(); - BOOST_CHECK(captureData.GetCapturePeriod() == 2); - BOOST_CHECK(captureData.GetCounterIds() == periodIdMap[2]); + CHECK(captureData.GetCapturePeriod() == 2); + CHECK(captureData.GetCounterIds() == periodIdMap[2]); std::map captureDataIdMap; for (uint32_t i = 0; i < numThreads; ++i) @@ -606,8 +608,8 @@ BOOST_AUTO_TEST_CASE(CheckCaptureDataHolder) std::thread(CaptureDataWriteThreadImpl, std::ref(holder), i, std::ref(periodIdMap[i]))); // Verify that the CaptureData goes into the thread in a virgin state - BOOST_CHECK(captureDataIdMap.at(i).GetCapturePeriod() == 0); - BOOST_CHECK(captureDataIdMap.at(i).GetCounterIds().empty()); + CHECK(captureDataIdMap.at(i).GetCapturePeriod() == 0); + CHECK(captureDataIdMap.at(i).GetCounterIds().empty()); readThreadsVect.emplace_back( std::thread(CaptureDataReadThreadImpl, std::ref(holder), std::ref(captureDataIdMap.at(i)))); } @@ -623,70 +625,70 @@ BOOST_AUTO_TEST_CASE(CheckCaptureDataHolder) for (uint32_t i = 0; i < numThreads; ++i) { CaptureData perThreadCaptureData = captureDataIdMap.at(i); - BOOST_CHECK(perThreadCaptureData.GetCounterIds() == periodIdMap.at(perThreadCaptureData.GetCapturePeriod())); + CHECK(perThreadCaptureData.GetCounterIds() == periodIdMap.at(perThreadCaptureData.GetCapturePeriod())); } } -BOOST_AUTO_TEST_CASE(CaptureDataMethods) +TEST_CASE("CaptureDataMethods") { // Check CaptureData setter and getter functions std::vector counterIds = { 42, 29, 13 }; CaptureData captureData; - BOOST_CHECK(captureData.GetCapturePeriod() == 0); - BOOST_CHECK((captureData.GetCounterIds()).empty()); + CHECK(captureData.GetCapturePeriod() == 0); + CHECK((captureData.GetCounterIds()).empty()); captureData.SetCapturePeriod(150); captureData.SetCounterIds(counterIds); - BOOST_CHECK(captureData.GetCapturePeriod() == 150); - BOOST_CHECK(captureData.GetCounterIds() == counterIds); + CHECK(captureData.GetCapturePeriod() == 150); + CHECK(captureData.GetCounterIds() == counterIds); // Check assignment operator CaptureData secondCaptureData; secondCaptureData = captureData; - BOOST_CHECK(secondCaptureData.GetCapturePeriod() == 150); - BOOST_CHECK(secondCaptureData.GetCounterIds() == counterIds); + CHECK(secondCaptureData.GetCapturePeriod() == 150); + CHECK(secondCaptureData.GetCounterIds() == counterIds); // Check copy constructor CaptureData copyConstructedCaptureData(captureData); - BOOST_CHECK(copyConstructedCaptureData.GetCapturePeriod() == 150); - BOOST_CHECK(copyConstructedCaptureData.GetCounterIds() == counterIds); + CHECK(copyConstructedCaptureData.GetCapturePeriod() == 150); + CHECK(copyConstructedCaptureData.GetCounterIds() == counterIds); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceDisabled) +TEST_CASE("CheckProfilingServiceDisabled") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; armnn::profiling::ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceCounterDirectory) +TEST_CASE("CheckProfilingServiceCounterDirectory") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; armnn::profiling::ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); const ICounterDirectory& counterDirectory0 = profilingService.GetCounterDirectory(); - BOOST_CHECK(counterDirectory0.GetCounterCount() == 0); + CHECK(counterDirectory0.GetCounterCount() == 0); profilingService.Update(); - BOOST_CHECK(counterDirectory0.GetCounterCount() == 0); + CHECK(counterDirectory0.GetCounterCount() == 0); options.m_EnableProfiling = true; profilingService.ResetExternalProfilingOptions(options); const ICounterDirectory& counterDirectory1 = profilingService.GetCounterDirectory(); - BOOST_CHECK(counterDirectory1.GetCounterCount() == 0); + CHECK(counterDirectory1.GetCounterCount() == 0); profilingService.Update(); - BOOST_CHECK(counterDirectory1.GetCounterCount() != 0); + CHECK(counterDirectory1.GetCounterCount() != 0); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceCounterValues) +TEST_CASE("CheckProfilingServiceCounterValues") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_EnableProfiling = true; @@ -696,11 +698,11 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceCounterValues) profilingService.Update(); const ICounterDirectory& counterDirectory = profilingService.GetCounterDirectory(); const Counters& counters = counterDirectory.GetCounters(); - BOOST_CHECK(!counters.empty()); + CHECK(!counters.empty()); std::vector writers; - BOOST_CHECK(!counters.empty()); + CHECK(!counters.empty()); // Test GetAbsoluteCounterValue for (int i = 0; i < 4; ++i) @@ -735,13 +737,13 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceCounterValues) uint32_t absoluteCounterValue = 0; - BOOST_CHECK_NO_THROW(absoluteCounterValue = profilingService.GetAbsoluteCounterValue(INFERENCES_RUN)); - BOOST_CHECK(absoluteCounterValue = 5000); + CHECK_NOTHROW(absoluteCounterValue = profilingService.GetAbsoluteCounterValue(INFERENCES_RUN)); + CHECK(absoluteCounterValue == 5000); // Test SetCounterValue - BOOST_CHECK_NO_THROW(profilingService.SetCounterValue(INFERENCES_RUN, 0)); - BOOST_CHECK_NO_THROW(absoluteCounterValue = profilingService.GetAbsoluteCounterValue(INFERENCES_RUN)); - BOOST_CHECK(absoluteCounterValue == 0); + CHECK_NOTHROW(profilingService.SetCounterValue(INFERENCES_RUN, 0)); + CHECK_NOTHROW(absoluteCounterValue = profilingService.GetAbsoluteCounterValue(INFERENCES_RUN)); + CHECK(absoluteCounterValue == 0); // Test GetDeltaCounterValue writers.clear(); @@ -788,402 +790,402 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceCounterValues) // Do one last read in case the reader stopped early deltaCounterValue += profilingService.GetDeltaCounterValue(INFERENCES_RUN); - BOOST_CHECK(deltaCounterValue == 5000); + CHECK(deltaCounterValue == 5000); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingObjectUids) +TEST_CASE("CheckProfilingObjectUids") { uint16_t uid = 0; - BOOST_CHECK_NO_THROW(uid = GetNextUid()); - BOOST_CHECK(uid >= 1); + CHECK_NOTHROW(uid = GetNextUid()); + CHECK(uid >= 1); uint16_t nextUid = 0; - BOOST_CHECK_NO_THROW(nextUid = GetNextUid()); - BOOST_CHECK(nextUid > uid); + CHECK_NOTHROW(nextUid = GetNextUid()); + CHECK(nextUid > uid); std::vector counterUids; - BOOST_CHECK_NO_THROW(counterUids = GetNextCounterUids(uid,0)); - BOOST_CHECK(counterUids.size() == 1); + CHECK_NOTHROW(counterUids = GetNextCounterUids(uid,0)); + CHECK(counterUids.size() == 1); std::vector nextCounterUids; - BOOST_CHECK_NO_THROW(nextCounterUids = GetNextCounterUids(nextUid, 2)); - BOOST_CHECK(nextCounterUids.size() == 2); - BOOST_CHECK(nextCounterUids[0] > counterUids[0]); + CHECK_NOTHROW(nextCounterUids = GetNextCounterUids(nextUid, 2)); + CHECK(nextCounterUids.size() == 2); + CHECK(nextCounterUids[0] > counterUids[0]); std::vector counterUidsMultiCore; uint16_t thirdUid = nextCounterUids[0]; uint16_t numberOfCores = 13; - BOOST_CHECK_NO_THROW(counterUidsMultiCore = GetNextCounterUids(thirdUid, numberOfCores)); - BOOST_CHECK(counterUidsMultiCore.size() == numberOfCores); - BOOST_CHECK(counterUidsMultiCore.front() >= nextCounterUids[0]); + CHECK_NOTHROW(counterUidsMultiCore = GetNextCounterUids(thirdUid, numberOfCores)); + CHECK(counterUidsMultiCore.size() == numberOfCores); + CHECK(counterUidsMultiCore.front() >= nextCounterUids[0]); for (size_t i = 1; i < numberOfCores; i++) { - BOOST_CHECK(counterUidsMultiCore[i] == counterUidsMultiCore[i - 1] + 1); + CHECK(counterUidsMultiCore[i] == counterUidsMultiCore[i - 1] + 1); } - BOOST_CHECK(counterUidsMultiCore.back() == counterUidsMultiCore.front() + numberOfCores - 1); + CHECK(counterUidsMultiCore.back() == counterUidsMultiCore.front() + numberOfCores - 1); } -BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCategory) +TEST_CASE("CheckCounterDirectoryRegisterCategory") { CounterDirectory counterDirectory; - BOOST_CHECK(counterDirectory.GetCategoryCount() == 0); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(counterDirectory.GetCategoryCount() == 0); + CHECK(counterDirectory.GetDeviceCount() == 0); + CHECK(counterDirectory.GetCounterSetCount() == 0); + CHECK(counterDirectory.GetCounterCount() == 0); // Register a category with an invalid name const Category* noCategory = nullptr; - BOOST_CHECK_THROW(noCategory = counterDirectory.RegisterCategory(""), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 0); - BOOST_CHECK(!noCategory); + CHECK_THROWS_AS(noCategory = counterDirectory.RegisterCategory(""), armnn::InvalidArgumentException); + CHECK(counterDirectory.GetCategoryCount() == 0); + CHECK(!noCategory); // Register a category with an invalid name - BOOST_CHECK_THROW(noCategory = counterDirectory.RegisterCategory("invalid category"), + CHECK_THROWS_AS(noCategory = counterDirectory.RegisterCategory("invalid category"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 0); - BOOST_CHECK(!noCategory); + CHECK(counterDirectory.GetCategoryCount() == 0); + CHECK(!noCategory); // Register a new category const std::string categoryName = "some_category"; const Category* category = nullptr; - BOOST_CHECK_NO_THROW(category = counterDirectory.RegisterCategory(categoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category); - BOOST_CHECK(category->m_Name == categoryName); - BOOST_CHECK(category->m_Counters.empty()); + CHECK_NOTHROW(category = counterDirectory.RegisterCategory(categoryName)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category); + CHECK(category->m_Name == categoryName); + CHECK(category->m_Counters.empty()); // Get the registered category const Category* registeredCategory = counterDirectory.GetCategory(categoryName); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(registeredCategory); - BOOST_CHECK(registeredCategory == category); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(registeredCategory); + CHECK(registeredCategory == category); // Try to get a category not registered const Category* notRegisteredCategory = counterDirectory.GetCategory("not_registered_category"); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(!notRegisteredCategory); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(!notRegisteredCategory); // Register a category already registered const Category* anotherCategory = nullptr; - BOOST_CHECK_THROW(anotherCategory = counterDirectory.RegisterCategory(categoryName), + CHECK_THROWS_AS(anotherCategory = counterDirectory.RegisterCategory(categoryName), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(!anotherCategory); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(!anotherCategory); // Register a device for testing const std::string deviceName = "some_device"; const Device* device = nullptr; - BOOST_CHECK_NO_THROW(device = counterDirectory.RegisterDevice(deviceName)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device); - BOOST_CHECK(device->m_Uid >= 1); - BOOST_CHECK(device->m_Name == deviceName); - BOOST_CHECK(device->m_Cores == 0); + CHECK_NOTHROW(device = counterDirectory.RegisterDevice(deviceName)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device); + CHECK(device->m_Uid >= 1); + CHECK(device->m_Name == deviceName); + CHECK(device->m_Cores == 0); // Register a new category not associated to any device const std::string categoryWoDeviceName = "some_category_without_device"; const Category* categoryWoDevice = nullptr; - BOOST_CHECK_NO_THROW(categoryWoDevice = counterDirectory.RegisterCategory(categoryWoDeviceName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 2); - BOOST_CHECK(categoryWoDevice); - BOOST_CHECK(categoryWoDevice->m_Name == categoryWoDeviceName); - BOOST_CHECK(categoryWoDevice->m_Counters.empty()); + CHECK_NOTHROW(categoryWoDevice = counterDirectory.RegisterCategory(categoryWoDeviceName)); + CHECK(counterDirectory.GetCategoryCount() == 2); + CHECK(categoryWoDevice); + CHECK(categoryWoDevice->m_Name == categoryWoDeviceName); + CHECK(categoryWoDevice->m_Counters.empty()); // Register a new category associated to an invalid device name (already exist) const Category* categoryInvalidDeviceName = nullptr; - BOOST_CHECK_THROW(categoryInvalidDeviceName = + CHECK_THROWS_AS(categoryInvalidDeviceName = counterDirectory.RegisterCategory(categoryWoDeviceName), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 2); - BOOST_CHECK(!categoryInvalidDeviceName); + CHECK(counterDirectory.GetCategoryCount() == 2); + CHECK(!categoryInvalidDeviceName); // Register a new category associated to a valid device const std::string categoryWValidDeviceName = "some_category_with_valid_device"; const Category* categoryWValidDevice = nullptr; - BOOST_CHECK_NO_THROW(categoryWValidDevice = + CHECK_NOTHROW(categoryWValidDevice = counterDirectory.RegisterCategory(categoryWValidDeviceName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 3); - BOOST_CHECK(categoryWValidDevice); - BOOST_CHECK(categoryWValidDevice != category); - BOOST_CHECK(categoryWValidDevice->m_Name == categoryWValidDeviceName); + CHECK(counterDirectory.GetCategoryCount() == 3); + CHECK(categoryWValidDevice); + CHECK(categoryWValidDevice != category); + CHECK(categoryWValidDevice->m_Name == categoryWValidDeviceName); // Register a counter set for testing const std::string counterSetName = "some_counter_set"; const CounterSet* counterSet = nullptr; - BOOST_CHECK_NO_THROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(counterSet); - BOOST_CHECK(counterSet->m_Uid >= 1); - BOOST_CHECK(counterSet->m_Name == counterSetName); - BOOST_CHECK(counterSet->m_Count == 0); + CHECK_NOTHROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(counterSet); + CHECK(counterSet->m_Uid >= 1); + CHECK(counterSet->m_Name == counterSetName); + CHECK(counterSet->m_Count == 0); // Register a new category not associated to any counter set const std::string categoryWoCounterSetName = "some_category_without_counter_set"; const Category* categoryWoCounterSet = nullptr; - BOOST_CHECK_NO_THROW(categoryWoCounterSet = + CHECK_NOTHROW(categoryWoCounterSet = counterDirectory.RegisterCategory(categoryWoCounterSetName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 4); - BOOST_CHECK(categoryWoCounterSet); - BOOST_CHECK(categoryWoCounterSet->m_Name == categoryWoCounterSetName); + CHECK(counterDirectory.GetCategoryCount() == 4); + CHECK(categoryWoCounterSet); + CHECK(categoryWoCounterSet->m_Name == categoryWoCounterSetName); // Register a new category associated to a valid counter set const std::string categoryWValidCounterSetName = "some_category_with_valid_counter_set"; const Category* categoryWValidCounterSet = nullptr; - BOOST_CHECK_NO_THROW(categoryWValidCounterSet = counterDirectory.RegisterCategory(categoryWValidCounterSetName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 5); - BOOST_CHECK(categoryWValidCounterSet); - BOOST_CHECK(categoryWValidCounterSet != category); - BOOST_CHECK(categoryWValidCounterSet->m_Name == categoryWValidCounterSetName); + CHECK_NOTHROW(categoryWValidCounterSet = counterDirectory.RegisterCategory(categoryWValidCounterSetName)); + CHECK(counterDirectory.GetCategoryCount() == 5); + CHECK(categoryWValidCounterSet); + CHECK(categoryWValidCounterSet != category); + CHECK(categoryWValidCounterSet->m_Name == categoryWValidCounterSetName); // Register a new category associated to a valid device and counter set const std::string categoryWValidDeviceAndValidCounterSetName = "some_category_with_valid_device_and_counter_set"; const Category* categoryWValidDeviceAndValidCounterSet = nullptr; - BOOST_CHECK_NO_THROW(categoryWValidDeviceAndValidCounterSet = counterDirectory.RegisterCategory( + CHECK_NOTHROW(categoryWValidDeviceAndValidCounterSet = counterDirectory.RegisterCategory( categoryWValidDeviceAndValidCounterSetName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 6); - BOOST_CHECK(categoryWValidDeviceAndValidCounterSet); - BOOST_CHECK(categoryWValidDeviceAndValidCounterSet != category); - BOOST_CHECK(categoryWValidDeviceAndValidCounterSet->m_Name == categoryWValidDeviceAndValidCounterSetName); + CHECK(counterDirectory.GetCategoryCount() == 6); + CHECK(categoryWValidDeviceAndValidCounterSet); + CHECK(categoryWValidDeviceAndValidCounterSet != category); + CHECK(categoryWValidDeviceAndValidCounterSet->m_Name == categoryWValidDeviceAndValidCounterSetName); } -BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterDevice) +TEST_CASE("CheckCounterDirectoryRegisterDevice") { CounterDirectory counterDirectory; - BOOST_CHECK(counterDirectory.GetCategoryCount() == 0); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(counterDirectory.GetCategoryCount() == 0); + CHECK(counterDirectory.GetDeviceCount() == 0); + CHECK(counterDirectory.GetCounterSetCount() == 0); + CHECK(counterDirectory.GetCounterCount() == 0); // Register a device with an invalid name const Device* noDevice = nullptr; - BOOST_CHECK_THROW(noDevice = counterDirectory.RegisterDevice(""), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 0); - BOOST_CHECK(!noDevice); + CHECK_THROWS_AS(noDevice = counterDirectory.RegisterDevice(""), armnn::InvalidArgumentException); + CHECK(counterDirectory.GetDeviceCount() == 0); + CHECK(!noDevice); // Register a device with an invalid name - BOOST_CHECK_THROW(noDevice = counterDirectory.RegisterDevice("inv@lid nam€"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 0); - BOOST_CHECK(!noDevice); + CHECK_THROWS_AS(noDevice = counterDirectory.RegisterDevice("inv@lid nam€"), armnn::InvalidArgumentException); + CHECK(counterDirectory.GetDeviceCount() == 0); + CHECK(!noDevice); // Register a new device with no cores or parent category const std::string deviceName = "some_device"; const Device* device = nullptr; - BOOST_CHECK_NO_THROW(device = counterDirectory.RegisterDevice(deviceName)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device); - BOOST_CHECK(device->m_Name == deviceName); - BOOST_CHECK(device->m_Uid >= 1); - BOOST_CHECK(device->m_Cores == 0); + CHECK_NOTHROW(device = counterDirectory.RegisterDevice(deviceName)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device); + CHECK(device->m_Name == deviceName); + CHECK(device->m_Uid >= 1); + CHECK(device->m_Cores == 0); // Try getting an unregistered device const Device* unregisteredDevice = counterDirectory.GetDevice(9999); - BOOST_CHECK(!unregisteredDevice); + CHECK(!unregisteredDevice); // Get the registered device const Device* registeredDevice = counterDirectory.GetDevice(device->m_Uid); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(registeredDevice); - BOOST_CHECK(registeredDevice == device); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(registeredDevice); + CHECK(registeredDevice == device); // Register a device with the name of a device already registered const Device* deviceSameName = nullptr; - BOOST_CHECK_THROW(deviceSameName = counterDirectory.RegisterDevice(deviceName), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(!deviceSameName); + CHECK_THROWS_AS(deviceSameName = counterDirectory.RegisterDevice(deviceName), armnn::InvalidArgumentException); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(!deviceSameName); // Register a new device with cores and no parent category const std::string deviceWCoresName = "some_device_with_cores"; const Device* deviceWCores = nullptr; - BOOST_CHECK_NO_THROW(deviceWCores = counterDirectory.RegisterDevice(deviceWCoresName, 2)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 2); - BOOST_CHECK(deviceWCores); - BOOST_CHECK(deviceWCores->m_Name == deviceWCoresName); - BOOST_CHECK(deviceWCores->m_Uid >= 1); - BOOST_CHECK(deviceWCores->m_Uid > device->m_Uid); - BOOST_CHECK(deviceWCores->m_Cores == 2); + CHECK_NOTHROW(deviceWCores = counterDirectory.RegisterDevice(deviceWCoresName, 2)); + CHECK(counterDirectory.GetDeviceCount() == 2); + CHECK(deviceWCores); + CHECK(deviceWCores->m_Name == deviceWCoresName); + CHECK(deviceWCores->m_Uid >= 1); + CHECK(deviceWCores->m_Uid > device->m_Uid); + CHECK(deviceWCores->m_Cores == 2); // Get the registered device const Device* registeredDeviceWCores = counterDirectory.GetDevice(deviceWCores->m_Uid); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 2); - BOOST_CHECK(registeredDeviceWCores); - BOOST_CHECK(registeredDeviceWCores == deviceWCores); - BOOST_CHECK(registeredDeviceWCores != device); + CHECK(counterDirectory.GetDeviceCount() == 2); + CHECK(registeredDeviceWCores); + CHECK(registeredDeviceWCores == deviceWCores); + CHECK(registeredDeviceWCores != device); // Register a new device with cores and invalid parent category const std::string deviceWCoresWInvalidParentCategoryName = "some_device_with_cores_with_invalid_parent_category"; const Device* deviceWCoresWInvalidParentCategory = nullptr; - BOOST_CHECK_THROW(deviceWCoresWInvalidParentCategory = + CHECK_THROWS_AS(deviceWCoresWInvalidParentCategory = counterDirectory.RegisterDevice(deviceWCoresWInvalidParentCategoryName, 3, std::string("")), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 2); - BOOST_CHECK(!deviceWCoresWInvalidParentCategory); + CHECK(counterDirectory.GetDeviceCount() == 2); + CHECK(!deviceWCoresWInvalidParentCategory); // Register a new device with cores and invalid parent category const std::string deviceWCoresWInvalidParentCategoryName2 = "some_device_with_cores_with_invalid_parent_category2"; const Device* deviceWCoresWInvalidParentCategory2 = nullptr; - BOOST_CHECK_THROW(deviceWCoresWInvalidParentCategory2 = counterDirectory.RegisterDevice( + CHECK_THROWS_AS(deviceWCoresWInvalidParentCategory2 = counterDirectory.RegisterDevice( deviceWCoresWInvalidParentCategoryName2, 3, std::string("invalid_parent_category")), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 2); - BOOST_CHECK(!deviceWCoresWInvalidParentCategory2); + CHECK(counterDirectory.GetDeviceCount() == 2); + CHECK(!deviceWCoresWInvalidParentCategory2); // Register a category for testing const std::string categoryName = "some_category"; const Category* category = nullptr; - BOOST_CHECK_NO_THROW(category = counterDirectory.RegisterCategory(categoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category); - BOOST_CHECK(category->m_Name == categoryName); - BOOST_CHECK(category->m_Counters.empty()); + CHECK_NOTHROW(category = counterDirectory.RegisterCategory(categoryName)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category); + CHECK(category->m_Name == categoryName); + CHECK(category->m_Counters.empty()); // Register a new device with cores and valid parent category const std::string deviceWCoresWValidParentCategoryName = "some_device_with_cores_with_valid_parent_category"; const Device* deviceWCoresWValidParentCategory = nullptr; - BOOST_CHECK_NO_THROW(deviceWCoresWValidParentCategory = + CHECK_NOTHROW(deviceWCoresWValidParentCategory = counterDirectory.RegisterDevice(deviceWCoresWValidParentCategoryName, 4, categoryName)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 3); - BOOST_CHECK(deviceWCoresWValidParentCategory); - BOOST_CHECK(deviceWCoresWValidParentCategory->m_Name == deviceWCoresWValidParentCategoryName); - BOOST_CHECK(deviceWCoresWValidParentCategory->m_Uid >= 1); - BOOST_CHECK(deviceWCoresWValidParentCategory->m_Uid > device->m_Uid); - BOOST_CHECK(deviceWCoresWValidParentCategory->m_Uid > deviceWCores->m_Uid); - BOOST_CHECK(deviceWCoresWValidParentCategory->m_Cores == 4); + CHECK(counterDirectory.GetDeviceCount() == 3); + CHECK(deviceWCoresWValidParentCategory); + CHECK(deviceWCoresWValidParentCategory->m_Name == deviceWCoresWValidParentCategoryName); + CHECK(deviceWCoresWValidParentCategory->m_Uid >= 1); + CHECK(deviceWCoresWValidParentCategory->m_Uid > device->m_Uid); + CHECK(deviceWCoresWValidParentCategory->m_Uid > deviceWCores->m_Uid); + CHECK(deviceWCoresWValidParentCategory->m_Cores == 4); } -BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounterSet) +TEST_CASE("CheckCounterDirectoryRegisterCounterSet") { CounterDirectory counterDirectory; - BOOST_CHECK(counterDirectory.GetCategoryCount() == 0); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(counterDirectory.GetCategoryCount() == 0); + CHECK(counterDirectory.GetDeviceCount() == 0); + CHECK(counterDirectory.GetCounterSetCount() == 0); + CHECK(counterDirectory.GetCounterCount() == 0); // Register a counter set with an invalid name const CounterSet* noCounterSet = nullptr; - BOOST_CHECK_THROW(noCounterSet = counterDirectory.RegisterCounterSet(""), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 0); - BOOST_CHECK(!noCounterSet); + CHECK_THROWS_AS(noCounterSet = counterDirectory.RegisterCounterSet(""), armnn::InvalidArgumentException); + CHECK(counterDirectory.GetCounterSetCount() == 0); + CHECK(!noCounterSet); // Register a counter set with an invalid name - BOOST_CHECK_THROW(noCounterSet = counterDirectory.RegisterCounterSet("invalid name"), + CHECK_THROWS_AS(noCounterSet = counterDirectory.RegisterCounterSet("invalid name"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 0); - BOOST_CHECK(!noCounterSet); + CHECK(counterDirectory.GetCounterSetCount() == 0); + CHECK(!noCounterSet); // Register a new counter set with no count or parent category const std::string counterSetName = "some_counter_set"; const CounterSet* counterSet = nullptr; - BOOST_CHECK_NO_THROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(counterSet); - BOOST_CHECK(counterSet->m_Name == counterSetName); - BOOST_CHECK(counterSet->m_Uid >= 1); - BOOST_CHECK(counterSet->m_Count == 0); + CHECK_NOTHROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(counterSet); + CHECK(counterSet->m_Name == counterSetName); + CHECK(counterSet->m_Uid >= 1); + CHECK(counterSet->m_Count == 0); // Try getting an unregistered counter set const CounterSet* unregisteredCounterSet = counterDirectory.GetCounterSet(9999); - BOOST_CHECK(!unregisteredCounterSet); + CHECK(!unregisteredCounterSet); // Get the registered counter set const CounterSet* registeredCounterSet = counterDirectory.GetCounterSet(counterSet->m_Uid); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(registeredCounterSet); - BOOST_CHECK(registeredCounterSet == counterSet); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(registeredCounterSet); + CHECK(registeredCounterSet == counterSet); // Register a counter set with the name of a counter set already registered const CounterSet* counterSetSameName = nullptr; - BOOST_CHECK_THROW(counterSetSameName = counterDirectory.RegisterCounterSet(counterSetName), + CHECK_THROWS_AS(counterSetSameName = counterDirectory.RegisterCounterSet(counterSetName), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(!counterSetSameName); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(!counterSetSameName); // Register a new counter set with count and no parent category const std::string counterSetWCountName = "some_counter_set_with_count"; const CounterSet* counterSetWCount = nullptr; - BOOST_CHECK_NO_THROW(counterSetWCount = counterDirectory.RegisterCounterSet(counterSetWCountName, 37)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 2); - BOOST_CHECK(counterSetWCount); - BOOST_CHECK(counterSetWCount->m_Name == counterSetWCountName); - BOOST_CHECK(counterSetWCount->m_Uid >= 1); - BOOST_CHECK(counterSetWCount->m_Uid > counterSet->m_Uid); - BOOST_CHECK(counterSetWCount->m_Count == 37); + CHECK_NOTHROW(counterSetWCount = counterDirectory.RegisterCounterSet(counterSetWCountName, 37)); + CHECK(counterDirectory.GetCounterSetCount() == 2); + CHECK(counterSetWCount); + CHECK(counterSetWCount->m_Name == counterSetWCountName); + CHECK(counterSetWCount->m_Uid >= 1); + CHECK(counterSetWCount->m_Uid > counterSet->m_Uid); + CHECK(counterSetWCount->m_Count == 37); // Get the registered counter set const CounterSet* registeredCounterSetWCount = counterDirectory.GetCounterSet(counterSetWCount->m_Uid); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 2); - BOOST_CHECK(registeredCounterSetWCount); - BOOST_CHECK(registeredCounterSetWCount == counterSetWCount); - BOOST_CHECK(registeredCounterSetWCount != counterSet); + CHECK(counterDirectory.GetCounterSetCount() == 2); + CHECK(registeredCounterSetWCount); + CHECK(registeredCounterSetWCount == counterSetWCount); + CHECK(registeredCounterSetWCount != counterSet); // Register a new counter set with count and invalid parent category const std::string counterSetWCountWInvalidParentCategoryName = "some_counter_set_with_count_" "with_invalid_parent_category"; const CounterSet* counterSetWCountWInvalidParentCategory = nullptr; - BOOST_CHECK_THROW(counterSetWCountWInvalidParentCategory = counterDirectory.RegisterCounterSet( + CHECK_THROWS_AS(counterSetWCountWInvalidParentCategory = counterDirectory.RegisterCounterSet( counterSetWCountWInvalidParentCategoryName, 42, std::string("")), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 2); - BOOST_CHECK(!counterSetWCountWInvalidParentCategory); + CHECK(counterDirectory.GetCounterSetCount() == 2); + CHECK(!counterSetWCountWInvalidParentCategory); // Register a new counter set with count and invalid parent category const std::string counterSetWCountWInvalidParentCategoryName2 = "some_counter_set_with_count_" "with_invalid_parent_category2"; const CounterSet* counterSetWCountWInvalidParentCategory2 = nullptr; - BOOST_CHECK_THROW(counterSetWCountWInvalidParentCategory2 = counterDirectory.RegisterCounterSet( + CHECK_THROWS_AS(counterSetWCountWInvalidParentCategory2 = counterDirectory.RegisterCounterSet( counterSetWCountWInvalidParentCategoryName2, 42, std::string("invalid_parent_category")), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 2); - BOOST_CHECK(!counterSetWCountWInvalidParentCategory2); + CHECK(counterDirectory.GetCounterSetCount() == 2); + CHECK(!counterSetWCountWInvalidParentCategory2); // Register a category for testing const std::string categoryName = "some_category"; const Category* category = nullptr; - BOOST_CHECK_NO_THROW(category = counterDirectory.RegisterCategory(categoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category); - BOOST_CHECK(category->m_Name == categoryName); - BOOST_CHECK(category->m_Counters.empty()); + CHECK_NOTHROW(category = counterDirectory.RegisterCategory(categoryName)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category); + CHECK(category->m_Name == categoryName); + CHECK(category->m_Counters.empty()); // Register a new counter set with count and valid parent category const std::string counterSetWCountWValidParentCategoryName = "some_counter_set_with_count_" "with_valid_parent_category"; const CounterSet* counterSetWCountWValidParentCategory = nullptr; - BOOST_CHECK_NO_THROW(counterSetWCountWValidParentCategory = counterDirectory.RegisterCounterSet( + CHECK_NOTHROW(counterSetWCountWValidParentCategory = counterDirectory.RegisterCounterSet( counterSetWCountWValidParentCategoryName, 42, categoryName)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 3); - BOOST_CHECK(counterSetWCountWValidParentCategory); - BOOST_CHECK(counterSetWCountWValidParentCategory->m_Name == counterSetWCountWValidParentCategoryName); - BOOST_CHECK(counterSetWCountWValidParentCategory->m_Uid >= 1); - BOOST_CHECK(counterSetWCountWValidParentCategory->m_Uid > counterSet->m_Uid); - BOOST_CHECK(counterSetWCountWValidParentCategory->m_Uid > counterSetWCount->m_Uid); - BOOST_CHECK(counterSetWCountWValidParentCategory->m_Count == 42); + CHECK(counterDirectory.GetCounterSetCount() == 3); + CHECK(counterSetWCountWValidParentCategory); + CHECK(counterSetWCountWValidParentCategory->m_Name == counterSetWCountWValidParentCategoryName); + CHECK(counterSetWCountWValidParentCategory->m_Uid >= 1); + CHECK(counterSetWCountWValidParentCategory->m_Uid > counterSet->m_Uid); + CHECK(counterSetWCountWValidParentCategory->m_Uid > counterSetWCount->m_Uid); + CHECK(counterSetWCountWValidParentCategory->m_Count == 42); // Register a counter set associated to a category with invalid name const std::string counterSetSameCategoryName = "some_counter_set_with_invalid_parent_category"; const std::string invalidCategoryName = ""; const CounterSet* counterSetSameCategory = nullptr; - BOOST_CHECK_THROW(counterSetSameCategory = + CHECK_THROWS_AS(counterSetSameCategory = counterDirectory.RegisterCounterSet(counterSetSameCategoryName, 0, invalidCategoryName), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 3); - BOOST_CHECK(!counterSetSameCategory); + CHECK(counterDirectory.GetCounterSetCount() == 3); + CHECK(!counterSetSameCategory); } -BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) +TEST_CASE("CheckCounterDirectoryRegisterCounter") { CounterDirectory counterDirectory; - BOOST_CHECK(counterDirectory.GetCategoryCount() == 0); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 0); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(counterDirectory.GetCategoryCount() == 0); + CHECK(counterDirectory.GetDeviceCount() == 0); + CHECK(counterDirectory.GetCounterSetCount() == 0); + CHECK(counterDirectory.GetCounterCount() == 0); // Register a counter with an invalid parent category name const Counter* noCounter = nullptr; - BOOST_CHECK_THROW(noCounter = + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 0, "", @@ -1193,11 +1195,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "valid ", "name"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid parent category name - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 1, "invalid parent category", 0, @@ -1206,11 +1208,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "valid name", "valid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid class - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 2, "valid_parent_category", 2, @@ -1220,11 +1222,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "name", "valid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid interpolation - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 4, "valid_parent_category", 0, @@ -1234,11 +1236,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "name", "valid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid multiplier - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 5, "valid_parent_category", 0, @@ -1248,11 +1250,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "name", "valid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid name - BOOST_CHECK_THROW( + CHECK_THROWS_AS( noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 6, "valid_parent_category", @@ -1262,11 +1264,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "", "valid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid name - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 7, "valid_parent_category", 0, @@ -1275,11 +1277,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "invalid nam€", "valid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid description - BOOST_CHECK_THROW(noCounter = + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 8, "valid_parent_category", @@ -1289,11 +1291,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "valid name", ""), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid description - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 9, "valid_parent_category", 0, @@ -1303,11 +1305,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "name", "inv@lid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with an invalid unit2 - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 10, "valid_parent_category", 0, @@ -1317,11 +1319,11 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "valid description", std::string("Mb/s2")), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Register a counter with a non-existing parent category name - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 11, "invalid_parent_category", 0, @@ -1330,25 +1332,25 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "valid name", "valid description"), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 0); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 0); + CHECK(!noCounter); // Try getting an unregistered counter const Counter* unregisteredCounter = counterDirectory.GetCounter(9999); - BOOST_CHECK(!unregisteredCounter); + CHECK(!unregisteredCounter); // Register a category for testing const std::string categoryName = "some_category"; const Category* category = nullptr; - BOOST_CHECK_NO_THROW(category = counterDirectory.RegisterCategory(categoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category); - BOOST_CHECK(category->m_Name == categoryName); - BOOST_CHECK(category->m_Counters.empty()); + CHECK_NOTHROW(category = counterDirectory.RegisterCategory(categoryName)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category); + CHECK(category->m_Name == categoryName); + CHECK(category->m_Counters.empty()); // Register a counter with a valid parent category name const Counter* counter = nullptr; - BOOST_CHECK_NO_THROW( + CHECK_NOTHROW( counter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 12, categoryName, @@ -1357,23 +1359,23 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) 123.45f, "valid name", "valid description")); - BOOST_CHECK(counterDirectory.GetCounterCount() == 1); - BOOST_CHECK(counter); - BOOST_CHECK(counter->m_MaxCounterUid == counter->m_Uid); - BOOST_CHECK(counter->m_Class == 0); - BOOST_CHECK(counter->m_Interpolation == 1); - BOOST_CHECK(counter->m_Multiplier == 123.45f); - BOOST_CHECK(counter->m_Name == "valid name"); - BOOST_CHECK(counter->m_Description == "valid description"); - BOOST_CHECK(counter->m_Units == ""); - BOOST_CHECK(counter->m_DeviceUid == 0); - BOOST_CHECK(counter->m_CounterSetUid == 0); - BOOST_CHECK(category->m_Counters.size() == 1); - BOOST_CHECK(category->m_Counters.back() == counter->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 1); + CHECK(counter); + CHECK(counter->m_MaxCounterUid == counter->m_Uid); + CHECK(counter->m_Class == 0); + CHECK(counter->m_Interpolation == 1); + CHECK(counter->m_Multiplier == 123.45f); + CHECK(counter->m_Name == "valid name"); + CHECK(counter->m_Description == "valid description"); + CHECK(counter->m_Units == ""); + CHECK(counter->m_DeviceUid == 0); + CHECK(counter->m_CounterSetUid == 0); + CHECK(category->m_Counters.size() == 1); + CHECK(category->m_Counters.back() == counter->m_Uid); // Register a counter with a name of a counter already registered for the given parent category name const Counter* counterSameName = nullptr; - BOOST_CHECK_THROW(counterSameName = + CHECK_THROWS_AS(counterSameName = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 13, categoryName, @@ -1384,12 +1386,12 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "valid description", std::string("description")), armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 1); - BOOST_CHECK(!counterSameName); + CHECK(counterDirectory.GetCounterCount() == 1); + CHECK(!counterSameName); // Register a counter with a valid parent category name and units const Counter* counterWUnits = nullptr; - BOOST_CHECK_NO_THROW(counterWUnits = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counterWUnits = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 14, categoryName, 0, @@ -1398,24 +1400,24 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) "valid name 2", "valid description", std::string("Mnnsq2"))); // Units - BOOST_CHECK(counterDirectory.GetCounterCount() == 2); - BOOST_CHECK(counterWUnits); - BOOST_CHECK(counterWUnits->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWUnits->m_MaxCounterUid == counterWUnits->m_Uid); - BOOST_CHECK(counterWUnits->m_Class == 0); - BOOST_CHECK(counterWUnits->m_Interpolation == 1); - BOOST_CHECK(counterWUnits->m_Multiplier == 123.45f); - BOOST_CHECK(counterWUnits->m_Name == "valid name 2"); - BOOST_CHECK(counterWUnits->m_Description == "valid description"); - BOOST_CHECK(counterWUnits->m_Units == "Mnnsq2"); - BOOST_CHECK(counterWUnits->m_DeviceUid == 0); - BOOST_CHECK(counterWUnits->m_CounterSetUid == 0); - BOOST_CHECK(category->m_Counters.size() == 2); - BOOST_CHECK(category->m_Counters.back() == counterWUnits->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 2); + CHECK(counterWUnits); + CHECK(counterWUnits->m_Uid > counter->m_Uid); + CHECK(counterWUnits->m_MaxCounterUid == counterWUnits->m_Uid); + CHECK(counterWUnits->m_Class == 0); + CHECK(counterWUnits->m_Interpolation == 1); + CHECK(counterWUnits->m_Multiplier == 123.45f); + CHECK(counterWUnits->m_Name == "valid name 2"); + CHECK(counterWUnits->m_Description == "valid description"); + CHECK(counterWUnits->m_Units == "Mnnsq2"); + CHECK(counterWUnits->m_DeviceUid == 0); + CHECK(counterWUnits->m_CounterSetUid == 0); + CHECK(category->m_Counters.size() == 2); + CHECK(category->m_Counters.back() == counterWUnits->m_Uid); // Register a counter with a valid parent category name and not associated with a device const Counter* counterWoDevice = nullptr; - BOOST_CHECK_NO_THROW(counterWoDevice = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counterWoDevice = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 26, categoryName, 0, @@ -1426,23 +1428,23 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) armnn::EmptyOptional(),// Units armnn::EmptyOptional(),// Number of cores 0)); // Device UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 3); - BOOST_CHECK(counterWoDevice); - BOOST_CHECK(counterWoDevice->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWoDevice->m_MaxCounterUid == counterWoDevice->m_Uid); - BOOST_CHECK(counterWoDevice->m_Class == 0); - BOOST_CHECK(counterWoDevice->m_Interpolation == 1); - BOOST_CHECK(counterWoDevice->m_Multiplier == 123.45f); - BOOST_CHECK(counterWoDevice->m_Name == "valid name 3"); - BOOST_CHECK(counterWoDevice->m_Description == "valid description"); - BOOST_CHECK(counterWoDevice->m_Units == ""); - BOOST_CHECK(counterWoDevice->m_DeviceUid == 0); - BOOST_CHECK(counterWoDevice->m_CounterSetUid == 0); - BOOST_CHECK(category->m_Counters.size() == 3); - BOOST_CHECK(category->m_Counters.back() == counterWoDevice->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 3); + CHECK(counterWoDevice); + CHECK(counterWoDevice->m_Uid > counter->m_Uid); + CHECK(counterWoDevice->m_MaxCounterUid == counterWoDevice->m_Uid); + CHECK(counterWoDevice->m_Class == 0); + CHECK(counterWoDevice->m_Interpolation == 1); + CHECK(counterWoDevice->m_Multiplier == 123.45f); + CHECK(counterWoDevice->m_Name == "valid name 3"); + CHECK(counterWoDevice->m_Description == "valid description"); + CHECK(counterWoDevice->m_Units == ""); + CHECK(counterWoDevice->m_DeviceUid == 0); + CHECK(counterWoDevice->m_CounterSetUid == 0); + CHECK(category->m_Counters.size() == 3); + CHECK(category->m_Counters.back() == counterWoDevice->m_Uid); // Register a counter with a valid parent category name and associated to an invalid device - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 15, categoryName, 0, @@ -1454,22 +1456,22 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) armnn::EmptyOptional(), // Number of cores 100), // Device UID armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 3); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 3); + CHECK(!noCounter); // Register a device for testing const std::string deviceName = "some_device"; const Device* device = nullptr; - BOOST_CHECK_NO_THROW(device = counterDirectory.RegisterDevice(deviceName)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device); - BOOST_CHECK(device->m_Name == deviceName); - BOOST_CHECK(device->m_Uid >= 1); - BOOST_CHECK(device->m_Cores == 0); + CHECK_NOTHROW(device = counterDirectory.RegisterDevice(deviceName)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device); + CHECK(device->m_Name == deviceName); + CHECK(device->m_Uid >= 1); + CHECK(device->m_Cores == 0); // Register a counter with a valid parent category name and associated to a device const Counter* counterWDevice = nullptr; - BOOST_CHECK_NO_THROW(counterWDevice = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counterWDevice = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 16, categoryName, 0, @@ -1480,24 +1482,24 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) armnn::EmptyOptional(), // Units armnn::EmptyOptional(), // Number of cores device->m_Uid)); // Device UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 4); - BOOST_CHECK(counterWDevice); - BOOST_CHECK(counterWDevice->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWDevice->m_MaxCounterUid == counterWDevice->m_Uid); - BOOST_CHECK(counterWDevice->m_Class == 0); - BOOST_CHECK(counterWDevice->m_Interpolation == 1); - BOOST_CHECK(counterWDevice->m_Multiplier == 123.45f); - BOOST_CHECK(counterWDevice->m_Name == "valid name 5"); - BOOST_CHECK(counterWDevice->m_Description == "valid description"); - BOOST_CHECK(counterWDevice->m_Units == ""); - BOOST_CHECK(counterWDevice->m_DeviceUid == device->m_Uid); - BOOST_CHECK(counterWDevice->m_CounterSetUid == 0); - BOOST_CHECK(category->m_Counters.size() == 4); - BOOST_CHECK(category->m_Counters.back() == counterWDevice->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 4); + CHECK(counterWDevice); + CHECK(counterWDevice->m_Uid > counter->m_Uid); + CHECK(counterWDevice->m_MaxCounterUid == counterWDevice->m_Uid); + CHECK(counterWDevice->m_Class == 0); + CHECK(counterWDevice->m_Interpolation == 1); + CHECK(counterWDevice->m_Multiplier == 123.45f); + CHECK(counterWDevice->m_Name == "valid name 5"); + CHECK(counterWDevice->m_Description == "valid description"); + CHECK(counterWDevice->m_Units == ""); + CHECK(counterWDevice->m_DeviceUid == device->m_Uid); + CHECK(counterWDevice->m_CounterSetUid == 0); + CHECK(category->m_Counters.size() == 4); + CHECK(category->m_Counters.back() == counterWDevice->m_Uid); // Register a counter with a valid parent category name and not associated with a counter set const Counter* counterWoCounterSet = nullptr; - BOOST_CHECK_NO_THROW(counterWoCounterSet = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counterWoCounterSet = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 17, categoryName, 0, @@ -1509,23 +1511,23 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) armnn::EmptyOptional(),// No of cores armnn::EmptyOptional(),// Device UID 0)); // CounterSet UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 5); - BOOST_CHECK(counterWoCounterSet); - BOOST_CHECK(counterWoCounterSet->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWoCounterSet->m_MaxCounterUid == counterWoCounterSet->m_Uid); - BOOST_CHECK(counterWoCounterSet->m_Class == 0); - BOOST_CHECK(counterWoCounterSet->m_Interpolation == 1); - BOOST_CHECK(counterWoCounterSet->m_Multiplier == 123.45f); - BOOST_CHECK(counterWoCounterSet->m_Name == "valid name 6"); - BOOST_CHECK(counterWoCounterSet->m_Description == "valid description"); - BOOST_CHECK(counterWoCounterSet->m_Units == ""); - BOOST_CHECK(counterWoCounterSet->m_DeviceUid == 0); - BOOST_CHECK(counterWoCounterSet->m_CounterSetUid == 0); - BOOST_CHECK(category->m_Counters.size() == 5); - BOOST_CHECK(category->m_Counters.back() == counterWoCounterSet->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 5); + CHECK(counterWoCounterSet); + CHECK(counterWoCounterSet->m_Uid > counter->m_Uid); + CHECK(counterWoCounterSet->m_MaxCounterUid == counterWoCounterSet->m_Uid); + CHECK(counterWoCounterSet->m_Class == 0); + CHECK(counterWoCounterSet->m_Interpolation == 1); + CHECK(counterWoCounterSet->m_Multiplier == 123.45f); + CHECK(counterWoCounterSet->m_Name == "valid name 6"); + CHECK(counterWoCounterSet->m_Description == "valid description"); + CHECK(counterWoCounterSet->m_Units == ""); + CHECK(counterWoCounterSet->m_DeviceUid == 0); + CHECK(counterWoCounterSet->m_CounterSetUid == 0); + CHECK(category->m_Counters.size() == 5); + CHECK(category->m_Counters.back() == counterWoCounterSet->m_Uid); // Register a counter with a valid parent category name and associated to an invalid counter set - BOOST_CHECK_THROW(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 18, categoryName, 0, @@ -1538,92 +1540,92 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) armnn::EmptyOptional(), // Number of cores 100), // Counter set UID armnn::InvalidArgumentException); - BOOST_CHECK(counterDirectory.GetCounterCount() == 5); - BOOST_CHECK(!noCounter); + CHECK(counterDirectory.GetCounterCount() == 5); + CHECK(!noCounter); // Register a counter with a valid parent category name and with a given number of cores const Counter* counterWNumberOfCores = nullptr; uint16_t numberOfCores = 15; - BOOST_CHECK_NO_THROW(counterWNumberOfCores = counterDirectory.RegisterCounter( + CHECK_NOTHROW(counterWNumberOfCores = counterDirectory.RegisterCounter( armnn::profiling::BACKEND_ID, 50, categoryName, 0, 1, 123.45f, "valid name 8", "valid description", armnn::EmptyOptional(), // Units numberOfCores, // Number of cores armnn::EmptyOptional(), // Device UID armnn::EmptyOptional())); // Counter set UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 20); - BOOST_CHECK(counterWNumberOfCores); - BOOST_CHECK(counterWNumberOfCores->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWNumberOfCores->m_MaxCounterUid == counterWNumberOfCores->m_Uid + numberOfCores - 1); - BOOST_CHECK(counterWNumberOfCores->m_Class == 0); - BOOST_CHECK(counterWNumberOfCores->m_Interpolation == 1); - BOOST_CHECK(counterWNumberOfCores->m_Multiplier == 123.45f); - BOOST_CHECK(counterWNumberOfCores->m_Name == "valid name 8"); - BOOST_CHECK(counterWNumberOfCores->m_Description == "valid description"); - BOOST_CHECK(counterWNumberOfCores->m_Units == ""); - BOOST_CHECK(counterWNumberOfCores->m_DeviceUid == 0); - BOOST_CHECK(counterWNumberOfCores->m_CounterSetUid == 0); - BOOST_CHECK(category->m_Counters.size() == 20); + CHECK(counterDirectory.GetCounterCount() == 20); + CHECK(counterWNumberOfCores); + CHECK(counterWNumberOfCores->m_Uid > counter->m_Uid); + CHECK(counterWNumberOfCores->m_MaxCounterUid == counterWNumberOfCores->m_Uid + numberOfCores - 1); + CHECK(counterWNumberOfCores->m_Class == 0); + CHECK(counterWNumberOfCores->m_Interpolation == 1); + CHECK(counterWNumberOfCores->m_Multiplier == 123.45f); + CHECK(counterWNumberOfCores->m_Name == "valid name 8"); + CHECK(counterWNumberOfCores->m_Description == "valid description"); + CHECK(counterWNumberOfCores->m_Units == ""); + CHECK(counterWNumberOfCores->m_DeviceUid == 0); + CHECK(counterWNumberOfCores->m_CounterSetUid == 0); + CHECK(category->m_Counters.size() == 20); for (size_t i = 0; i < numberOfCores; i++) { - BOOST_CHECK(category->m_Counters[category->m_Counters.size() - numberOfCores + i] == + CHECK(category->m_Counters[category->m_Counters.size() - numberOfCores + i] == counterWNumberOfCores->m_Uid + i); } // Register a multi-core device for testing const std::string multiCoreDeviceName = "some_multi_core_device"; const Device* multiCoreDevice = nullptr; - BOOST_CHECK_NO_THROW(multiCoreDevice = counterDirectory.RegisterDevice(multiCoreDeviceName, 4)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 2); - BOOST_CHECK(multiCoreDevice); - BOOST_CHECK(multiCoreDevice->m_Name == multiCoreDeviceName); - BOOST_CHECK(multiCoreDevice->m_Uid >= 1); - BOOST_CHECK(multiCoreDevice->m_Cores == 4); + CHECK_NOTHROW(multiCoreDevice = counterDirectory.RegisterDevice(multiCoreDeviceName, 4)); + CHECK(counterDirectory.GetDeviceCount() == 2); + CHECK(multiCoreDevice); + CHECK(multiCoreDevice->m_Name == multiCoreDeviceName); + CHECK(multiCoreDevice->m_Uid >= 1); + CHECK(multiCoreDevice->m_Cores == 4); // Register a counter with a valid parent category name and associated to the multi-core device const Counter* counterWMultiCoreDevice = nullptr; - BOOST_CHECK_NO_THROW(counterWMultiCoreDevice = counterDirectory.RegisterCounter( + CHECK_NOTHROW(counterWMultiCoreDevice = counterDirectory.RegisterCounter( armnn::profiling::BACKEND_ID, 19, categoryName, 0, 1, 123.45f, "valid name 9", "valid description", armnn::EmptyOptional(), // Units armnn::EmptyOptional(), // Number of cores multiCoreDevice->m_Uid, // Device UID armnn::EmptyOptional())); // Counter set UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 24); - BOOST_CHECK(counterWMultiCoreDevice); - BOOST_CHECK(counterWMultiCoreDevice->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWMultiCoreDevice->m_MaxCounterUid == + CHECK(counterDirectory.GetCounterCount() == 24); + CHECK(counterWMultiCoreDevice); + CHECK(counterWMultiCoreDevice->m_Uid > counter->m_Uid); + CHECK(counterWMultiCoreDevice->m_MaxCounterUid == counterWMultiCoreDevice->m_Uid + multiCoreDevice->m_Cores - 1); - BOOST_CHECK(counterWMultiCoreDevice->m_Class == 0); - BOOST_CHECK(counterWMultiCoreDevice->m_Interpolation == 1); - BOOST_CHECK(counterWMultiCoreDevice->m_Multiplier == 123.45f); - BOOST_CHECK(counterWMultiCoreDevice->m_Name == "valid name 9"); - BOOST_CHECK(counterWMultiCoreDevice->m_Description == "valid description"); - BOOST_CHECK(counterWMultiCoreDevice->m_Units == ""); - BOOST_CHECK(counterWMultiCoreDevice->m_DeviceUid == multiCoreDevice->m_Uid); - BOOST_CHECK(counterWMultiCoreDevice->m_CounterSetUid == 0); - BOOST_CHECK(category->m_Counters.size() == 24); + CHECK(counterWMultiCoreDevice->m_Class == 0); + CHECK(counterWMultiCoreDevice->m_Interpolation == 1); + CHECK(counterWMultiCoreDevice->m_Multiplier == 123.45f); + CHECK(counterWMultiCoreDevice->m_Name == "valid name 9"); + CHECK(counterWMultiCoreDevice->m_Description == "valid description"); + CHECK(counterWMultiCoreDevice->m_Units == ""); + CHECK(counterWMultiCoreDevice->m_DeviceUid == multiCoreDevice->m_Uid); + CHECK(counterWMultiCoreDevice->m_CounterSetUid == 0); + CHECK(category->m_Counters.size() == 24); for (size_t i = 0; i < 4; i++) { - BOOST_CHECK(category->m_Counters[category->m_Counters.size() - 4 + i] == counterWMultiCoreDevice->m_Uid + i); + CHECK(category->m_Counters[category->m_Counters.size() - 4 + i] == counterWMultiCoreDevice->m_Uid + i); } // Register a multi-core device associate to a parent category for testing const std::string multiCoreDeviceNameWParentCategory = "some_multi_core_device_with_parent_category"; const Device* multiCoreDeviceWParentCategory = nullptr; - BOOST_CHECK_NO_THROW(multiCoreDeviceWParentCategory = + CHECK_NOTHROW(multiCoreDeviceWParentCategory = counterDirectory.RegisterDevice(multiCoreDeviceNameWParentCategory, 2, categoryName)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 3); - BOOST_CHECK(multiCoreDeviceWParentCategory); - BOOST_CHECK(multiCoreDeviceWParentCategory->m_Name == multiCoreDeviceNameWParentCategory); - BOOST_CHECK(multiCoreDeviceWParentCategory->m_Uid >= 1); - BOOST_CHECK(multiCoreDeviceWParentCategory->m_Cores == 2); + CHECK(counterDirectory.GetDeviceCount() == 3); + CHECK(multiCoreDeviceWParentCategory); + CHECK(multiCoreDeviceWParentCategory->m_Name == multiCoreDeviceNameWParentCategory); + CHECK(multiCoreDeviceWParentCategory->m_Uid >= 1); + CHECK(multiCoreDeviceWParentCategory->m_Cores == 2); // Register a counter with a valid parent category name and getting the number of cores of the multi-core device // associated to that category const Counter* counterWMultiCoreDeviceWParentCategory = nullptr; uint16_t numberOfCourse = multiCoreDeviceWParentCategory->m_Cores; - BOOST_CHECK_NO_THROW(counterWMultiCoreDeviceWParentCategory = + CHECK_NOTHROW(counterWMultiCoreDeviceWParentCategory = counterDirectory.RegisterCounter( armnn::profiling::BACKEND_ID, 100, @@ -1637,117 +1639,117 @@ BOOST_AUTO_TEST_CASE(CheckCounterDirectoryRegisterCounter) numberOfCourse, // Number of cores armnn::EmptyOptional(), // Device UID armnn::EmptyOptional()));// Counter set UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 26); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_MaxCounterUid == + CHECK(counterDirectory.GetCounterCount() == 26); + CHECK(counterWMultiCoreDeviceWParentCategory); + CHECK(counterWMultiCoreDeviceWParentCategory->m_Uid > counter->m_Uid); + CHECK(counterWMultiCoreDeviceWParentCategory->m_MaxCounterUid == counterWMultiCoreDeviceWParentCategory->m_Uid + multiCoreDeviceWParentCategory->m_Cores - 1); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Class == 0); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Interpolation == 1); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Multiplier == 123.45f); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Name == "valid name 10"); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Description == "valid description"); - BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Units == ""); - BOOST_CHECK(category->m_Counters.size() == 26); + CHECK(counterWMultiCoreDeviceWParentCategory->m_Class == 0); + CHECK(counterWMultiCoreDeviceWParentCategory->m_Interpolation == 1); + CHECK(counterWMultiCoreDeviceWParentCategory->m_Multiplier == 123.45f); + CHECK(counterWMultiCoreDeviceWParentCategory->m_Name == "valid name 10"); + CHECK(counterWMultiCoreDeviceWParentCategory->m_Description == "valid description"); + CHECK(counterWMultiCoreDeviceWParentCategory->m_Units == ""); + CHECK(category->m_Counters.size() == 26); for (size_t i = 0; i < 2; i++) { - BOOST_CHECK(category->m_Counters[category->m_Counters.size() - 2 + i] == + CHECK(category->m_Counters[category->m_Counters.size() - 2 + i] == counterWMultiCoreDeviceWParentCategory->m_Uid + i); } // Register a counter set for testing const std::string counterSetName = "some_counter_set"; const CounterSet* counterSet = nullptr; - BOOST_CHECK_NO_THROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(counterSet); - BOOST_CHECK(counterSet->m_Name == counterSetName); - BOOST_CHECK(counterSet->m_Uid >= 1); - BOOST_CHECK(counterSet->m_Count == 0); + CHECK_NOTHROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(counterSet); + CHECK(counterSet->m_Name == counterSetName); + CHECK(counterSet->m_Uid >= 1); + CHECK(counterSet->m_Count == 0); // Register a counter with a valid parent category name and associated to a counter set const Counter* counterWCounterSet = nullptr; - BOOST_CHECK_NO_THROW(counterWCounterSet = counterDirectory.RegisterCounter( + CHECK_NOTHROW(counterWCounterSet = counterDirectory.RegisterCounter( armnn::profiling::BACKEND_ID, 300, categoryName, 0, 1, 123.45f, "valid name 11", "valid description", armnn::EmptyOptional(), // Units 0, // Number of cores armnn::EmptyOptional(), // Device UID counterSet->m_Uid)); // Counter set UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 27); - BOOST_CHECK(counterWCounterSet); - BOOST_CHECK(counterWCounterSet->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWCounterSet->m_MaxCounterUid == counterWCounterSet->m_Uid); - BOOST_CHECK(counterWCounterSet->m_Class == 0); - BOOST_CHECK(counterWCounterSet->m_Interpolation == 1); - BOOST_CHECK(counterWCounterSet->m_Multiplier == 123.45f); - BOOST_CHECK(counterWCounterSet->m_Name == "valid name 11"); - BOOST_CHECK(counterWCounterSet->m_Description == "valid description"); - BOOST_CHECK(counterWCounterSet->m_Units == ""); - BOOST_CHECK(counterWCounterSet->m_DeviceUid == 0); - BOOST_CHECK(counterWCounterSet->m_CounterSetUid == counterSet->m_Uid); - BOOST_CHECK(category->m_Counters.size() == 27); - BOOST_CHECK(category->m_Counters.back() == counterWCounterSet->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 27); + CHECK(counterWCounterSet); + CHECK(counterWCounterSet->m_Uid > counter->m_Uid); + CHECK(counterWCounterSet->m_MaxCounterUid == counterWCounterSet->m_Uid); + CHECK(counterWCounterSet->m_Class == 0); + CHECK(counterWCounterSet->m_Interpolation == 1); + CHECK(counterWCounterSet->m_Multiplier == 123.45f); + CHECK(counterWCounterSet->m_Name == "valid name 11"); + CHECK(counterWCounterSet->m_Description == "valid description"); + CHECK(counterWCounterSet->m_Units == ""); + CHECK(counterWCounterSet->m_DeviceUid == 0); + CHECK(counterWCounterSet->m_CounterSetUid == counterSet->m_Uid); + CHECK(category->m_Counters.size() == 27); + CHECK(category->m_Counters.back() == counterWCounterSet->m_Uid); // Register a counter with a valid parent category name and associated to a device and a counter set const Counter* counterWDeviceWCounterSet = nullptr; - BOOST_CHECK_NO_THROW(counterWDeviceWCounterSet = counterDirectory.RegisterCounter( + CHECK_NOTHROW(counterWDeviceWCounterSet = counterDirectory.RegisterCounter( armnn::profiling::BACKEND_ID, 23, categoryName, 0, 1, 123.45f, "valid name 12", "valid description", armnn::EmptyOptional(), // Units 1, // Number of cores device->m_Uid, // Device UID counterSet->m_Uid)); // Counter set UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 28); - BOOST_CHECK(counterWDeviceWCounterSet); - BOOST_CHECK(counterWDeviceWCounterSet->m_Uid > counter->m_Uid); - BOOST_CHECK(counterWDeviceWCounterSet->m_MaxCounterUid == counterWDeviceWCounterSet->m_Uid); - BOOST_CHECK(counterWDeviceWCounterSet->m_Class == 0); - BOOST_CHECK(counterWDeviceWCounterSet->m_Interpolation == 1); - BOOST_CHECK(counterWDeviceWCounterSet->m_Multiplier == 123.45f); - BOOST_CHECK(counterWDeviceWCounterSet->m_Name == "valid name 12"); - BOOST_CHECK(counterWDeviceWCounterSet->m_Description == "valid description"); - BOOST_CHECK(counterWDeviceWCounterSet->m_Units == ""); - BOOST_CHECK(counterWDeviceWCounterSet->m_DeviceUid == device->m_Uid); - BOOST_CHECK(counterWDeviceWCounterSet->m_CounterSetUid == counterSet->m_Uid); - BOOST_CHECK(category->m_Counters.size() == 28); - BOOST_CHECK(category->m_Counters.back() == counterWDeviceWCounterSet->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 28); + CHECK(counterWDeviceWCounterSet); + CHECK(counterWDeviceWCounterSet->m_Uid > counter->m_Uid); + CHECK(counterWDeviceWCounterSet->m_MaxCounterUid == counterWDeviceWCounterSet->m_Uid); + CHECK(counterWDeviceWCounterSet->m_Class == 0); + CHECK(counterWDeviceWCounterSet->m_Interpolation == 1); + CHECK(counterWDeviceWCounterSet->m_Multiplier == 123.45f); + CHECK(counterWDeviceWCounterSet->m_Name == "valid name 12"); + CHECK(counterWDeviceWCounterSet->m_Description == "valid description"); + CHECK(counterWDeviceWCounterSet->m_Units == ""); + CHECK(counterWDeviceWCounterSet->m_DeviceUid == device->m_Uid); + CHECK(counterWDeviceWCounterSet->m_CounterSetUid == counterSet->m_Uid); + CHECK(category->m_Counters.size() == 28); + CHECK(category->m_Counters.back() == counterWDeviceWCounterSet->m_Uid); // Register another category for testing const std::string anotherCategoryName = "some_other_category"; const Category* anotherCategory = nullptr; - BOOST_CHECK_NO_THROW(anotherCategory = counterDirectory.RegisterCategory(anotherCategoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 2); - BOOST_CHECK(anotherCategory); - BOOST_CHECK(anotherCategory != category); - BOOST_CHECK(anotherCategory->m_Name == anotherCategoryName); - BOOST_CHECK(anotherCategory->m_Counters.empty()); + CHECK_NOTHROW(anotherCategory = counterDirectory.RegisterCategory(anotherCategoryName)); + CHECK(counterDirectory.GetCategoryCount() == 2); + CHECK(anotherCategory); + CHECK(anotherCategory != category); + CHECK(anotherCategory->m_Name == anotherCategoryName); + CHECK(anotherCategory->m_Counters.empty()); // Register a counter to the other category const Counter* anotherCounter = nullptr; - BOOST_CHECK_NO_THROW(anotherCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 24, + CHECK_NOTHROW(anotherCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 24, anotherCategoryName, 1, 0, .00043f, "valid name", "valid description", armnn::EmptyOptional(), // Units armnn::EmptyOptional(), // Number of cores device->m_Uid, // Device UID counterSet->m_Uid)); // Counter set UID - BOOST_CHECK(counterDirectory.GetCounterCount() == 29); - BOOST_CHECK(anotherCounter); - BOOST_CHECK(anotherCounter->m_MaxCounterUid == anotherCounter->m_Uid); - BOOST_CHECK(anotherCounter->m_Class == 1); - BOOST_CHECK(anotherCounter->m_Interpolation == 0); - BOOST_CHECK(anotherCounter->m_Multiplier == .00043f); - BOOST_CHECK(anotherCounter->m_Name == "valid name"); - BOOST_CHECK(anotherCounter->m_Description == "valid description"); - BOOST_CHECK(anotherCounter->m_Units == ""); - BOOST_CHECK(anotherCounter->m_DeviceUid == device->m_Uid); - BOOST_CHECK(anotherCounter->m_CounterSetUid == counterSet->m_Uid); - BOOST_CHECK(anotherCategory->m_Counters.size() == 1); - BOOST_CHECK(anotherCategory->m_Counters.back() == anotherCounter->m_Uid); + CHECK(counterDirectory.GetCounterCount() == 29); + CHECK(anotherCounter); + CHECK(anotherCounter->m_MaxCounterUid == anotherCounter->m_Uid); + CHECK(anotherCounter->m_Class == 1); + CHECK(anotherCounter->m_Interpolation == 0); + CHECK(anotherCounter->m_Multiplier == .00043f); + CHECK(anotherCounter->m_Name == "valid name"); + CHECK(anotherCounter->m_Description == "valid description"); + CHECK(anotherCounter->m_Units == ""); + CHECK(anotherCounter->m_DeviceUid == device->m_Uid); + CHECK(anotherCounter->m_CounterSetUid == counterSet->m_Uid); + CHECK(anotherCategory->m_Counters.size() == 1); + CHECK(anotherCategory->m_Counters.back() == anotherCounter->m_Uid); } -BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData) +TEST_CASE("CounterSelectionCommandHandlerParseData") { ProfilingStateMachine profilingStateMachine; @@ -1819,20 +1821,20 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData) readCounterValues, sendCounterPacket, profilingStateMachine); profilingStateMachine.TransitionToState(ProfilingState::Uninitialised); - BOOST_CHECK_THROW(commandHandler(packetA), armnn::RuntimeException); + CHECK_THROWS_AS(commandHandler(packetA), armnn::RuntimeException); profilingStateMachine.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK_THROW(commandHandler(packetA), armnn::RuntimeException); + CHECK_THROWS_AS(commandHandler(packetA), armnn::RuntimeException); profilingStateMachine.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK_THROW(commandHandler(packetA), armnn::RuntimeException); + CHECK_THROWS_AS(commandHandler(packetA), armnn::RuntimeException); profilingStateMachine.TransitionToState(ProfilingState::Active); - BOOST_CHECK_NO_THROW(commandHandler(packetA)); + CHECK_NOTHROW(commandHandler(packetA)); const std::vector counterIdsA = holder.GetCaptureData().GetCounterIds(); - BOOST_TEST(holder.GetCaptureData().GetCapturePeriod() == period1); - BOOST_TEST(counterIdsA.size() == 2); - BOOST_TEST(counterIdsA[0] == 4000); - BOOST_TEST(counterIdsA[1] == 5000); + CHECK(holder.GetCaptureData().GetCapturePeriod() == period1); + CHECK(counterIdsA.size() == 2); + CHECK(counterIdsA[0] == 4000); + CHECK(counterIdsA[1] == 5000); auto readBuffer = mockBuffer.GetReadableBuffer(); @@ -1844,18 +1846,18 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData) offset += sizeOfUint32; uint32_t period = ReadUint32(readBuffer, offset); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family - BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 4); // packet id - BOOST_TEST(headerWord1 == 8); // data length - BOOST_TEST(period == armnn::LOWEST_CAPTURE_PERIOD); // capture period + CHECK(((headerWord0 >> 26) & 0x3F) == 0); // packet family + CHECK(((headerWord0 >> 16) & 0x3FF) == 4); // packet id + CHECK(headerWord1 == 8); // data length + CHECK(period == armnn::LOWEST_CAPTURE_PERIOD); // capture period uint16_t counterId = 0; offset += sizeOfUint32; counterId = ReadUint16(readBuffer, offset); - BOOST_TEST(counterId == 4000); + CHECK(counterId == 4000); offset += sizeOfUint16; counterId = ReadUint16(readBuffer, offset); - BOOST_TEST(counterId == 5000); + CHECK(counterId == 5000); mockBuffer.MarkRead(readBuffer); @@ -1874,8 +1876,8 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData) const std::vector counterIdsB = holder.GetCaptureData().GetCounterIds(); // Value should have been pulled up from 9000 to LOWEST_CAPTURE_PERIOD. - BOOST_TEST(holder.GetCaptureData().GetCapturePeriod() == armnn::LOWEST_CAPTURE_PERIOD); - BOOST_TEST(counterIdsB.size() == 0); + CHECK(holder.GetCaptureData().GetCapturePeriod() == armnn::LOWEST_CAPTURE_PERIOD); + CHECK(counterIdsB.size() == 0); readBuffer = mockBuffer.GetReadableBuffer(); @@ -1887,13 +1889,13 @@ BOOST_AUTO_TEST_CASE(CounterSelectionCommandHandlerParseData) offset += sizeOfUint32; period = ReadUint32(readBuffer, offset); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family - BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 4); // packet id - BOOST_TEST(headerWord1 == 4); // data length - BOOST_TEST(period == armnn::LOWEST_CAPTURE_PERIOD); // capture period + CHECK(((headerWord0 >> 26) & 0x3F) == 0); // packet family + CHECK(((headerWord0 >> 16) & 0x3FF) == 4); // packet id + CHECK(headerWord1 == 4); // data length + CHECK(period == armnn::LOWEST_CAPTURE_PERIOD); // capture period } -BOOST_AUTO_TEST_CASE(CheckTimelineActivationAndDeactivation) +TEST_CASE("CheckTimelineActivationAndDeactivation") { class TestReportStructure : public IReportStructure { @@ -1946,23 +1948,23 @@ BOOST_AUTO_TEST_CASE(CheckTimelineActivationAndDeactivation) // Create the ActivateTimelineReportingPacket arm::pipe::Packet ActivateTimelineReportingPacket(packetHeader1); // Length == 0 - BOOST_CHECK_THROW( + CHECK_THROWS_AS( activateTimelineReportingCommandHandler.operator()(ActivateTimelineReportingPacket), armnn::Exception); stateMachine.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK_THROW( + CHECK_THROWS_AS( activateTimelineReportingCommandHandler.operator()(ActivateTimelineReportingPacket), armnn::Exception); stateMachine.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK_THROW( + CHECK_THROWS_AS( activateTimelineReportingCommandHandler.operator()(ActivateTimelineReportingPacket), armnn::Exception); stateMachine.TransitionToState(ProfilingState::Active); activateTimelineReportingCommandHandler.operator()(ActivateTimelineReportingPacket); - BOOST_CHECK(testReportStructure.m_ReportStructureCalled); - BOOST_CHECK(testNotifyBackends.m_TestNotifyBackendsCalled); - BOOST_CHECK(testNotifyBackends.m_timelineReporting.load()); + CHECK(testReportStructure.m_ReportStructureCalled); + CHECK(testNotifyBackends.m_TestNotifyBackendsCalled); + CHECK(testNotifyBackends.m_timelineReporting.load()); DeactivateTimelineReportingCommandHandler deactivateTimelineReportingCommandHandler(0, 7, @@ -1979,25 +1981,25 @@ BOOST_AUTO_TEST_CASE(CheckTimelineActivationAndDeactivation) arm::pipe::Packet deactivateTimelineReportingPacket(packetHeader2); // Length == 0 stateMachine.Reset(); - BOOST_CHECK_THROW( + CHECK_THROWS_AS( deactivateTimelineReportingCommandHandler.operator()(deactivateTimelineReportingPacket), armnn::Exception); stateMachine.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK_THROW( + CHECK_THROWS_AS( deactivateTimelineReportingCommandHandler.operator()(deactivateTimelineReportingPacket), armnn::Exception); stateMachine.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK_THROW( + CHECK_THROWS_AS( deactivateTimelineReportingCommandHandler.operator()(deactivateTimelineReportingPacket), armnn::Exception); stateMachine.TransitionToState(ProfilingState::Active); deactivateTimelineReportingCommandHandler.operator()(deactivateTimelineReportingPacket); - BOOST_CHECK(!testNotifyBackends.m_TestNotifyBackendsCalled); - BOOST_CHECK(!testNotifyBackends.m_timelineReporting.load()); + CHECK(!testNotifyBackends.m_TestNotifyBackendsCalled); + CHECK(!testNotifyBackends.m_timelineReporting.load()); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceNotActive) +TEST_CASE("CheckProfilingServiceNotActive") { using namespace armnn; using namespace armnn::profiling; @@ -2016,10 +2018,10 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceNotActive) auto readableBuffer = bufferManager.GetReadableBuffer(); // Profiling is enabled, the post-optimisation structure should be created - BOOST_CHECK(readableBuffer == nullptr); + CHECK(readableBuffer == nullptr); } -BOOST_AUTO_TEST_CASE(CheckConnectionAcknowledged) +TEST_CASE("CheckConnectionAcknowledged") { const uint32_t packetFamilyId = 0; const uint32_t connectionPacketId = 0x10000; @@ -2045,7 +2047,7 @@ BOOST_AUTO_TEST_CASE(CheckConnectionAcknowledged) arm::pipe::Packet packetA(connectionPacketId, dataLength1, uniqueData1); ProfilingStateMachine profilingState(ProfilingState::Uninitialised); - BOOST_CHECK(profilingState.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingState.GetCurrentState() == ProfilingState::Uninitialised); CounterDirectory counterDirectory; MockBufferManager mockBuffer(1024); SendCounterPacket sendCounterPacket(mockBuffer); @@ -2063,22 +2065,22 @@ BOOST_AUTO_TEST_CASE(CheckConnectionAcknowledged) mockProfilingServiceStatus); // command handler received packet on ProfilingState::Uninitialised - BOOST_CHECK_THROW(commandHandler(packetA), armnn::Exception); + CHECK_THROWS_AS(commandHandler(packetA), armnn::Exception); profilingState.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK(profilingState.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingState.GetCurrentState() == ProfilingState::NotConnected); // command handler received packet on ProfilingState::NotConnected - BOOST_CHECK_THROW(commandHandler(packetA), armnn::Exception); + CHECK_THROWS_AS(commandHandler(packetA), armnn::Exception); profilingState.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK(profilingState.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingState.GetCurrentState() == ProfilingState::WaitingForAck); // command handler received packet on ProfilingState::WaitingForAck - BOOST_CHECK_NO_THROW(commandHandler(packetA)); - BOOST_CHECK(profilingState.GetCurrentState() == ProfilingState::Active); + CHECK_NOTHROW(commandHandler(packetA)); + CHECK(profilingState.GetCurrentState() == ProfilingState::Active); // command handler received packet on ProfilingState::Active - BOOST_CHECK_NO_THROW(commandHandler(packetA)); - BOOST_CHECK(profilingState.GetCurrentState() == ProfilingState::Active); + CHECK_NOTHROW(commandHandler(packetA)); + CHECK(profilingState.GetCurrentState() == ProfilingState::Active); // command handler received different packet const uint32_t differentPacketId = 0x40000; @@ -2093,16 +2095,16 @@ BOOST_AUTO_TEST_CASE(CheckConnectionAcknowledged) sendTimelinePacket, profilingState, mockProfilingServiceStatus); - BOOST_CHECK_THROW(differentCommandHandler(packetB), armnn::Exception); + CHECK_THROWS_AS(differentCommandHandler(packetB), armnn::Exception); } -BOOST_AUTO_TEST_CASE(CheckSocketConnectionException) +TEST_CASE("CheckSocketConnectionException") { // Check that creating a SocketProfilingConnection armnnProfiling in an exception as the Gator UDS doesn't exist. - BOOST_CHECK_THROW(new SocketProfilingConnection(), arm::pipe::SocketConnectionException); + CHECK_THROWS_AS(new SocketProfilingConnection(), arm::pipe::SocketConnectionException); } -BOOST_AUTO_TEST_CASE(CheckSocketConnectionException2) +TEST_CASE("CheckSocketConnectionException2") { try { @@ -2110,128 +2112,128 @@ BOOST_AUTO_TEST_CASE(CheckSocketConnectionException2) } catch (const arm::pipe::SocketConnectionException& ex) { - BOOST_CHECK(ex.GetSocketFd() == 0); - BOOST_CHECK(ex.GetErrorNo() == ECONNREFUSED); - BOOST_CHECK(ex.what() + CHECK(ex.GetSocketFd() == 0); + CHECK(ex.GetErrorNo() == ECONNREFUSED); + CHECK(ex.what() == std::string("SocketProfilingConnection: Cannot connect to stream socket: Connection refused")); } } -BOOST_AUTO_TEST_CASE(SwTraceIsValidCharTest) +TEST_CASE("SwTraceIsValidCharTest") { // Only ASCII 7-bit encoding supported for (unsigned char c = 0; c < 128; c++) { - BOOST_CHECK(arm::pipe::SwTraceCharPolicy::IsValidChar(c)); + CHECK(arm::pipe::SwTraceCharPolicy::IsValidChar(c)); } // Not ASCII for (unsigned char c = 255; c >= 128; c++) { - BOOST_CHECK(!arm::pipe::SwTraceCharPolicy::IsValidChar(c)); + CHECK(!arm::pipe::SwTraceCharPolicy::IsValidChar(c)); } } -BOOST_AUTO_TEST_CASE(SwTraceIsValidNameCharTest) +TEST_CASE("SwTraceIsValidNameCharTest") { // Only alpha-numeric and underscore ASCII 7-bit encoding supported const unsigned char validChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; for (unsigned char i = 0; i < sizeof(validChars) / sizeof(validChars[0]) - 1; i++) { - BOOST_CHECK(arm::pipe::SwTraceNameCharPolicy::IsValidChar(validChars[i])); + CHECK(arm::pipe::SwTraceNameCharPolicy::IsValidChar(validChars[i])); } // Non alpha-numeric chars for (unsigned char c = 0; c < 48; c++) { - BOOST_CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); + CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); } for (unsigned char c = 58; c < 65; c++) { - BOOST_CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); + CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); } for (unsigned char c = 91; c < 95; c++) { - BOOST_CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); + CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); } for (unsigned char c = 96; c < 97; c++) { - BOOST_CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); + CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); } for (unsigned char c = 123; c < 128; c++) { - BOOST_CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); + CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); } // Not ASCII for (unsigned char c = 255; c >= 128; c++) { - BOOST_CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); + CHECK(!arm::pipe::SwTraceNameCharPolicy::IsValidChar(c)); } } -BOOST_AUTO_TEST_CASE(IsValidSwTraceStringTest) +TEST_CASE("IsValidSwTraceStringTest") { // Valid SWTrace strings - BOOST_CHECK(arm::pipe::IsValidSwTraceString("")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("_")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("0123")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("valid_string")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("VALID_string_456")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString(" ")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("valid string")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("!$%")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("valid|\\~string#123")); + CHECK(arm::pipe::IsValidSwTraceString("")); + CHECK(arm::pipe::IsValidSwTraceString("_")); + CHECK(arm::pipe::IsValidSwTraceString("0123")); + CHECK(arm::pipe::IsValidSwTraceString("valid_string")); + CHECK(arm::pipe::IsValidSwTraceString("VALID_string_456")); + CHECK(arm::pipe::IsValidSwTraceString(" ")); + CHECK(arm::pipe::IsValidSwTraceString("valid string")); + CHECK(arm::pipe::IsValidSwTraceString("!$%")); + CHECK(arm::pipe::IsValidSwTraceString("valid|\\~string#123")); // Invalid SWTrace strings - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("€£")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("invalid‡string")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("12Ž34")); + CHECK(!arm::pipe::IsValidSwTraceString("€£")); + CHECK(!arm::pipe::IsValidSwTraceString("invalid‡string")); + CHECK(!arm::pipe::IsValidSwTraceString("12Ž34")); } -BOOST_AUTO_TEST_CASE(IsValidSwTraceNameStringTest) +TEST_CASE("IsValidSwTraceNameStringTest") { // Valid SWTrace name strings - BOOST_CHECK(arm::pipe::IsValidSwTraceString("")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("_")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("0123")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("valid_string")); - BOOST_CHECK(arm::pipe::IsValidSwTraceString("VALID_string_456")); + CHECK(arm::pipe::IsValidSwTraceString("")); + CHECK(arm::pipe::IsValidSwTraceString("_")); + CHECK(arm::pipe::IsValidSwTraceString("0123")); + CHECK(arm::pipe::IsValidSwTraceString("valid_string")); + CHECK(arm::pipe::IsValidSwTraceString("VALID_string_456")); // Invalid SWTrace name strings - BOOST_CHECK(!arm::pipe::IsValidSwTraceString(" ")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("invalid string")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("!$%")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("invalid|\\~string#123")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("€£")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("invalid‡string")); - BOOST_CHECK(!arm::pipe::IsValidSwTraceString("12Ž34")); + CHECK(!arm::pipe::IsValidSwTraceString(" ")); + CHECK(!arm::pipe::IsValidSwTraceString("invalid string")); + CHECK(!arm::pipe::IsValidSwTraceString("!$%")); + CHECK(!arm::pipe::IsValidSwTraceString("invalid|\\~string#123")); + CHECK(!arm::pipe::IsValidSwTraceString("€£")); + CHECK(!arm::pipe::IsValidSwTraceString("invalid‡string")); + CHECK(!arm::pipe::IsValidSwTraceString("12Ž34")); } template void StringToSwTraceStringTestHelper(const std::string& testString, std::vector buffer, size_t expectedSize) { // Convert the test string to a SWTrace string - BOOST_CHECK(arm::pipe::StringToSwTraceString(testString, buffer)); + CHECK(arm::pipe::StringToSwTraceString(testString, buffer)); // The buffer must contain at least the length of the string - BOOST_CHECK(!buffer.empty()); + CHECK(!buffer.empty()); // The buffer must be of the expected size (in words) - BOOST_CHECK(buffer.size() == expectedSize); + CHECK(buffer.size() == expectedSize); // The first word of the byte must be the length of the string including the null-terminator - BOOST_CHECK(buffer[0] == testString.size() + 1); + CHECK(buffer[0] == testString.size() + 1); // The contents of the buffer must match the test string - BOOST_CHECK(std::memcmp(testString.data(), buffer.data() + 1, testString.size()) == 0); + CHECK(std::memcmp(testString.data(), buffer.data() + 1, testString.size()) == 0); // The buffer must include the null-terminator at the end of the string size_t nullTerminatorIndex = sizeof(uint32_t) + testString.size(); - BOOST_CHECK(reinterpret_cast(buffer.data())[nullTerminatorIndex] == '\0'); + CHECK(reinterpret_cast(buffer.data())[nullTerminatorIndex] == '\0'); } -BOOST_AUTO_TEST_CASE(StringToSwTraceStringTest) +TEST_CASE("StringToSwTraceStringTest") { std::vector buffer; @@ -2247,15 +2249,15 @@ BOOST_AUTO_TEST_CASE(StringToSwTraceStringTest) StringToSwTraceStringTestHelper("valid|\\~string#123", buffer, 6); // Invalid SWTrace strings - BOOST_CHECK(!arm::pipe::StringToSwTraceString("€£", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("invalid‡string", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("12Ž34", buffer)); - BOOST_CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("€£", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("invalid‡string", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("12Ž34", buffer)); + CHECK(buffer.empty()); } -BOOST_AUTO_TEST_CASE(StringToSwTraceNameStringTest) +TEST_CASE("StringToSwTraceNameStringTest") { std::vector buffer; @@ -2267,23 +2269,23 @@ BOOST_AUTO_TEST_CASE(StringToSwTraceNameStringTest) StringToSwTraceStringTestHelper("VALID_string_456", buffer, 6); // Invalid SWTrace namestrings - BOOST_CHECK(!arm::pipe::StringToSwTraceString(" ", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("invalid string", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("!$%", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("invalid|\\~string#123", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("€£", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("invalid‡string", buffer)); - BOOST_CHECK(buffer.empty()); - BOOST_CHECK(!arm::pipe::StringToSwTraceString("12Ž34", buffer)); - BOOST_CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString(" ", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("invalid string", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("!$%", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("invalid|\\~string#123", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("€£", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("invalid‡string", buffer)); + CHECK(buffer.empty()); + CHECK(!arm::pipe::StringToSwTraceString("12Ž34", buffer)); + CHECK(buffer.empty()); } -BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread) +TEST_CASE("CheckPeriodicCounterCaptureThread") { class CaptureReader : public IReadCounterValues { @@ -2312,7 +2314,7 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread) { if (counterUid > m_CounterSize) { - BOOST_FAIL("Invalid counter Uid"); + FAIL("Invalid counter Uid"); } return m_Data.at(counterUid).load(); } @@ -2321,7 +2323,7 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread) { if (counterUid > m_CounterSize) { - BOOST_FAIL("Invalid counter Uid"); + FAIL("Invalid counter Uid"); } return m_Data.at(counterUid).load(); } @@ -2330,7 +2332,7 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread) { if (counterUid > m_CounterSize) { - BOOST_FAIL("Invalid counter Uid"); + FAIL("Invalid counter Uid"); } m_Data.at(counterUid).store(value); } @@ -2378,29 +2380,29 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread) uint32_t headerWord0 = ReadUint32(buffer, 0); uint32_t headerWord1 = ReadUint32(buffer, 4); - BOOST_TEST(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family - BOOST_TEST(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class - BOOST_TEST(((headerWord0 >> 16) & 0x00000007) == 0); // packet type - BOOST_TEST(headerWord1 == 20); + CHECK(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family + CHECK(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class + CHECK(((headerWord0 >> 16) & 0x00000007) == 0); // packet type + CHECK(headerWord1 == 20); uint32_t offset = 16; uint16_t readIndex = ReadUint16(buffer, offset); - BOOST_TEST(0 == readIndex); + CHECK(0 == readIndex); offset += 2; uint32_t readValue = ReadUint32(buffer, offset); - BOOST_TEST((valueA * numSteps) == readValue); + CHECK((valueA * numSteps) == readValue); offset += 4; readIndex = ReadUint16(buffer, offset); - BOOST_TEST(1 == readIndex); + CHECK(1 == readIndex); offset += 2; readValue = ReadUint32(buffer, offset); - BOOST_TEST((valueB * numSteps) == readValue); + CHECK((valueB * numSteps) == readValue); } -BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest1) +TEST_CASE("RequestCounterDirectoryCommandHandlerTest1") { const uint32_t familyId = 0; const uint32_t packetId = 3; @@ -2421,19 +2423,19 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest1) arm::pipe::Packet wrongPacket(wrongHeader); profilingStateMachine.TransitionToState(ProfilingState::Uninitialised); - BOOST_CHECK_THROW(commandHandler(wrongPacket), armnn::RuntimeException); // Wrong profiling state + CHECK_THROWS_AS(commandHandler(wrongPacket), armnn::RuntimeException); // Wrong profiling state profilingStateMachine.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK_THROW(commandHandler(wrongPacket), armnn::RuntimeException); // Wrong profiling state + CHECK_THROWS_AS(commandHandler(wrongPacket), armnn::RuntimeException); // Wrong profiling state profilingStateMachine.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK_THROW(commandHandler(wrongPacket), armnn::RuntimeException); // Wrong profiling state + CHECK_THROWS_AS(commandHandler(wrongPacket), armnn::RuntimeException); // Wrong profiling state profilingStateMachine.TransitionToState(ProfilingState::Active); - BOOST_CHECK_THROW(commandHandler(wrongPacket), armnn::InvalidArgumentException); // Wrong packet + CHECK_THROWS_AS(commandHandler(wrongPacket), armnn::InvalidArgumentException); // Wrong packet const uint32_t rightHeader = (packetId & 0x000003FF) << 16; arm::pipe::Packet rightPacket(rightHeader); - BOOST_CHECK_NO_THROW(commandHandler(rightPacket)); // Right packet + CHECK_NOTHROW(commandHandler(rightPacket)); // Right packet auto readBuffer1 = mockBuffer1.GetReadableBuffer(); @@ -2441,13 +2443,13 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest1) uint32_t header1Word1 = ReadUint32(readBuffer1, 4); // Counter directory packet - BOOST_TEST(((header1Word0 >> 26) & 0x0000003F) == 0); // packet family - BOOST_TEST(((header1Word0 >> 16) & 0x000003FF) == 2); // packet id - BOOST_TEST(header1Word1 == 24); // data length + CHECK(((header1Word0 >> 26) & 0x0000003F) == 0); // packet family + CHECK(((header1Word0 >> 16) & 0x000003FF) == 2); // packet id + CHECK(header1Word1 == 24); // data length uint32_t bodyHeader1Word0 = ReadUint32(readBuffer1, 8); uint16_t deviceRecordCount = armnn::numeric_cast(bodyHeader1Word0 >> 16); - BOOST_TEST(deviceRecordCount == 0); // device_records_count + CHECK(deviceRecordCount == 0); // device_records_count auto readBuffer2 = mockBuffer2.GetReadableBuffer(); @@ -2455,12 +2457,12 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest1) uint32_t header2Word1 = ReadUint32(readBuffer2, 4); // Timeline message directory packet - BOOST_TEST(((header2Word0 >> 26) & 0x0000003F) == 1); // packet family - BOOST_TEST(((header2Word0 >> 16) & 0x000003FF) == 0); // packet id - BOOST_TEST(header2Word1 == 443); // data length + CHECK(((header2Word0 >> 26) & 0x0000003F) == 1); // packet family + CHECK(((header2Word0 >> 16) & 0x000003FF) == 0); // packet id + CHECK(header2Word1 == 443); // data length } -BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest2) +TEST_CASE("RequestCounterDirectoryCommandHandlerTest2") { const uint32_t familyId = 0; const uint32_t packetId = 3; @@ -2478,9 +2480,9 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest2) const arm::pipe::Packet packet(header); const Device* device = counterDirectory.RegisterDevice("deviceA", 1); - BOOST_CHECK(device != nullptr); + CHECK(device != nullptr); const CounterSet* counterSet = counterDirectory.RegisterCounterSet("countersetA"); - BOOST_CHECK(counterSet != nullptr); + CHECK(counterSet != nullptr); counterDirectory.RegisterCategory("categoryA"); counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 24, "categoryA", 0, 1, 2.0f, "counterA", "descA"); @@ -2488,22 +2490,22 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest2) "categoryA", 1, 1, 3.0f, "counterB", "descB"); profilingStateMachine.TransitionToState(ProfilingState::Uninitialised); - BOOST_CHECK_THROW(commandHandler(packet), armnn::RuntimeException); // Wrong profiling state + CHECK_THROWS_AS(commandHandler(packet), armnn::RuntimeException); // Wrong profiling state profilingStateMachine.TransitionToState(ProfilingState::NotConnected); - BOOST_CHECK_THROW(commandHandler(packet), armnn::RuntimeException); // Wrong profiling state + CHECK_THROWS_AS(commandHandler(packet), armnn::RuntimeException); // Wrong profiling state profilingStateMachine.TransitionToState(ProfilingState::WaitingForAck); - BOOST_CHECK_THROW(commandHandler(packet), armnn::RuntimeException); // Wrong profiling state + CHECK_THROWS_AS(commandHandler(packet), armnn::RuntimeException); // Wrong profiling state profilingStateMachine.TransitionToState(ProfilingState::Active); - BOOST_CHECK_NO_THROW(commandHandler(packet)); + CHECK_NOTHROW(commandHandler(packet)); auto readBuffer1 = mockBuffer1.GetReadableBuffer(); const uint32_t header1Word0 = ReadUint32(readBuffer1, 0); const uint32_t header1Word1 = ReadUint32(readBuffer1, 4); - BOOST_TEST(((header1Word0 >> 26) & 0x0000003F) == 0); // packet family - BOOST_TEST(((header1Word0 >> 16) & 0x000003FF) == 2); // packet id - BOOST_TEST(header1Word1 == 236); // data length + CHECK(((header1Word0 >> 26) & 0x0000003F) == 0); // packet family + CHECK(((header1Word0 >> 16) & 0x000003FF) == 2); // packet id + CHECK(header1Word1 == 236); // data length const uint32_t bodyHeaderSizeBytes = bodyHeaderSize * sizeof(uint32_t); @@ -2516,21 +2518,21 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest2) const uint16_t deviceRecordCount = armnn::numeric_cast(bodyHeader1Word0 >> 16); const uint16_t counterSetRecordCount = armnn::numeric_cast(bodyHeader1Word2 >> 16); const uint16_t categoryRecordCount = armnn::numeric_cast(bodyHeader1Word4 >> 16); - BOOST_TEST(deviceRecordCount == 1); // device_records_count - BOOST_TEST(bodyHeader1Word1 == 0 + bodyHeaderSizeBytes); // device_records_pointer_table_offset - BOOST_TEST(counterSetRecordCount == 1); // counter_set_count - BOOST_TEST(bodyHeader1Word3 == 4 + bodyHeaderSizeBytes); // counter_set_pointer_table_offset - BOOST_TEST(categoryRecordCount == 1); // categories_count - BOOST_TEST(bodyHeader1Word5 == 8 + bodyHeaderSizeBytes); // categories_pointer_table_offset + CHECK(deviceRecordCount == 1); // device_records_count + CHECK(bodyHeader1Word1 == 0 + bodyHeaderSizeBytes); // device_records_pointer_table_offset + CHECK(counterSetRecordCount == 1); // counter_set_count + CHECK(bodyHeader1Word3 == 4 + bodyHeaderSizeBytes); // counter_set_pointer_table_offset + CHECK(categoryRecordCount == 1); // categories_count + CHECK(bodyHeader1Word5 == 8 + bodyHeaderSizeBytes); // categories_pointer_table_offset const uint32_t deviceRecordOffset = ReadUint32(readBuffer1, 32); - BOOST_TEST(deviceRecordOffset == 12); + CHECK(deviceRecordOffset == 12); const uint32_t counterSetRecordOffset = ReadUint32(readBuffer1, 36); - BOOST_TEST(counterSetRecordOffset == 28); + CHECK(counterSetRecordOffset == 28); const uint32_t categoryRecordOffset = ReadUint32(readBuffer1, 40); - BOOST_TEST(categoryRecordOffset == 48); + CHECK(categoryRecordOffset == 48); auto readBuffer2 = mockBuffer2.GetReadableBuffer(); @@ -2538,12 +2540,12 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest2) const uint32_t header2Word1 = ReadUint32(readBuffer2, 4); // Timeline message directory packet - BOOST_TEST(((header2Word0 >> 26) & 0x0000003F) == 1); // packet family - BOOST_TEST(((header2Word0 >> 16) & 0x000003FF) == 0); // packet id - BOOST_TEST(header2Word1 == 443); // data length + CHECK(((header2Word0 >> 26) & 0x0000003F) == 1); // packet family + CHECK(((header2Word0 >> 16) & 0x000003FF) == 0); // packet id + CHECK(header2Word1 == 443); // data length } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodConnectionAcknowledgedPacket) +TEST_CASE("CheckProfilingServiceGoodConnectionAcknowledgedPacket") { unsigned int streamMetadataPacketsize = GetStreamMetaDataPacketSize(); @@ -2557,23 +2559,23 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodConnectionAcknowledgedPacket) SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "WaitingForAck" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Remove the packets received so far mockProfilingConnection->Clear(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Wait for the Stream Metadata packet to be sent - BOOST_CHECK(helper.WaitForPacketsSent( + CHECK(helper.WaitForPacketsSent( mockProfilingConnection, PacketType::StreamMetaData, streamMetadataPacketsize) >= 1); // Write a valid "Connection Acknowledged" packet into the mock profiling connection, to simulate a valid @@ -2595,17 +2597,17 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodConnectionAcknowledgedPacket) mockProfilingConnection->WritePacket(std::move(connectionAcknowledgedPacket)); // Wait for the counter directory packet to ensure the ConnectionAcknowledgedCommandHandler has run. - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::CounterDirectory) == 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::CounterDirectory) == 1); // The Connection Acknowledged Command Handler should have updated the profiling state accordingly - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodRequestCounterDirectoryPacket) +TEST_CASE("CheckProfilingServiceGoodRequestCounterDirectoryPacket") { // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; @@ -2617,20 +2619,20 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodRequestCounterDirectoryPacket) SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Force the profiling service to the "Active" state helper.ForceTransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Write a valid "Request Counter Directory" packet into the mock profiling connection, to simulate a valid // reply from an external profiling service @@ -2652,18 +2654,18 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodRequestCounterDirectoryPacket) // Expecting one CounterDirectory Packet of length 652 // and one TimelineMessageDirectory packet of length 451 - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::CounterDirectory, 652) == 1); - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::TimelineMessageDirectory, 451) == 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::CounterDirectory, 652) == 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::TimelineMessageDirectory, 451) == 1); // The Request Counter Directory Command Handler should not have updated the profiling state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadPeriodicCounterSelectionPacketInvalidCounterUid) +TEST_CASE("CheckProfilingServiceBadPeriodicCounterSelectionPacketInvalidCounterUid") { // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; @@ -2675,20 +2677,20 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadPeriodicCounterSelectionPacketInval SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Force the profiling service to the "Active" state helper.ForceTransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Remove the packets received so far mockProfilingConnection->Clear(); @@ -2710,7 +2712,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadPeriodicCounterSelectionPacketInval // Get the first valid counter UID const ICounterDirectory& counterDirectory = profilingService.GetCounterDirectory(); const Counters& counters = counterDirectory.GetCounters(); - BOOST_CHECK(counters.size() > 1); + CHECK(counters.size() > 1); uint16_t counterUidA = counters.begin()->first; // First valid counter UID uint16_t counterUidB = 9999; // Second invalid counter UID @@ -2731,18 +2733,18 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadPeriodicCounterSelectionPacketInval // Expecting one Periodic Counter Selection packet of length 14 // and at least one Periodic Counter Capture packet of length 22 - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 14) == 1); - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 22) >= 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 14) == 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 22) >= 1); // The Periodic Counter Selection Handler should not have updated the profiling state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketNoCounters) +TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketNoCounters") { // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; @@ -2754,16 +2756,16 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketNoCo SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Wait for the Stream Metadata packet the be sent // (we are not testing the connection acknowledgement here so it will be ignored by this test) @@ -2771,7 +2773,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketNoCo // Force the profiling service to the "Active" state helper.ForceTransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Write a "Periodic Counter Selection" packet into the mock profiling connection, to simulate an input from an // external profiling service @@ -2794,20 +2796,20 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketNoCo // Wait for the Periodic Counter Selection packet of length 12 to be sent // The size of the expected Periodic Counter Selection (echos the sent one) - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 12) == 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 12) == 1); // The Periodic Counter Selection Handler should not have updated the profiling state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // No Periodic Counter packets are expected - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 0, 0) == 0); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 0, 0) == 0); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketSingleCounter) +TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketSingleCounter") { // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; @@ -2819,16 +2821,16 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketSing SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Wait for the Stream Metadata packet to be sent // (we are not testing the connection acknowledgement here so it will be ignored by this test) @@ -2836,7 +2838,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketSing // Force the profiling service to the "Active" state helper.ForceTransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Write a "Periodic Counter Selection" packet into the mock profiling connection, to simulate an input from an // external profiling service @@ -2855,7 +2857,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketSing // Get the first valid counter UID const ICounterDirectory& counterDirectory = profilingService.GetCounterDirectory(); const Counters& counters = counterDirectory.GetCounters(); - BOOST_CHECK(!counters.empty()); + CHECK(!counters.empty()); uint16_t counterUid = counters.begin()->first; // Valid counter UID uint32_t length = 6; @@ -2873,18 +2875,18 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketSing // Expecting one Periodic Counter Selection packet of length 14 // and at least one Periodic Counter Capture packet of length 22 - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 14) == 1); - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 22) >= 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 14) == 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 22) >= 1); // The Periodic Counter Selection Handler should not have updated the profiling state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketMultipleCounters) +TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketMultipleCounters") { // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; @@ -2896,16 +2898,16 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketMult SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Wait for the Stream Metadata packet the be sent // (we are not testing the connection acknowledgement here so it will be ignored by this test) @@ -2913,7 +2915,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketMult // Force the profiling service to the "Active" state helper.ForceTransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Write a "Periodic Counter Selection" packet into the mock profiling connection, to simulate an input from an // external profiling service @@ -2932,7 +2934,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketMult // Get the first valid counter UID const ICounterDirectory& counterDirectory = profilingService.GetCounterDirectory(); const Counters& counters = counterDirectory.GetCounters(); - BOOST_CHECK(counters.size() > 1); + CHECK(counters.size() > 1); uint16_t counterUidA = counters.begin()->first; // First valid counter UID uint16_t counterUidB = (counters.begin()++)->first; // Second valid counter UID @@ -2952,18 +2954,18 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPeriodicCounterSelectionPacketMult // Expecting one PeriodicCounterSelection Packet with a length of 16 // And at least one PeriodicCounterCapture Packet with a length of 28 - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 16) == 1); - BOOST_CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 28) >= 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterSelection, 16) == 1); + CHECK(helper.WaitForPacketsSent(mockProfilingConnection, PacketType::PeriodicCounterCapture, 28) >= 1); // The Periodic Counter Selection Handler should not have updated the profiling state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceDisconnect) +TEST_CASE("CheckProfilingServiceDisconnect") { // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; @@ -2975,28 +2977,28 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceDisconnect) SwapProfilingConnectionFactoryHelper helper(profilingService); // Try to disconnect the profiling service while in the "Uninitialised" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Disconnect(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); // The state should not change + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); // The state should not change // Try to disconnect the profiling service while in the "NotConnected" state profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Disconnect(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); // The state should not change + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); // The state should not change // Try to disconnect the profiling service while in the "WaitingForAck" state profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Disconnect(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); // The state should not change + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); // The state should not change // Try to disconnect the profiling service while in the "Active" state profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Wait for the Stream Metadata packet the be sent // (we are not testing the connection acknowledgement here so it will be ignored by this test) @@ -3004,24 +3006,24 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceDisconnect) // Force the profiling service to the "Active" state helper.ForceTransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Check that the profiling connection is open - BOOST_CHECK(mockProfilingConnection->IsOpen()); + CHECK(mockProfilingConnection->IsOpen()); profilingService.Disconnect(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); // The state should have changed + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); // The state should have changed // Check that the profiling connection has been reset mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection == nullptr); + CHECK(mockProfilingConnection == nullptr); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPerJobCounterSelectionPacket) +TEST_CASE("CheckProfilingServiceGoodPerJobCounterSelectionPacket") { // Reset the profiling service to the uninitialized state armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; @@ -3033,16 +3035,16 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPerJobCounterSelectionPacket) SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Wait for the Stream Metadata packet the be sent // (we are not testing the connection acknowledgement here so it will be ignored by this test) @@ -3050,7 +3052,7 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPerJobCounterSelectionPacket) // Force the profiling service to the "Active" state helper.ForceTransitionToState(ProfilingState::Active); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // Write a "Per-Job Counter Selection" packet into the mock profiling connection, to simulate an input from an // external profiling service @@ -3076,47 +3078,47 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceGoodPerJobCounterSelectionPacket) std::this_thread::sleep_for(std::chrono::milliseconds(5)); // The Per-Job Counter Selection Command Handler should not have updated the profiling state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Active); + CHECK(profilingService.GetCurrentState() == ProfilingState::Active); // The Per-Job Counter Selection packets are dropped silently, so there should be no reply coming // from the profiling service const auto StreamMetaDataSize = static_cast( helper.WaitForPacketsSent(mockProfilingConnection, PacketType::StreamMetaData, 0, 0)); - BOOST_CHECK(StreamMetaDataSize == mockProfilingConnection->GetWrittenDataSize()); + CHECK(StreamMetaDataSize == mockProfilingConnection->GetWrittenDataSize()); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckConfigureProfilingServiceOn) +TEST_CASE("CheckConfigureProfilingServiceOn") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_EnableProfiling = true; armnn::profiling::ProfilingService profilingService; - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.ConfigureProfilingService(options); // should get as far as NOT_CONNECTED - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckConfigureProfilingServiceOff) +TEST_CASE("CheckConfigureProfilingServiceOff") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; armnn::profiling::ProfilingService profilingService; - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.ConfigureProfilingService(options); // should not move from Uninitialised - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceEnabled) +TEST_CASE("CheckProfilingServiceEnabled") { // Locally reduce log level to "Warning", as this test needs to parse a warning message from the standard output LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); @@ -3124,9 +3126,9 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceEnabled) options.m_EnableProfiling = true; armnn::profiling::ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); // Redirect the output to a local stream so that we can parse the warning message std::stringstream ss; @@ -3143,25 +3145,25 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceEnabled) if (ss.str().find("Cannot connect to stream socket: Connection refused") == std::string::npos) { std::cout << ss.str(); - BOOST_FAIL("Expected string not found."); + FAIL("Expected string not found."); } } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceEnabledRuntime) +TEST_CASE("CheckProfilingServiceEnabledRuntime") { // Locally reduce log level to "Warning", as this test needs to parse a warning message from the standard output LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; armnn::profiling::ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); options.m_EnableProfiling = true; profilingService.ResetExternalProfilingOptions(options); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); // Redirect the output to a local stream so that we can parse the warning message std::stringstream ss; @@ -3178,11 +3180,11 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceEnabledRuntime) if (ss.str().find("Cannot connect to stream socket: Connection refused") == std::string::npos) { std::cout << ss.str(); - BOOST_FAIL("Expected string not found."); + FAIL("Expected string not found."); } } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadConnectionAcknowledgedPacket) +TEST_CASE("CheckProfilingServiceBadConnectionAcknowledgedPacket") { // Locally reduce log level to "Warning", as this test needs to parse a warning message from the standard output LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); @@ -3202,16 +3204,16 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadConnectionAcknowledgedPacket) SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "WaitingForAck" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); // Connection Acknowledged Packet header (word 0, word 1 is always zero): // 26:31 [6] packet_family: Control Packet Family, value 0b000000 @@ -3241,11 +3243,11 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadConnectionAcknowledgedPacket) if (ss.str().find("Functor with requested PacketId=37 and Version=4194304 does not exist") == std::string::npos) { std::cout << ss.str(); - BOOST_FAIL("Expected string not found."); + FAIL("Expected string not found."); } } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadRequestCounterDirectoryPacket) +TEST_CASE("CheckProfilingServiceBadRequestCounterDirectoryPacket") { // Locally reduce log level to "Warning", as this test needs to parse a warning message from the standard output LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); @@ -3264,15 +3266,15 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadRequestCounterDirectoryPacket) SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); helper.ForceTransitionToState(ProfilingState::NotConnected); - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Write a valid "Request Counter Directory" packet into the mock profiling connection, to simulate a valid // reply from an external profiling service @@ -3305,11 +3307,11 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadRequestCounterDirectoryPacket) if (ss.str().find("Functor with requested PacketId=123 and Version=4194304 does not exist") == std::string::npos) { std::cout << ss.str(); - BOOST_FAIL("Expected string not found."); + FAIL("Expected string not found."); } } -BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadPeriodicCounterSelectionPacket) +TEST_CASE("CheckProfilingServiceBadPeriodicCounterSelectionPacket") { // Locally reduce log level to "Warning", as this test needs to parse a warning message from the standard output LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); @@ -3328,16 +3330,16 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadPeriodicCounterSelectionPacket) SwapProfilingConnectionFactoryHelper helper(profilingService); // Bring the profiling service to the "Active" state - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); + CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); // Initialize the counter directory - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState() == ProfilingState::NotConnected); profilingService.Update(); // Create the profiling connection - BOOST_CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); + CHECK(profilingService.GetCurrentState() == ProfilingState::WaitingForAck); profilingService.Update(); // Start the command handler and the send thread // Get the mock profiling connection MockProfilingConnection* mockProfilingConnection = helper.GetMockProfilingConnection(); - BOOST_CHECK(mockProfilingConnection); + CHECK(mockProfilingConnection); // Write a "Periodic Counter Selection" packet into the mock profiling connection, to simulate an input from an // external profiling service @@ -3370,15 +3372,15 @@ BOOST_AUTO_TEST_CASE(CheckProfilingServiceBadPeriodicCounterSelectionPacket) if (ss.str().find("Functor with requested PacketId=999 and Version=4194304 does not exist") == std::string::npos) { std::cout << ss.str(); - BOOST_FAIL("Expected string not found."); + FAIL("Expected string not found."); } } -BOOST_AUTO_TEST_CASE(CheckCounterIdMap) +TEST_CASE("CheckCounterIdMap") { CounterIdMap counterIdMap; - BOOST_CHECK_THROW(counterIdMap.GetBackendId(0), armnn::Exception); - BOOST_CHECK_THROW(counterIdMap.GetGlobalId(0, armnn::profiling::BACKEND_ID), armnn::Exception); + CHECK_THROWS_AS(counterIdMap.GetBackendId(0), armnn::Exception); + CHECK_THROWS_AS(counterIdMap.GetGlobalId(0, armnn::profiling::BACKEND_ID), armnn::Exception); uint16_t globalCounterIds = 0; @@ -3399,22 +3401,22 @@ BOOST_AUTO_TEST_CASE(CheckCounterIdMap) ++globalCounterIds; } - BOOST_CHECK(counterIdMap.GetBackendId(0) == (std::pair(0, cpuRefId))); - BOOST_CHECK(counterIdMap.GetBackendId(1) == (std::pair(1, cpuRefId))); - BOOST_CHECK(counterIdMap.GetBackendId(2) == (std::pair(2, cpuRefId))); - BOOST_CHECK(counterIdMap.GetBackendId(3) == (std::pair(3, cpuRefId))); - BOOST_CHECK(counterIdMap.GetBackendId(4) == (std::pair(0, cpuAccId))); - BOOST_CHECK(counterIdMap.GetBackendId(5) == (std::pair(1, cpuAccId))); - - BOOST_CHECK(counterIdMap.GetGlobalId(0, cpuRefId) == 0); - BOOST_CHECK(counterIdMap.GetGlobalId(1, cpuRefId) == 1); - BOOST_CHECK(counterIdMap.GetGlobalId(2, cpuRefId) == 2); - BOOST_CHECK(counterIdMap.GetGlobalId(3, cpuRefId) == 3); - BOOST_CHECK(counterIdMap.GetGlobalId(0, cpuAccId) == 4); - BOOST_CHECK(counterIdMap.GetGlobalId(1, cpuAccId) == 5); + CHECK(counterIdMap.GetBackendId(0) == (std::pair(0, cpuRefId))); + CHECK(counterIdMap.GetBackendId(1) == (std::pair(1, cpuRefId))); + CHECK(counterIdMap.GetBackendId(2) == (std::pair(2, cpuRefId))); + CHECK(counterIdMap.GetBackendId(3) == (std::pair(3, cpuRefId))); + CHECK(counterIdMap.GetBackendId(4) == (std::pair(0, cpuAccId))); + CHECK(counterIdMap.GetBackendId(5) == (std::pair(1, cpuAccId))); + + CHECK(counterIdMap.GetGlobalId(0, cpuRefId) == 0); + CHECK(counterIdMap.GetGlobalId(1, cpuRefId) == 1); + CHECK(counterIdMap.GetGlobalId(2, cpuRefId) == 2); + CHECK(counterIdMap.GetGlobalId(3, cpuRefId) == 3); + CHECK(counterIdMap.GetGlobalId(0, cpuAccId) == 4); + CHECK(counterIdMap.GetGlobalId(1, cpuAccId) == 5); } -BOOST_AUTO_TEST_CASE(CheckRegisterBackendCounters) +TEST_CASE("CheckRegisterBackendCounters") { uint16_t globalCounterIds = armnn::profiling::INFERENCES_RUN; armnn::BackendId cpuRefId(armnn::Compute::CpuRef); @@ -3429,22 +3431,22 @@ BOOST_AUTO_TEST_CASE(CheckRegisterBackendCounters) - BOOST_CHECK(profilingService.GetCounterDirectory().GetCategories().empty()); + CHECK(profilingService.GetCounterDirectory().GetCategories().empty()); registerBackendCounters.RegisterCategory("categoryOne"); auto categoryOnePtr = profilingService.GetCounterDirectory().GetCategory("categoryOne"); - BOOST_CHECK(categoryOnePtr); + CHECK(categoryOnePtr); - BOOST_CHECK(profilingService.GetCounterDirectory().GetDevices().empty()); + CHECK(profilingService.GetCounterDirectory().GetDevices().empty()); globalCounterIds = registerBackendCounters.RegisterDevice("deviceOne"); auto deviceOnePtr = profilingService.GetCounterDirectory().GetDevice(globalCounterIds); - BOOST_CHECK(deviceOnePtr); - BOOST_CHECK(deviceOnePtr->m_Name == "deviceOne"); + CHECK(deviceOnePtr); + CHECK(deviceOnePtr->m_Name == "deviceOne"); - BOOST_CHECK(profilingService.GetCounterDirectory().GetCounterSets().empty()); + CHECK(profilingService.GetCounterDirectory().GetCounterSets().empty()); globalCounterIds = registerBackendCounters.RegisterCounterSet("counterSetOne"); auto counterSetOnePtr = profilingService.GetCounterDirectory().GetCounterSet(globalCounterIds); - BOOST_CHECK(counterSetOnePtr); - BOOST_CHECK(counterSetOnePtr->m_Name == "counterSetOne"); + CHECK(counterSetOnePtr); + CHECK(counterSetOnePtr->m_Name == "counterSetOne"); uint16_t newGlobalCounterId = registerBackendCounters.RegisterCounter(0, "categoryOne", @@ -3453,19 +3455,19 @@ BOOST_AUTO_TEST_CASE(CheckRegisterBackendCounters) 1.f, "CounterOne", "first test counter"); - BOOST_CHECK(newGlobalCounterId = armnn::profiling::INFERENCES_RUN + 1); + CHECK((newGlobalCounterId = armnn::profiling::INFERENCES_RUN + 1)); uint16_t mappedGlobalId = profilingService.GetCounterMappings().GetGlobalId(0, cpuRefId); - BOOST_CHECK(mappedGlobalId == newGlobalCounterId); + CHECK(mappedGlobalId == newGlobalCounterId); auto backendMapping = profilingService.GetCounterMappings().GetBackendId(newGlobalCounterId); - BOOST_CHECK(backendMapping.first == 0); - BOOST_CHECK(backendMapping.second == cpuRefId); + CHECK(backendMapping.first == 0); + CHECK(backendMapping.second == cpuRefId); // Reset the profiling service to stop any running thread options.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options, true); } -BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery) +TEST_CASE("CheckCounterStatusQuery") { armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; @@ -3487,10 +3489,10 @@ BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery) RegisterBackendCounters registerBackendCountersCpuRef(initialNumGlobalCounterIds, cpuRefId, profilingService); // Create 'testCategory' in CounterDirectory (backend agnostic) - BOOST_CHECK(profilingService.GetCounterDirectory().GetCategories().empty()); + CHECK(profilingService.GetCounterDirectory().GetCategories().empty()); registerBackendCountersCpuRef.RegisterCategory("testCategory"); auto categoryOnePtr = profilingService.GetCounterDirectory().GetCategory("testCategory"); - BOOST_CHECK(categoryOnePtr); + CHECK(categoryOnePtr); // Counters: // Global | Local | Backend @@ -3504,21 +3506,21 @@ BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery) // Register the backend counters for CpuRef and validate GetGlobalId and GetBackendId uint16_t currentNumGlobalCounterIds = registerBackendCountersCpuRef.RegisterCounter( 0, "testCategory", 0, 0, 1.f, "CpuRefCounter0", "Zeroth CpuRef Counter"); - BOOST_CHECK(currentNumGlobalCounterIds == initialNumGlobalCounterIds + 1); + CHECK(currentNumGlobalCounterIds == initialNumGlobalCounterIds + 1); uint16_t mappedGlobalId = profilingService.GetCounterMappings().GetGlobalId(0, cpuRefId); - BOOST_CHECK(mappedGlobalId == currentNumGlobalCounterIds); + CHECK(mappedGlobalId == currentNumGlobalCounterIds); auto backendMapping = profilingService.GetCounterMappings().GetBackendId(currentNumGlobalCounterIds); - BOOST_CHECK(backendMapping.first == 0); - BOOST_CHECK(backendMapping.second == cpuRefId); + CHECK(backendMapping.first == 0); + CHECK(backendMapping.second == cpuRefId); currentNumGlobalCounterIds = registerBackendCountersCpuRef.RegisterCounter( 1, "testCategory", 0, 0, 1.f, "CpuRefCounter1", "First CpuRef Counter"); - BOOST_CHECK(currentNumGlobalCounterIds == initialNumGlobalCounterIds + 2); + CHECK(currentNumGlobalCounterIds == initialNumGlobalCounterIds + 2); mappedGlobalId = profilingService.GetCounterMappings().GetGlobalId(1, cpuRefId); - BOOST_CHECK(mappedGlobalId == currentNumGlobalCounterIds); + CHECK(mappedGlobalId == currentNumGlobalCounterIds); backendMapping = profilingService.GetCounterMappings().GetBackendId(currentNumGlobalCounterIds); - BOOST_CHECK(backendMapping.first == 1); - BOOST_CHECK(backendMapping.second == cpuRefId); + CHECK(backendMapping.first == 1); + CHECK(backendMapping.second == cpuRefId); // Create RegisterBackendCounters for CpuAcc RegisterBackendCounters registerBackendCountersCpuAcc(currentNumGlobalCounterIds, cpuAccId, profilingService); @@ -3526,12 +3528,12 @@ BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery) // Register the backend counter for CpuAcc and validate GetGlobalId and GetBackendId currentNumGlobalCounterIds = registerBackendCountersCpuAcc.RegisterCounter( 0, "testCategory", 0, 0, 1.f, "CpuAccCounter0", "Zeroth CpuAcc Counter"); - BOOST_CHECK(currentNumGlobalCounterIds == initialNumGlobalCounterIds + 3); + CHECK(currentNumGlobalCounterIds == initialNumGlobalCounterIds + 3); mappedGlobalId = profilingService.GetCounterMappings().GetGlobalId(0, cpuAccId); - BOOST_CHECK(mappedGlobalId == currentNumGlobalCounterIds); + CHECK(mappedGlobalId == currentNumGlobalCounterIds); backendMapping = profilingService.GetCounterMappings().GetBackendId(currentNumGlobalCounterIds); - BOOST_CHECK(backendMapping.first == 0); - BOOST_CHECK(backendMapping.second == cpuAccId); + CHECK(backendMapping.first == 0); + CHECK(backendMapping.second == cpuAccId); // Create vectors for active counters const std::vector activeGlobalCounterIds = {5}; // CpuRef(0) activated @@ -3546,28 +3548,28 @@ BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery) // Get vector of active counters for CpuRef and CpuAcc backends std::vector cpuRefCounterStatus = backendProfilingCpuRef.GetActiveCounters(); std::vector cpuAccCounterStatus = backendProfilingCpuAcc.GetActiveCounters(); - BOOST_CHECK_EQUAL(cpuRefCounterStatus.size(), 1); - BOOST_CHECK_EQUAL(cpuAccCounterStatus.size(), 0); + CHECK_EQ(cpuRefCounterStatus.size(), 1); + CHECK_EQ(cpuAccCounterStatus.size(), 0); // Check active CpuRef counter - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_GlobalCounterId, activeGlobalCounterIds[0]); - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_BackendCounterId, cpuRefCounters[0]); - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_SamplingRateInMicroseconds, capturePeriod); - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_Enabled, true); + CHECK_EQ(cpuRefCounterStatus[0].m_GlobalCounterId, activeGlobalCounterIds[0]); + CHECK_EQ(cpuRefCounterStatus[0].m_BackendCounterId, cpuRefCounters[0]); + CHECK_EQ(cpuRefCounterStatus[0].m_SamplingRateInMicroseconds, capturePeriod); + CHECK_EQ(cpuRefCounterStatus[0].m_Enabled, true); // Check inactive CpuRef counter CounterStatus inactiveCpuRefCounter = backendProfilingCpuRef.GetCounterStatus(cpuRefCounters[1]); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_GlobalCounterId, 6); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_BackendCounterId, cpuRefCounters[1]); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_SamplingRateInMicroseconds, 0); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_Enabled, false); + CHECK_EQ(inactiveCpuRefCounter.m_GlobalCounterId, 6); + CHECK_EQ(inactiveCpuRefCounter.m_BackendCounterId, cpuRefCounters[1]); + CHECK_EQ(inactiveCpuRefCounter.m_SamplingRateInMicroseconds, 0); + CHECK_EQ(inactiveCpuRefCounter.m_Enabled, false); // Check inactive CpuAcc counter CounterStatus inactiveCpuAccCounter = backendProfilingCpuAcc.GetCounterStatus(cpuAccCounters[0]); - BOOST_CHECK_EQUAL(inactiveCpuAccCounter.m_GlobalCounterId, 7); - BOOST_CHECK_EQUAL(inactiveCpuAccCounter.m_BackendCounterId, cpuAccCounters[0]); - BOOST_CHECK_EQUAL(inactiveCpuAccCounter.m_SamplingRateInMicroseconds, 0); - BOOST_CHECK_EQUAL(inactiveCpuAccCounter.m_Enabled, false); + CHECK_EQ(inactiveCpuAccCounter.m_GlobalCounterId, 7); + CHECK_EQ(inactiveCpuAccCounter.m_BackendCounterId, cpuAccCounters[0]); + CHECK_EQ(inactiveCpuAccCounter.m_SamplingRateInMicroseconds, 0); + CHECK_EQ(inactiveCpuAccCounter.m_Enabled, false); // Set new capture period and new active counters in CaptureData profilingService.SetCaptureData(newCapturePeriod, newActiveGlobalCounterIds, {}); @@ -3575,34 +3577,34 @@ BOOST_AUTO_TEST_CASE(CheckCounterStatusQuery) // Get vector of active counters for CpuRef and CpuAcc backends cpuRefCounterStatus = backendProfilingCpuRef.GetActiveCounters(); cpuAccCounterStatus = backendProfilingCpuAcc.GetActiveCounters(); - BOOST_CHECK_EQUAL(cpuRefCounterStatus.size(), 1); - BOOST_CHECK_EQUAL(cpuAccCounterStatus.size(), 1); + CHECK_EQ(cpuRefCounterStatus.size(), 1); + CHECK_EQ(cpuAccCounterStatus.size(), 1); // Check active CpuRef counter - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_GlobalCounterId, newActiveGlobalCounterIds[0]); - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_BackendCounterId, cpuRefCounters[1]); - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_SamplingRateInMicroseconds, newCapturePeriod); - BOOST_CHECK_EQUAL(cpuRefCounterStatus[0].m_Enabled, true); + CHECK_EQ(cpuRefCounterStatus[0].m_GlobalCounterId, newActiveGlobalCounterIds[0]); + CHECK_EQ(cpuRefCounterStatus[0].m_BackendCounterId, cpuRefCounters[1]); + CHECK_EQ(cpuRefCounterStatus[0].m_SamplingRateInMicroseconds, newCapturePeriod); + CHECK_EQ(cpuRefCounterStatus[0].m_Enabled, true); // Check active CpuAcc counter - BOOST_CHECK_EQUAL(cpuAccCounterStatus[0].m_GlobalCounterId, newActiveGlobalCounterIds[1]); - BOOST_CHECK_EQUAL(cpuAccCounterStatus[0].m_BackendCounterId, cpuAccCounters[0]); - BOOST_CHECK_EQUAL(cpuAccCounterStatus[0].m_SamplingRateInMicroseconds, newCapturePeriod); - BOOST_CHECK_EQUAL(cpuAccCounterStatus[0].m_Enabled, true); + CHECK_EQ(cpuAccCounterStatus[0].m_GlobalCounterId, newActiveGlobalCounterIds[1]); + CHECK_EQ(cpuAccCounterStatus[0].m_BackendCounterId, cpuAccCounters[0]); + CHECK_EQ(cpuAccCounterStatus[0].m_SamplingRateInMicroseconds, newCapturePeriod); + CHECK_EQ(cpuAccCounterStatus[0].m_Enabled, true); // Check inactive CpuRef counter inactiveCpuRefCounter = backendProfilingCpuRef.GetCounterStatus(cpuRefCounters[0]); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_GlobalCounterId, 5); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_BackendCounterId, cpuRefCounters[0]); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_SamplingRateInMicroseconds, 0); - BOOST_CHECK_EQUAL(inactiveCpuRefCounter.m_Enabled, false); + CHECK_EQ(inactiveCpuRefCounter.m_GlobalCounterId, 5); + CHECK_EQ(inactiveCpuRefCounter.m_BackendCounterId, cpuRefCounters[0]); + CHECK_EQ(inactiveCpuRefCounter.m_SamplingRateInMicroseconds, 0); + CHECK_EQ(inactiveCpuRefCounter.m_Enabled, false); // Reset the profiling service to stop any running thread options.m_ProfilingOptions.m_EnableProfiling = false; profilingService.ResetExternalProfilingOptions(options.m_ProfilingOptions, true); } -BOOST_AUTO_TEST_CASE(CheckRegisterCounters) +TEST_CASE("CheckRegisterCounters") { armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; @@ -3634,34 +3636,34 @@ BOOST_AUTO_TEST_CASE(CheckRegisterCounters) uint32_t headerWord1 = ReadUint32(readBuffer, 4); uint64_t readTimestamp = ReadUint64(readBuffer, 8); - BOOST_TEST(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family - BOOST_TEST(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class - BOOST_TEST(((headerWord0 >> 16) & 0x00000007) == 0); // packet type - BOOST_TEST(headerWord1 == 20); // data length - BOOST_TEST(1000998 == readTimestamp); // capture period + CHECK(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family + CHECK(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class + CHECK(((headerWord0 >> 16) & 0x00000007) == 0); // packet type + CHECK(headerWord1 == 20); // data length + CHECK(1000998 == readTimestamp); // capture period uint32_t offset = 16; // Check Counter Index uint16_t readIndex = ReadUint16(readBuffer, offset); - BOOST_TEST(6 == readIndex); + CHECK(6 == readIndex); // Check Counter Value offset += 2; uint32_t readValue = ReadUint32(readBuffer, offset); - BOOST_TEST(700 == readValue); + CHECK(700 == readValue); // Check Counter Index offset += 4; readIndex = ReadUint16(readBuffer, offset); - BOOST_TEST(8 == readIndex); + CHECK(8 == readIndex); // Check Counter Value offset += 2; readValue = ReadUint32(readBuffer, offset); - BOOST_TEST(93 == readValue); + CHECK(93 == readValue); } -BOOST_AUTO_TEST_CASE(CheckFileFormat) { +TEST_CASE("CheckFileFormat") { // Locally reduce log level to "Warning", as this test needs to parse a warning message from the standard output LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); @@ -3669,7 +3671,7 @@ BOOST_AUTO_TEST_CASE(CheckFileFormat) { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_EnableProfiling = true; // Check the default value set to binary - BOOST_CHECK(options.m_FileFormat == "binary"); + CHECK(options.m_FileFormat == "binary"); // Change file format to an unsupported value options.m_FileFormat = "json"; @@ -3678,7 +3680,7 @@ BOOST_AUTO_TEST_CASE(CheckFileFormat) { profilingService.ResetExternalProfilingOptions(options, true); // Start the command handler and the send thread profilingService.Update(); - BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::NotConnected); + CHECK(profilingService.GetCurrentState()==ProfilingState::NotConnected); // Redirect the output to a local stream so that we can parse the warning message std::stringstream ss; @@ -3694,8 +3696,8 @@ BOOST_AUTO_TEST_CASE(CheckFileFormat) { if (ss.str().find("Unsupported profiling file format, only binary is supported") == std::string::npos) { std::cout << ss.str(); - BOOST_FAIL("Expected string not found."); + FAIL("Expected string not found."); } } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/ProfilingTests.hpp b/src/profiling/test/ProfilingTests.hpp index f96a1c89ab..a8ca1b9b18 100644 --- a/src/profiling/test/ProfilingTests.hpp +++ b/src/profiling/test/ProfilingTests.hpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -213,15 +213,15 @@ public: , m_BackupProfilingConnectionFactory(nullptr) { - BOOST_CHECK(m_MockProfilingConnectionFactory); + CHECK(m_MockProfilingConnectionFactory); SwapProfilingConnectionFactory(m_ProfilingService, m_MockProfilingConnectionFactory.get(), m_BackupProfilingConnectionFactory); - BOOST_CHECK(m_BackupProfilingConnectionFactory); + CHECK(m_BackupProfilingConnectionFactory); } ~SwapProfilingConnectionFactoryHelper() { - BOOST_CHECK(m_BackupProfilingConnectionFactory); + CHECK(m_BackupProfilingConnectionFactory); IProfilingConnectionFactory* temp = nullptr; SwapProfilingConnectionFactory(m_ProfilingService, m_BackupProfilingConnectionFactory, diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp index 950f8ffad0..675d083644 100644 --- a/src/profiling/test/SendCounterPacketTests.cpp +++ b/src/profiling/test/SendCounterPacketTests.cpp @@ -20,7 +20,9 @@ #include -#include +#include + +#include #include @@ -48,7 +50,7 @@ void SetNotConnectedProfilingState(ProfilingStateMachine& profilingStateMachine) case ProfilingState::NotConnected: return; default: - BOOST_CHECK_MESSAGE(false, "Invalid profiling state"); + CHECK_MESSAGE(false, "Invalid profiling state"); } } @@ -68,7 +70,7 @@ void SetWaitingForAckProfilingState(ProfilingStateMachine& profilingStateMachine case ProfilingState::WaitingForAck: return; default: - BOOST_CHECK_MESSAGE(false, "Invalid profiling state"); + CHECK_MESSAGE(false, "Invalid profiling state"); } } @@ -89,17 +91,17 @@ void SetActiveProfilingState(ProfilingStateMachine& profilingStateMachine) case ProfilingState::Active: return; default: - BOOST_CHECK_MESSAGE(false, "Invalid profiling state"); + CHECK_MESSAGE(false, "Invalid profiling state"); } } } // Anonymous namespace -BOOST_AUTO_TEST_SUITE(SendCounterPacketTests) - +TEST_SUITE("SendCounterPacketTests") +{ using PacketType = MockProfilingConnection::PacketType; -BOOST_AUTO_TEST_CASE(MockSendCounterPacketTest) +TEST_CASE("MockSendCounterPacketTest") { MockBufferManager mockBuffer(512); MockSendCounterPacket mockSendCounterPacket(mockBuffer); @@ -109,7 +111,7 @@ BOOST_AUTO_TEST_CASE(MockSendCounterPacketTest) auto packetBuffer = mockBuffer.GetReadableBuffer(); const char* buffer = reinterpret_cast(packetBuffer->GetReadableData()); - BOOST_TEST(strcmp(buffer, "SendStreamMetaDataPacket") == 0); + CHECK(strcmp(buffer, "SendStreamMetaDataPacket") == 0); mockBuffer.MarkRead(packetBuffer); @@ -119,7 +121,7 @@ BOOST_AUTO_TEST_CASE(MockSendCounterPacketTest) packetBuffer = mockBuffer.GetReadableBuffer(); buffer = reinterpret_cast(packetBuffer->GetReadableData()); - BOOST_TEST(strcmp(buffer, "SendCounterDirectoryPacket") == 0); + CHECK(strcmp(buffer, "SendCounterDirectoryPacket") == 0); mockBuffer.MarkRead(packetBuffer); @@ -131,7 +133,7 @@ BOOST_AUTO_TEST_CASE(MockSendCounterPacketTest) packetBuffer = mockBuffer.GetReadableBuffer(); buffer = reinterpret_cast(packetBuffer->GetReadableData()); - BOOST_TEST(strcmp(buffer, "SendPeriodicCounterCapturePacket") == 0); + CHECK(strcmp(buffer, "SendPeriodicCounterCapturePacket") == 0); mockBuffer.MarkRead(packetBuffer); @@ -142,12 +144,12 @@ BOOST_AUTO_TEST_CASE(MockSendCounterPacketTest) packetBuffer = mockBuffer.GetReadableBuffer(); buffer = reinterpret_cast(packetBuffer->GetReadableData()); - BOOST_TEST(strcmp(buffer, "SendPeriodicCounterSelectionPacket") == 0); + CHECK(strcmp(buffer, "SendPeriodicCounterSelectionPacket") == 0); mockBuffer.MarkRead(packetBuffer); } -BOOST_AUTO_TEST_CASE(SendPeriodicCounterSelectionPacketTest) +TEST_CASE("SendPeriodicCounterSelectionPacketTest") { // Error no space left in buffer MockBufferManager mockBuffer1(10); @@ -155,7 +157,7 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterSelectionPacketTest) uint32_t capturePeriod = 1000; std::vector selectedCounterIds; - BOOST_CHECK_THROW(sendPacket1.SendPeriodicCounterSelectionPacket(capturePeriod, selectedCounterIds), + CHECK_THROWS_AS(sendPacket1.SendPeriodicCounterSelectionPacket(capturePeriod, selectedCounterIds), BufferExhaustion); // Packet without any counters @@ -169,10 +171,10 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterSelectionPacketTest) uint32_t headerWord1 = ReadUint32(readBuffer2, 4); uint32_t period = ReadUint32(readBuffer2, 8); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family - BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 4); // packet id - BOOST_TEST(headerWord1 == 4); // data lenght - BOOST_TEST(period == 1000); // capture period + CHECK(((headerWord0 >> 26) & 0x3F) == 0); // packet family + CHECK(((headerWord0 >> 16) & 0x3FF) == 4); // packet id + CHECK(headerWord1 == 4); // data lenght + CHECK(period == 1000); // capture period // Full packet message MockBufferManager mockBuffer3(512); @@ -191,10 +193,10 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterSelectionPacketTest) headerWord1 = ReadUint32(readBuffer3, 4); period = ReadUint32(readBuffer3, 8); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family - BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 4); // packet id - BOOST_TEST(headerWord1 == 14); // data lenght - BOOST_TEST(period == 1000); // capture period + CHECK(((headerWord0 >> 26) & 0x3F) == 0); // packet family + CHECK(((headerWord0 >> 16) & 0x3FF) == 4); // packet id + CHECK(headerWord1 == 14); // data lenght + CHECK(period == 1000); // capture period uint16_t counterId = 0; uint32_t offset = 12; @@ -203,12 +205,12 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterSelectionPacketTest) for(const uint16_t& id : selectedCounterIds) { counterId = ReadUint16(readBuffer3, offset); - BOOST_TEST(counterId == id); + CHECK(counterId == id); offset += 2; } } -BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest) +TEST_CASE("SendPeriodicCounterCapturePacketTest") { ProfilingStateMachine profilingStateMachine; @@ -220,7 +222,7 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest) uint64_t time = static_cast(captureTimestamp.time_since_epoch().count()); std::vector indexValuePairs; - BOOST_CHECK_THROW(sendPacket1.SendPeriodicCounterCapturePacket(time, indexValuePairs), + CHECK_THROWS_AS(sendPacket1.SendPeriodicCounterCapturePacket(time, indexValuePairs), BufferExhaustion); // Packet without any counters @@ -234,11 +236,11 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest) uint32_t headerWord1 = ReadUint32(readBuffer2, 4); uint64_t readTimestamp = ReadUint64(readBuffer2, 8); - BOOST_TEST(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family - BOOST_TEST(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class - BOOST_TEST(((headerWord0 >> 16) & 0x00000007) == 0); // packet type - BOOST_TEST(headerWord1 == 8); // data length - BOOST_TEST(time == readTimestamp); // capture period + CHECK(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family + CHECK(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class + CHECK(((headerWord0 >> 16) & 0x00000007) == 0); // packet type + CHECK(headerWord1 == 8); // data length + CHECK(time == readTimestamp); // capture period // Full packet message MockBufferManager mockBuffer3(512); @@ -257,11 +259,11 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest) headerWord1 = ReadUint32(readBuffer3, 4); uint64_t readTimestamp2 = ReadUint64(readBuffer3, 8); - BOOST_TEST(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family - BOOST_TEST(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class - BOOST_TEST(((headerWord0 >> 16) & 0x00000007) == 0); // packet type - BOOST_TEST(headerWord1 == 38); // data length - BOOST_TEST(time == readTimestamp2); // capture period + CHECK(((headerWord0 >> 26) & 0x0000003F) == 3); // packet family + CHECK(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class + CHECK(((headerWord0 >> 16) & 0x00000007) == 0); // packet type + CHECK(headerWord1 == 38); // data length + CHECK(time == readTimestamp2); // capture period uint16_t counterIndex = 0; uint32_t counterValue = 100; @@ -272,27 +274,27 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest) { // Check Counter Index uint16_t readIndex = ReadUint16(readBuffer3, offset); - BOOST_TEST(counterIndex == readIndex); + CHECK(counterIndex == readIndex); counterIndex++; offset += 2; // Check Counter Value uint32_t readValue = ReadUint32(readBuffer3, offset); - BOOST_TEST(counterValue == readValue); + CHECK(counterValue == readValue); counterValue += 100; offset += 4; } } -BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest) +TEST_CASE("SendStreamMetaDataPacketTest") { uint32_t sizeUint32 = armnn::numeric_cast(sizeof(uint32_t)); // Error no space left in buffer MockBufferManager mockBuffer1(10); SendCounterPacket sendPacket1(mockBuffer1); - BOOST_CHECK_THROW(sendPacket1.SendStreamMetaDataPacket(), armnn::profiling::BufferExhaustion); + CHECK_THROWS_AS(sendPacket1.SendStreamMetaDataPacket(), armnn::profiling::BufferExhaustion); // Full metadata packet @@ -345,8 +347,8 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest) uint32_t headerWord0 = ReadUint32(readBuffer2, 0); uint32_t headerWord1 = ReadUint32(readBuffer2, sizeUint32); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family - BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 0); // packet id + CHECK(((headerWord0 >> 26) & 0x3F) == 0); // packet family + CHECK(((headerWord0 >> 16) & 0x3FF) == 0); // packet id uint32_t totalLength = armnn::numeric_cast(2 * sizeUint32 + 10 * sizeUint32 + infoSize + @@ -354,82 +356,82 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest) processNameSize + sizeUint32 + 2 * packetEntries * sizeUint32); - BOOST_TEST(headerWord1 == totalLength - (2 * sizeUint32)); // data length + CHECK(headerWord1 == totalLength - (2 * sizeUint32)); // data length uint32_t offset = sizeUint32 * 2; - BOOST_TEST(ReadUint32(readBuffer2, offset) == arm::pipe::PIPE_MAGIC); // pipe_magic + CHECK(ReadUint32(readBuffer2, offset) == arm::pipe::PIPE_MAGIC); // pipe_magic offset += sizeUint32; - BOOST_TEST(ReadUint32(readBuffer2, offset) == arm::pipe::EncodeVersion(1, 0, 0)); // stream_metadata_version + CHECK(ReadUint32(readBuffer2, offset) == arm::pipe::EncodeVersion(1, 0, 0)); // stream_metadata_version offset += sizeUint32; - BOOST_TEST(ReadUint32(readBuffer2, offset) == MAX_METADATA_PACKET_LENGTH); // max_data_len + CHECK(ReadUint32(readBuffer2, offset) == MAX_METADATA_PACKET_LENGTH); // max_data_len offset += sizeUint32; int pid = armnnUtils::Processes::GetCurrentId(); - BOOST_TEST(ReadUint32(readBuffer2, offset) == armnn::numeric_cast(pid)); + CHECK(ReadUint32(readBuffer2, offset) == armnn::numeric_cast(pid)); offset += sizeUint32; uint32_t poolOffset = 10 * sizeUint32; - BOOST_TEST(ReadUint32(readBuffer2, offset) == poolOffset); // offset_info + CHECK(ReadUint32(readBuffer2, offset) == poolOffset); // offset_info offset += sizeUint32; poolOffset += infoSize; - BOOST_TEST(ReadUint32(readBuffer2, offset) == poolOffset); // offset_hw_version + CHECK(ReadUint32(readBuffer2, offset) == poolOffset); // offset_hw_version offset += sizeUint32; poolOffset += hardwareVersionSize; - BOOST_TEST(ReadUint32(readBuffer2, offset) == poolOffset); // offset_sw_version + CHECK(ReadUint32(readBuffer2, offset) == poolOffset); // offset_sw_version offset += sizeUint32; poolOffset += softwareVersionSize; - BOOST_TEST(ReadUint32(readBuffer2, offset) == poolOffset); // offset_process_name + CHECK(ReadUint32(readBuffer2, offset) == poolOffset); // offset_process_name offset += sizeUint32; poolOffset += processNameSize; - BOOST_TEST(ReadUint32(readBuffer2, offset) == poolOffset); // offset_packet_version_table + CHECK(ReadUint32(readBuffer2, offset) == poolOffset); // offset_packet_version_table offset += sizeUint32; - BOOST_TEST(ReadUint32(readBuffer2, offset) == 0); // reserved + CHECK(ReadUint32(readBuffer2, offset) == 0); // reserved const unsigned char* readData2 = readBuffer2->GetReadableData(); offset += sizeUint32; if (infoSize) { - BOOST_TEST(strcmp(reinterpret_cast(&readData2[offset]), GetSoftwareInfo().c_str()) == 0); + CHECK(strcmp(reinterpret_cast(&readData2[offset]), GetSoftwareInfo().c_str()) == 0); offset += infoSize; } if (hardwareVersionSize) { - BOOST_TEST(strcmp(reinterpret_cast(&readData2[offset]), GetHardwareVersion().c_str()) == 0); + CHECK(strcmp(reinterpret_cast(&readData2[offset]), GetHardwareVersion().c_str()) == 0); offset += hardwareVersionSize; } if (softwareVersionSize) { - BOOST_TEST(strcmp(reinterpret_cast(&readData2[offset]), GetSoftwareVersion().c_str()) == 0); + CHECK(strcmp(reinterpret_cast(&readData2[offset]), GetSoftwareVersion().c_str()) == 0); offset += softwareVersionSize; } if (processNameSize) { - BOOST_TEST(strcmp(reinterpret_cast(&readData2[offset]), GetProcessName().c_str()) == 0); + CHECK(strcmp(reinterpret_cast(&readData2[offset]), GetProcessName().c_str()) == 0); offset += processNameSize; } if (packetEntries) { uint32_t numberOfEntries = ReadUint32(readBuffer2, offset); - BOOST_TEST((numberOfEntries >> 16) == packetEntries); + CHECK((numberOfEntries >> 16) == packetEntries); offset += sizeUint32; for (std::pair& packetVersion : packetVersions) { uint32_t readPacketId = ReadUint32(readBuffer2, offset); - BOOST_TEST(packetVersion.first == readPacketId); + CHECK(packetVersion.first == readPacketId); offset += sizeUint32; uint32_t readVersion = ReadUint32(readBuffer2, offset); - BOOST_TEST(packetVersion.second == readVersion); + CHECK(packetVersion.second == readVersion); offset += sizeUint32; } } - BOOST_TEST(offset == totalLength); + CHECK(offset == totalLength); } -BOOST_AUTO_TEST_CASE(CreateDeviceRecordTest) +TEST_CASE("CreateDeviceRecordTest") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -445,23 +447,23 @@ BOOST_AUTO_TEST_CASE(CreateDeviceRecordTest) std::string errorMessage; bool result = sendCounterPacketTest.CreateDeviceRecordTest(device, deviceRecord, errorMessage); - BOOST_CHECK(result); - BOOST_CHECK(errorMessage.empty()); - BOOST_CHECK(deviceRecord.size() == 6); // Size in words: header [2] + device name [4] + CHECK(result); + CHECK(errorMessage.empty()); + CHECK(deviceRecord.size() == 6); // Size in words: header [2] + device name [4] uint16_t deviceRecordWord0[] { static_cast(deviceRecord[0] >> 16), static_cast(deviceRecord[0]) }; - BOOST_CHECK(deviceRecordWord0[0] == deviceUid); // uid - BOOST_CHECK(deviceRecordWord0[1] == deviceCores); // cores - BOOST_CHECK(deviceRecord[1] == 8); // name_offset - BOOST_CHECK(deviceRecord[2] == deviceName.size() + 1); // The length of the SWTrace string (name) - BOOST_CHECK(std::memcmp(deviceRecord.data() + 3, deviceName.data(), deviceName.size()) == 0); // name + CHECK(deviceRecordWord0[0] == deviceUid); // uid + CHECK(deviceRecordWord0[1] == deviceCores); // cores + CHECK(deviceRecord[1] == 8); // name_offset + CHECK(deviceRecord[2] == deviceName.size() + 1); // The length of the SWTrace string (name) + CHECK(std::memcmp(deviceRecord.data() + 3, deviceName.data(), deviceName.size()) == 0); // name } -BOOST_AUTO_TEST_CASE(CreateInvalidDeviceRecordTest) +TEST_CASE("CreateInvalidDeviceRecordTest") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -477,12 +479,12 @@ BOOST_AUTO_TEST_CASE(CreateInvalidDeviceRecordTest) std::string errorMessage; bool result = sendCounterPacketTest.CreateDeviceRecordTest(device, deviceRecord, errorMessage); - BOOST_CHECK(!result); - BOOST_CHECK(!errorMessage.empty()); - BOOST_CHECK(deviceRecord.empty()); + CHECK(!result); + CHECK(!errorMessage.empty()); + CHECK(deviceRecord.empty()); } -BOOST_AUTO_TEST_CASE(CreateCounterSetRecordTest) +TEST_CASE("CreateCounterSetRecordTest") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -498,23 +500,23 @@ BOOST_AUTO_TEST_CASE(CreateCounterSetRecordTest) std::string errorMessage; bool result = sendCounterPacketTest.CreateCounterSetRecordTest(counterSet, counterSetRecord, errorMessage); - BOOST_CHECK(result); - BOOST_CHECK(errorMessage.empty()); - BOOST_CHECK(counterSetRecord.size() == 8); // Size in words: header [2] + counter set name [6] + CHECK(result); + CHECK(errorMessage.empty()); + CHECK(counterSetRecord.size() == 8); // Size in words: header [2] + counter set name [6] uint16_t counterSetRecordWord0[] { static_cast(counterSetRecord[0] >> 16), static_cast(counterSetRecord[0]) }; - BOOST_CHECK(counterSetRecordWord0[0] == counterSetUid); // uid - BOOST_CHECK(counterSetRecordWord0[1] == counterSetCount); // cores - BOOST_CHECK(counterSetRecord[1] == 8); // name_offset - BOOST_CHECK(counterSetRecord[2] == counterSetName.size() + 1); // The length of the SWTrace string (name) - BOOST_CHECK(std::memcmp(counterSetRecord.data() + 3, counterSetName.data(), counterSetName.size()) == 0); // name + CHECK(counterSetRecordWord0[0] == counterSetUid); // uid + CHECK(counterSetRecordWord0[1] == counterSetCount); // cores + CHECK(counterSetRecord[1] == 8); // name_offset + CHECK(counterSetRecord[2] == counterSetName.size() + 1); // The length of the SWTrace string (name) + CHECK(std::memcmp(counterSetRecord.data() + 3, counterSetName.data(), counterSetName.size()) == 0); // name } -BOOST_AUTO_TEST_CASE(CreateInvalidCounterSetRecordTest) +TEST_CASE("CreateInvalidCounterSetRecordTest") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -530,12 +532,12 @@ BOOST_AUTO_TEST_CASE(CreateInvalidCounterSetRecordTest) std::string errorMessage; bool result = sendCounterPacketTest.CreateCounterSetRecordTest(counterSet, counterSetRecord, errorMessage); - BOOST_CHECK(!result); - BOOST_CHECK(!errorMessage.empty()); - BOOST_CHECK(counterSetRecord.empty()); + CHECK(!result); + CHECK(!errorMessage.empty()); + CHECK(counterSetRecord.empty()); } -BOOST_AUTO_TEST_CASE(CreateEventRecordTest) +TEST_CASE("CreateEventRecordTest") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -569,9 +571,9 @@ BOOST_AUTO_TEST_CASE(CreateEventRecordTest) std::string errorMessage; bool result = sendCounterPacketTest.CreateEventRecordTest(counter, eventRecord, errorMessage); - BOOST_CHECK(result); - BOOST_CHECK(errorMessage.empty()); - BOOST_CHECK(eventRecord.size() == 24); // Size in words: header [8] + counter name [6] + description [7] + units [3] + CHECK(result); + CHECK(errorMessage.empty()); + CHECK(eventRecord.size() == 24); // Size in words: header [8] + counter name [6] + description [7] + units [3] uint16_t eventRecordWord0[] { @@ -594,14 +596,14 @@ BOOST_AUTO_TEST_CASE(CreateEventRecordTest) eventRecord[4] }; - BOOST_CHECK(eventRecordWord0[0] == maxCounterUid); // max_counter_uid - BOOST_CHECK(eventRecordWord0[1] == counterUid); // counter_uid - BOOST_CHECK(eventRecordWord1[0] == deviceUid); // device + CHECK(eventRecordWord0[0] == maxCounterUid); // max_counter_uid + CHECK(eventRecordWord0[1] == counterUid); // counter_uid + CHECK(eventRecordWord1[0] == deviceUid); // device - BOOST_CHECK(eventRecordWord1[1] == counterSetUid); // counter_set - BOOST_CHECK(eventRecordWord2[0] == counterClass); // class - BOOST_CHECK(eventRecordWord2[1] == counterInterpolation); // interpolation - BOOST_CHECK(std::memcmp(eventRecordWord34, &counterMultiplier, sizeof(counterMultiplier)) == 0); // multiplier + CHECK(eventRecordWord1[1] == counterSetUid); // counter_set + CHECK(eventRecordWord2[0] == counterClass); // class + CHECK(eventRecordWord2[1] == counterInterpolation); // interpolation + CHECK(std::memcmp(eventRecordWord34, &counterMultiplier, sizeof(counterMultiplier)) == 0); // multiplier ARMNN_NO_CONVERSION_WARN_BEGIN uint32_t eventRecordBlockSize = 8u * sizeof(uint32_t); @@ -620,49 +622,49 @@ BOOST_AUTO_TEST_CASE(CreateEventRecordTest) ARMNN_NO_CONVERSION_WARN_END - BOOST_CHECK(eventRecord[5] == counterNameOffset); // name_offset - BOOST_CHECK(eventRecord[6] == counterDescriptionOffset); // description_offset - BOOST_CHECK(eventRecord[7] == counterUnitsOffset); // units_offset + CHECK(eventRecord[5] == counterNameOffset); // name_offset + CHECK(eventRecord[6] == counterDescriptionOffset); // description_offset + CHECK(eventRecord[7] == counterUnitsOffset); // units_offset // Offsets are relative to the start of the eventRecord auto eventRecordPool = reinterpret_cast(eventRecord.data()); size_t uint32_t_size = sizeof(uint32_t); // The length of the SWTrace string (name) - BOOST_CHECK(eventRecordPool[counterNameOffset] == counterName.size() + 1); + CHECK(eventRecordPool[counterNameOffset] == counterName.size() + 1); // The counter name - BOOST_CHECK(std::memcmp(eventRecordPool + + CHECK(std::memcmp(eventRecordPool + counterNameOffset + // Offset uint32_t_size /* The length of the name */, counterName.data(), counterName.size()) == 0); // name // The null-terminator at the end of the name - BOOST_CHECK(eventRecordPool[counterNameOffset + uint32_t_size + counterName.size()] == '\0'); + CHECK(eventRecordPool[counterNameOffset + uint32_t_size + counterName.size()] == '\0'); // The length of the SWTrace string (description) - BOOST_CHECK(eventRecordPool[counterDescriptionOffset] == counterDescription.size() + 1); + CHECK(eventRecordPool[counterDescriptionOffset] == counterDescription.size() + 1); // The counter description - BOOST_CHECK(std::memcmp(eventRecordPool + + CHECK(std::memcmp(eventRecordPool + counterDescriptionOffset + // Offset uint32_t_size /* The length of the description */, counterDescription.data(), counterDescription.size()) == 0); // description // The null-terminator at the end of the description - BOOST_CHECK(eventRecordPool[counterDescriptionOffset + uint32_t_size + counterDescription.size()] == '\0'); + CHECK(eventRecordPool[counterDescriptionOffset + uint32_t_size + counterDescription.size()] == '\0'); // The length of the SWTrace namestring (units) - BOOST_CHECK(eventRecordPool[counterUnitsOffset] == counterUnits.size() + 1); + CHECK(eventRecordPool[counterUnitsOffset] == counterUnits.size() + 1); // The counter units - BOOST_CHECK(std::memcmp(eventRecordPool + + CHECK(std::memcmp(eventRecordPool + counterUnitsOffset + // Offset uint32_t_size /* The length of the units */, counterUnits.data(), counterUnits.size()) == 0); // units // The null-terminator at the end of the units - BOOST_CHECK(eventRecordPool[counterUnitsOffset + uint32_t_size + counterUnits.size()] == '\0'); + CHECK(eventRecordPool[counterUnitsOffset + uint32_t_size + counterUnits.size()] == '\0'); } -BOOST_AUTO_TEST_CASE(CreateEventRecordNoUnitsTest) +TEST_CASE("CreateEventRecordNoUnitsTest") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -695,9 +697,9 @@ BOOST_AUTO_TEST_CASE(CreateEventRecordNoUnitsTest) std::string errorMessage; bool result = sendCounterPacketTest.CreateEventRecordTest(counter, eventRecord, errorMessage); - BOOST_CHECK(result); - BOOST_CHECK(errorMessage.empty()); - BOOST_CHECK(eventRecord.size() == 21); // Size in words: header [8] + counter name [6] + description [7] + CHECK(result); + CHECK(errorMessage.empty()); + CHECK(eventRecord.size() == 21); // Size in words: header [8] + counter name [6] + description [7] uint16_t eventRecordWord0[] { @@ -719,13 +721,13 @@ BOOST_AUTO_TEST_CASE(CreateEventRecordNoUnitsTest) eventRecord[3], eventRecord[4] }; - BOOST_CHECK(eventRecordWord0[0] == maxCounterUid); // max_counter_uid - BOOST_CHECK(eventRecordWord0[1] == counterUid); // counter_uid - BOOST_CHECK(eventRecordWord1[0] == deviceUid); // device - BOOST_CHECK(eventRecordWord1[1] == counterSetUid); // counter_set - BOOST_CHECK(eventRecordWord2[0] == counterClass); // class - BOOST_CHECK(eventRecordWord2[1] == counterInterpolation); // interpolation - BOOST_CHECK(std::memcmp(eventRecordWord34, &counterMultiplier, sizeof(counterMultiplier)) == 0); // multiplier + CHECK(eventRecordWord0[0] == maxCounterUid); // max_counter_uid + CHECK(eventRecordWord0[1] == counterUid); // counter_uid + CHECK(eventRecordWord1[0] == deviceUid); // device + CHECK(eventRecordWord1[1] == counterSetUid); // counter_set + CHECK(eventRecordWord2[0] == counterClass); // class + CHECK(eventRecordWord2[1] == counterInterpolation); // interpolation + CHECK(std::memcmp(eventRecordWord34, &counterMultiplier, sizeof(counterMultiplier)) == 0); // multiplier ARMNN_NO_CONVERSION_WARN_BEGIN uint32_t eventRecordBlockSize = 8u * sizeof(uint32_t); @@ -737,38 +739,38 @@ BOOST_AUTO_TEST_CASE(CreateEventRecordNoUnitsTest) 1u; // Rounding to the next word ARMNN_NO_CONVERSION_WARN_END - BOOST_CHECK(eventRecord[5] == counterNameOffset); // name_offset - BOOST_CHECK(eventRecord[6] == counterDescriptionOffset); // description_offset - BOOST_CHECK(eventRecord[7] == 0); // units_offset + CHECK(eventRecord[5] == counterNameOffset); // name_offset + CHECK(eventRecord[6] == counterDescriptionOffset); // description_offset + CHECK(eventRecord[7] == 0); // units_offset // Offsets are relative to the start of the eventRecord auto eventRecordPool = reinterpret_cast(eventRecord.data()); size_t uint32_t_size = sizeof(uint32_t); // The length of the SWTrace string (name) - BOOST_CHECK(eventRecordPool[counterNameOffset] == counterName.size() + 1); + CHECK(eventRecordPool[counterNameOffset] == counterName.size() + 1); // The counter name - BOOST_CHECK(std::memcmp(eventRecordPool + + CHECK(std::memcmp(eventRecordPool + counterNameOffset + // Offset uint32_t_size, // The length of the name counterName.data(), counterName.size()) == 0); // name // The null-terminator at the end of the name - BOOST_CHECK(eventRecordPool[counterNameOffset + uint32_t_size + counterName.size()] == '\0'); + CHECK(eventRecordPool[counterNameOffset + uint32_t_size + counterName.size()] == '\0'); // The length of the SWTrace string (description) - BOOST_CHECK(eventRecordPool[counterDescriptionOffset] == counterDescription.size() + 1); + CHECK(eventRecordPool[counterDescriptionOffset] == counterDescription.size() + 1); // The counter description - BOOST_CHECK(std::memcmp(eventRecordPool + + CHECK(std::memcmp(eventRecordPool + counterDescriptionOffset + // Offset uint32_t_size, // The length of the description counterDescription.data(), counterDescription.size()) == 0); // description // The null-terminator at the end of the description - BOOST_CHECK(eventRecordPool[counterDescriptionOffset + uint32_t_size + counterDescription.size()] == '\0'); + CHECK(eventRecordPool[counterDescriptionOffset + uint32_t_size + counterDescription.size()] == '\0'); } -BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest1) +TEST_CASE("CreateInvalidEventRecordTest1") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -802,12 +804,12 @@ BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest1) std::string errorMessage; bool result = sendCounterPacketTest.CreateEventRecordTest(counter, eventRecord, errorMessage); - BOOST_CHECK(!result); - BOOST_CHECK(!errorMessage.empty()); - BOOST_CHECK(eventRecord.empty()); + CHECK(!result); + CHECK(!errorMessage.empty()); + CHECK(eventRecord.empty()); } -BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest2) +TEST_CASE("CreateInvalidEventRecordTest2") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -841,12 +843,12 @@ BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest2) std::string errorMessage; bool result = sendCounterPacketTest.CreateEventRecordTest(counter, eventRecord, errorMessage); - BOOST_CHECK(!result); - BOOST_CHECK(!errorMessage.empty()); - BOOST_CHECK(eventRecord.empty()); + CHECK(!result); + CHECK(!errorMessage.empty()); + CHECK(eventRecord.empty()); } -BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest3) +TEST_CASE("CreateInvalidEventRecordTest3") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -880,12 +882,12 @@ BOOST_AUTO_TEST_CASE(CreateInvalidEventRecordTest3) std::string errorMessage; bool result = sendCounterPacketTest.CreateEventRecordTest(counter, eventRecord, errorMessage); - BOOST_CHECK(!result); - BOOST_CHECK(!errorMessage.empty()); - BOOST_CHECK(eventRecord.empty()); + CHECK(!result); + CHECK(!errorMessage.empty()); + CHECK(eventRecord.empty()); } -BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) +TEST_CASE("CreateCategoryRecordTest") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -947,9 +949,9 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) std::string errorMessage; bool result = sendCounterPacketTest.CreateCategoryRecordTest(category, counters, categoryRecord, errorMessage); - BOOST_CHECK(result); - BOOST_CHECK(errorMessage.empty()); - BOOST_CHECK(categoryRecord.size() == 79); // Size in words: header [3] + event pointer table [3] + + CHECK(result); + CHECK(errorMessage.empty()); + CHECK(categoryRecord.size() == 79); // Size in words: header [3] + event pointer table [3] + // category name [5] + event records [68 = 22 + 20 + 26] uint16_t categoryRecordWord1[] @@ -957,8 +959,8 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) static_cast(categoryRecord[0] >> 16), static_cast(categoryRecord[0]) }; - BOOST_CHECK(categoryRecordWord1[0] == categoryEventCount); // event_count - BOOST_CHECK(categoryRecordWord1[1] == 0); // reserved + CHECK(categoryRecordWord1[0] == categoryEventCount); // event_count + CHECK(categoryRecordWord1[1] == 0); // reserved size_t uint32_t_size = sizeof(uint32_t); @@ -969,8 +971,8 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) categoryEventCount * uint32_t_size; // The size of the event pointer table ARMNN_NO_CONVERSION_WARN_END - BOOST_CHECK(categoryRecord[1] == eventPointerTableOffset); // event_pointer_table_offset - BOOST_CHECK(categoryRecord[2] == categoryNameOffset); // name_offset + CHECK(categoryRecord[1] == eventPointerTableOffset); // event_pointer_table_offset + CHECK(categoryRecord[2] == categoryNameOffset); // name_offset // Offsets are relative to the start of the category record auto categoryRecordPool = reinterpret_cast(categoryRecord.data()); @@ -978,20 +980,20 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) uint32_t eventRecord0Offset = categoryRecordPool[eventPointerTableOffset + 0 * uint32_t_size]; uint32_t eventRecord1Offset = categoryRecordPool[eventPointerTableOffset + 1 * uint32_t_size]; uint32_t eventRecord2Offset = categoryRecordPool[eventPointerTableOffset + 2 * uint32_t_size]; - BOOST_CHECK(eventRecord0Offset == 32); - BOOST_CHECK(eventRecord1Offset == 120); - BOOST_CHECK(eventRecord2Offset == 200); + CHECK(eventRecord0Offset == 32); + CHECK(eventRecord1Offset == 120); + CHECK(eventRecord2Offset == 200); // The length of the SWTrace namestring (name) - BOOST_CHECK(categoryRecordPool[categoryNameOffset] == categoryName.size() + 1); + CHECK(categoryRecordPool[categoryNameOffset] == categoryName.size() + 1); // The category name - BOOST_CHECK(std::memcmp(categoryRecordPool + + CHECK(std::memcmp(categoryRecordPool + categoryNameOffset + // Offset uint32_t_size, // The length of the name categoryName.data(), categoryName.size()) == 0); // name // The null-terminator at the end of the name - BOOST_CHECK(categoryRecordPool[categoryNameOffset + uint32_t_size + categoryName.size()] == '\0'); + CHECK(categoryRecordPool[categoryNameOffset + uint32_t_size + categoryName.size()] == '\0'); // For brevity, checking only the UIDs, max counter UIDs and names of the counters in the event records, // as the event records already have a number of unit tests dedicated to them @@ -1000,22 +1002,22 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) uint16_t eventRecord0Word0[2] = { 0u, 0u }; std::memcpy(eventRecord0Word0, categoryRecordPool + categoryRecordBlockSize + eventRecord0Offset, sizeof(eventRecord0Word0)); - BOOST_CHECK(eventRecord0Word0[0] == counter1->m_Uid); - BOOST_CHECK(eventRecord0Word0[1] == counter1->m_MaxCounterUid); + CHECK(eventRecord0Word0[0] == counter1->m_Uid); + CHECK(eventRecord0Word0[1] == counter1->m_MaxCounterUid); // Counter1 name uint32_t counter1NameOffset = 0; std::memcpy(&counter1NameOffset, categoryRecordPool + eventRecord0Offset + 5u * uint32_t_size, uint32_t_size); - BOOST_CHECK(counter1NameOffset == 0); + CHECK(counter1NameOffset == 0); // The length of the SWTrace string (name) - BOOST_CHECK(categoryRecordPool[eventRecord0Offset + // Offset to the event record + CHECK(categoryRecordPool[eventRecord0Offset + // Offset to the event record categoryRecordBlockSize + // Offset to the end of the category record block 8u * uint32_t_size + // Offset to the event record pool counter1NameOffset // Offset to the name of the counter ] == counter1->m_Name.size() + 1); // The length of the name including the // null-terminator // The counter1 name - BOOST_CHECK(std::memcmp(categoryRecordPool + // The beginning of the category pool + CHECK(std::memcmp(categoryRecordPool + // The beginning of the category pool categoryRecordBlockSize + // Offset to the end of the category record block eventRecord0Offset + // Offset to the event record 8u * uint32_t_size + // Offset to the event record pool @@ -1024,7 +1026,7 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) counter1->m_Name.data(), counter1->m_Name.size()) == 0); // name // The null-terminator at the end of the counter1 name - BOOST_CHECK(categoryRecordPool[eventRecord0Offset + // Offset to the event record + CHECK(categoryRecordPool[eventRecord0Offset + // Offset to the event record categoryRecordBlockSize + // Offset to the end of the category record block 8u * uint32_t_size + // Offset to the event record pool counter1NameOffset + // Offset to the name of the counter @@ -1039,16 +1041,16 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) eventRecord1Offset + 5u * uint32_t_size, uint32_t_size); - BOOST_CHECK(counter2NameOffset == 8u * uint32_t_size ); + CHECK(counter2NameOffset == 8u * uint32_t_size ); // The length of the SWTrace string (name) - BOOST_CHECK(categoryRecordPool[eventRecord1Offset + // Offset to the event record + CHECK(categoryRecordPool[eventRecord1Offset + // Offset to the event record categoryRecordBlockSize + counter2NameOffset // Offset to the name of the counter ] == counter2->m_Name.size() + 1); // The length of the name including the // null-terminator // The counter2 name - BOOST_CHECK(std::memcmp(categoryRecordPool + // The beginning of the category pool + CHECK(std::memcmp(categoryRecordPool + // The beginning of the category pool categoryRecordBlockSize + // Offset to the end of the category record block eventRecord1Offset + // Offset to the event record counter2NameOffset + // Offset to the name of the counter @@ -1058,7 +1060,7 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) // The null-terminator at the end of the counter2 name - BOOST_CHECK(categoryRecordPool[eventRecord1Offset + // Offset to the event record + CHECK(categoryRecordPool[eventRecord1Offset + // Offset to the event record categoryRecordBlockSize + // Offset to the end of the category record block counter2NameOffset + // Offset to the name of the counter uint32_t_size + // The length of the name @@ -1068,16 +1070,16 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) // Counter3 name uint32_t counter3NameOffset = 0; std::memcpy(&counter3NameOffset, categoryRecordPool + eventRecord2Offset + 5u * uint32_t_size, uint32_t_size); - BOOST_CHECK(counter3NameOffset == 0); + CHECK(counter3NameOffset == 0); // The length of the SWTrace string (name) - BOOST_CHECK(categoryRecordPool[eventRecord2Offset + // Offset to the event record + CHECK(categoryRecordPool[eventRecord2Offset + // Offset to the event record categoryRecordBlockSize + 8u * uint32_t_size + // Offset to the event record pool counter3NameOffset // Offset to the name of the counter ] == counter3->m_Name.size() + 1); // The length of the name including the // null-terminator // The counter3 name - BOOST_CHECK(std::memcmp(categoryRecordPool + // The beginning of the category pool + CHECK(std::memcmp(categoryRecordPool + // The beginning of the category pool categoryRecordBlockSize + eventRecord2Offset + // Offset to the event record 8u * uint32_t_size + // Offset to the event record pool @@ -1086,7 +1088,7 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) counter3->m_Name.data(), counter3->m_Name.size()) == 0); // name // The null-terminator at the end of the counter3 name - BOOST_CHECK(categoryRecordPool[eventRecord2Offset + // Offset to the event record + CHECK(categoryRecordPool[eventRecord2Offset + // Offset to the event record categoryRecordBlockSize + 8u * uint32_t_size + // Offset to the event record pool counter3NameOffset + // Offset to the name of the counter @@ -1095,7 +1097,7 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest) ] == '\0'); } -BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest1) +TEST_CASE("CreateInvalidCategoryRecordTest1") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -1103,7 +1105,7 @@ BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest1) // Create a category for testing const std::string categoryName = "some invalid category"; const CategoryPtr category = std::make_unique(categoryName); - BOOST_CHECK(category); + CHECK(category); // Create a category record Counters counters; @@ -1111,12 +1113,12 @@ BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest1) std::string errorMessage; bool result = sendCounterPacketTest.CreateCategoryRecordTest(category, counters, categoryRecord, errorMessage); - BOOST_CHECK(!result); - BOOST_CHECK(!errorMessage.empty()); - BOOST_CHECK(categoryRecord.empty()); + CHECK(!result); + CHECK(!errorMessage.empty()); + CHECK(categoryRecord.empty()); } -BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest2) +TEST_CASE("CreateInvalidCategoryRecordTest2") { MockBufferManager mockBuffer(0); SendCounterPacketTest sendCounterPacketTest(mockBuffer); @@ -1124,7 +1126,7 @@ BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest2) // Create a category for testing const std::string categoryName = "some_category"; const CategoryPtr category = std::make_unique(categoryName); - BOOST_CHECK(category); + CHECK(category); category->m_Counters = { 11u, 23u, 5670u }; // Create a collection of counters @@ -1143,19 +1145,19 @@ BOOST_AUTO_TEST_CASE(CreateInvalidCategoryRecordTest2) 0)))); Counter* counter1 = counters.find(11)->second.get(); - BOOST_CHECK(counter1); + CHECK(counter1); // Create a category record SendCounterPacket::CategoryRecord categoryRecord; std::string errorMessage; bool result = sendCounterPacketTest.CreateCategoryRecordTest(category, counters, categoryRecord, errorMessage); - BOOST_CHECK(!result); - BOOST_CHECK(!errorMessage.empty()); - BOOST_CHECK(categoryRecord.empty()); + CHECK(!result); + CHECK(!errorMessage.empty()); + CHECK(categoryRecord.empty()); } -BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest1) +TEST_CASE("SendCounterDirectoryPacketTest1") { // The counter directory used for testing CounterDirectory counterDirectory; @@ -1163,25 +1165,25 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest1) // Register a device const std::string device1Name = "device1"; const Device* device1 = nullptr; - BOOST_CHECK_NO_THROW(device1 = counterDirectory.RegisterDevice(device1Name, 3)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device1); + CHECK_NOTHROW(device1 = counterDirectory.RegisterDevice(device1Name, 3)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device1); // Register a device const std::string device2Name = "device2"; const Device* device2 = nullptr; - BOOST_CHECK_NO_THROW(device2 = counterDirectory.RegisterDevice(device2Name)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 2); - BOOST_CHECK(device2); + CHECK_NOTHROW(device2 = counterDirectory.RegisterDevice(device2Name)); + CHECK(counterDirectory.GetDeviceCount() == 2); + CHECK(device2); // Buffer with not enough space MockBufferManager mockBuffer(10); SendCounterPacket sendCounterPacket(mockBuffer); - BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), + CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::profiling::BufferExhaustion); } -BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) +TEST_CASE("SendCounterDirectoryPacketTest2") { // The counter directory used for testing CounterDirectory counterDirectory; @@ -1189,43 +1191,43 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) // Register a device const std::string device1Name = "device1"; const Device* device1 = nullptr; - BOOST_CHECK_NO_THROW(device1 = counterDirectory.RegisterDevice(device1Name, 3)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device1); + CHECK_NOTHROW(device1 = counterDirectory.RegisterDevice(device1Name, 3)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device1); // Register a device const std::string device2Name = "device2"; const Device* device2 = nullptr; - BOOST_CHECK_NO_THROW(device2 = counterDirectory.RegisterDevice(device2Name)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 2); - BOOST_CHECK(device2); + CHECK_NOTHROW(device2 = counterDirectory.RegisterDevice(device2Name)); + CHECK(counterDirectory.GetDeviceCount() == 2); + CHECK(device2); // Register a counter set const std::string counterSet1Name = "counterset1"; const CounterSet* counterSet1 = nullptr; - BOOST_CHECK_NO_THROW(counterSet1 = counterDirectory.RegisterCounterSet(counterSet1Name)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(counterSet1); + CHECK_NOTHROW(counterSet1 = counterDirectory.RegisterCounterSet(counterSet1Name)); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(counterSet1); // Register a category associated to "device1" and "counterset1" const std::string category1Name = "category1"; const Category* category1 = nullptr; - BOOST_CHECK_NO_THROW(category1 = counterDirectory.RegisterCategory(category1Name)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category1); + CHECK_NOTHROW(category1 = counterDirectory.RegisterCategory(category1Name)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category1); // Register a category not associated to "device2" but no counter set const std::string category2Name = "category2"; const Category* category2 = nullptr; - BOOST_CHECK_NO_THROW(category2 = counterDirectory.RegisterCategory(category2Name)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 2); - BOOST_CHECK(category2); + CHECK_NOTHROW(category2 = counterDirectory.RegisterCategory(category2Name)); + CHECK(counterDirectory.GetCategoryCount() == 2); + CHECK(category2); uint16_t numberOfCores = 4; // Register a counter associated to "category1" const Counter* counter1 = nullptr; - BOOST_CHECK_NO_THROW(counter1 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counter1 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 0, category1Name, 0, @@ -1235,12 +1237,12 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) "counter1description", std::string("counter1units"), numberOfCores)); - BOOST_CHECK(counterDirectory.GetCounterCount() == 4); - BOOST_CHECK(counter1); + CHECK(counterDirectory.GetCounterCount() == 4); + CHECK(counter1); // Register a counter associated to "category1" const Counter* counter2 = nullptr; - BOOST_CHECK_NO_THROW(counter2 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counter2 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 4, category1Name, 1, @@ -1252,12 +1254,12 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) armnn::EmptyOptional(), device2->m_Uid, 0)); - BOOST_CHECK(counterDirectory.GetCounterCount() == 5); - BOOST_CHECK(counter2); + CHECK(counterDirectory.GetCounterCount() == 5); + CHECK(counter2); // Register a counter associated to "category2" const Counter* counter3 = nullptr; - BOOST_CHECK_NO_THROW(counter3 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counter3 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 5, category2Name, 1, @@ -1269,13 +1271,13 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) numberOfCores, device2->m_Uid, counterSet1->m_Uid)); - BOOST_CHECK(counterDirectory.GetCounterCount() == 9); - BOOST_CHECK(counter3); + CHECK(counterDirectory.GetCounterCount() == 9); + CHECK(counter3); // Buffer with enough space MockBufferManager mockBuffer(1024); SendCounterPacket sendCounterPacket(mockBuffer); - BOOST_CHECK_NO_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory)); + CHECK_NOTHROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory)); // Get the readable buffer auto readBuffer = mockBuffer.GetReadableBuffer(); @@ -1283,9 +1285,9 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) // Check the packet header const uint32_t packetHeaderWord0 = ReadUint32(readBuffer, 0); const uint32_t packetHeaderWord1 = ReadUint32(readBuffer, 4); - BOOST_TEST(((packetHeaderWord0 >> 26) & 0x3F) == 0); // packet_family - BOOST_TEST(((packetHeaderWord0 >> 16) & 0x3FF) == 2); // packet_id - BOOST_TEST(packetHeaderWord1 == 432); // data_length + CHECK(((packetHeaderWord0 >> 26) & 0x3F) == 0); // packet_family + CHECK(((packetHeaderWord0 >> 16) & 0x3FF) == 2); // packet_id + CHECK(packetHeaderWord1 == 432); // data_length // Check the body header const uint32_t bodyHeaderWord0 = ReadUint32(readBuffer, 8); @@ -1297,28 +1299,28 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) const uint16_t deviceRecordCount = static_cast(bodyHeaderWord0 >> 16); const uint16_t counterSetRecordCount = static_cast(bodyHeaderWord2 >> 16); const uint16_t categoryRecordCount = static_cast(bodyHeaderWord4 >> 16); - BOOST_TEST(deviceRecordCount == 2); // device_records_count - BOOST_TEST(bodyHeaderWord1 == bodyHeaderSize * 4); // device_records_pointer_table_offset - BOOST_TEST(counterSetRecordCount == 1); // counter_set_count - BOOST_TEST(bodyHeaderWord3 == 8 + bodyHeaderSize * 4); // counter_set_pointer_table_offset - BOOST_TEST(categoryRecordCount == 2); // categories_count - BOOST_TEST(bodyHeaderWord5 == 12 + bodyHeaderSize * 4); // categories_pointer_table_offset + CHECK(deviceRecordCount == 2); // device_records_count + CHECK(bodyHeaderWord1 == bodyHeaderSize * 4); // device_records_pointer_table_offset + CHECK(counterSetRecordCount == 1); // counter_set_count + CHECK(bodyHeaderWord3 == 8 + bodyHeaderSize * 4); // counter_set_pointer_table_offset + CHECK(categoryRecordCount == 2); // categories_count + CHECK(bodyHeaderWord5 == 12 + bodyHeaderSize * 4); // categories_pointer_table_offset // Check the device records pointer table const uint32_t deviceRecordOffset0 = ReadUint32(readBuffer, 32); const uint32_t deviceRecordOffset1 = ReadUint32(readBuffer, 36); - BOOST_TEST(deviceRecordOffset0 == 20); // Device record offset for "device1" - BOOST_TEST(deviceRecordOffset1 == 40); // Device record offset for "device2" + CHECK(deviceRecordOffset0 == 20); // Device record offset for "device1" + CHECK(deviceRecordOffset1 == 40); // Device record offset for "device2" // Check the counter set pointer table const uint32_t counterSetRecordOffset0 = ReadUint32(readBuffer, 40); - BOOST_TEST(counterSetRecordOffset0 == 52); // Counter set record offset for "counterset1" + CHECK(counterSetRecordOffset0 == 52); // Counter set record offset for "counterset1" // Check the category pointer table const uint32_t categoryRecordOffset0 = ReadUint32(readBuffer, 44); const uint32_t categoryRecordOffset1 = ReadUint32(readBuffer, 48); - BOOST_TEST(categoryRecordOffset0 == 72); // Category record offset for "category1" - BOOST_TEST(categoryRecordOffset1 == 176); // Category record offset for "category2" + CHECK(categoryRecordOffset0 == 72); // Category record offset for "category1" + CHECK(categoryRecordOffset1 == 176); // Category record offset for "category2" // Get the device record pool offset const uint32_t uint32_t_size = sizeof(uint32_t); @@ -1373,7 +1375,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) deviceRecord.name_length = deviceRecordNameLength; // name_length unsigned char deviceRecordNameNullTerminator = // name null-terminator ReadUint8(readBuffer, deviceRecordPoolOffset + uint32_t_size + deviceRecordNameLength - 1); - BOOST_CHECK(deviceRecordNameNullTerminator == '\0'); + CHECK(deviceRecordNameNullTerminator == '\0'); std::vector deviceRecordNameBuffer(deviceRecord.name_length - 1); std::memcpy(deviceRecordNameBuffer.data(), readData + deviceRecordPoolOffset + uint32_t_size, deviceRecordNameBuffer.size()); @@ -1383,14 +1385,14 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) } // Check that the device records are correct - BOOST_CHECK(deviceRecords.size() == 2); + CHECK(deviceRecords.size() == 2); for (const DeviceRecord& deviceRecord : deviceRecords) { const Device* device = counterDirectory.GetDevice(deviceRecord.uid); - BOOST_CHECK(device); - BOOST_CHECK(device->m_Uid == deviceRecord.uid); - BOOST_CHECK(device->m_Cores == deviceRecord.cores); - BOOST_CHECK(device->m_Name == deviceRecord.name); + CHECK(device); + CHECK(device->m_Uid == deviceRecord.uid); + CHECK(device->m_Cores == deviceRecord.cores); + CHECK(device->m_Name == deviceRecord.name); } @@ -1433,7 +1435,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) counterSetRecord.name_length = counterSetRecordNameLength; // name_length unsigned char counterSetRecordNameNullTerminator = // name null-terminator ReadUint8(readBuffer, counterSetRecordPoolOffset + uint32_t_size + counterSetRecordNameLength - 1); - BOOST_CHECK(counterSetRecordNameNullTerminator == '\0'); + CHECK(counterSetRecordNameNullTerminator == '\0'); std::vector counterSetRecordNameBuffer(counterSetRecord.name_length - 1); std::memcpy(counterSetRecordNameBuffer.data(), readData + counterSetRecordPoolOffset + uint32_t_size, counterSetRecordNameBuffer.size()); @@ -1443,14 +1445,14 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) } // Check that the counter set records are correct - BOOST_CHECK(counterSetRecords.size() == 1); + CHECK(counterSetRecords.size() == 1); for (const CounterSetRecord& counterSetRecord : counterSetRecords) { const CounterSet* counterSet = counterDirectory.GetCounterSet(counterSetRecord.uid); - BOOST_CHECK(counterSet); - BOOST_CHECK(counterSet->m_Uid == counterSetRecord.uid); - BOOST_CHECK(counterSet->m_Count == counterSetRecord.count); - BOOST_CHECK(counterSet->m_Name == counterSetRecord.name); + CHECK(counterSet); + CHECK(counterSet->m_Uid == counterSetRecord.uid); + CHECK(counterSet->m_Count == counterSetRecord.count); + CHECK(counterSet->m_Name == counterSetRecord.name); } // Event record structure/collection used for testing @@ -1517,7 +1519,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) categoryRecord.name_offset + uint32_t_size + categoryRecordNameLength - 1); // name null-terminator - BOOST_CHECK(categoryRecordNameNullTerminator == '\0'); + CHECK(categoryRecordNameNullTerminator == '\0'); std::vector categoryRecordNameBuffer(categoryRecord.name_length - 1); std::memcpy(categoryRecordNameBuffer.data(), readData + @@ -1570,7 +1572,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) eventRecord.name_offset + uint32_t_size + eventRecordNameLength - 1); // name null-terminator - BOOST_CHECK(eventRecordNameNullTerminator == '\0'); + CHECK(eventRecordNameNullTerminator == '\0'); std::vector eventRecordNameBuffer(eventRecord.name_length - 1); std::memcpy(eventRecordNameBuffer.data(), readData + @@ -1589,7 +1591,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) eventRecord.description_offset + uint32_t_size + eventRecordDescriptionLength - 1); // description null-terminator - BOOST_CHECK(eventRecordDescriptionNullTerminator == '\0'); + CHECK(eventRecordDescriptionNullTerminator == '\0'); std::vector eventRecordDescriptionBuffer(eventRecord.description_length - 1); std::memcpy(eventRecordDescriptionBuffer.data(), readData + @@ -1611,7 +1613,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) eventRecord.units_offset + uint32_t_size + eventRecordUnitsLength - 1); // units null-terminator - BOOST_CHECK(eventRecordUnitsNullTerminator == '\0'); + CHECK(eventRecordUnitsNullTerminator == '\0'); std::vector eventRecordUnitsBuffer(eventRecord.units_length - 1); std::memcpy(eventRecordUnitsBuffer.data(), readData + @@ -1629,34 +1631,34 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) } // Check that the category records are correct - BOOST_CHECK(categoryRecords.size() == 2); + CHECK(categoryRecords.size() == 2); for (const CategoryRecord& categoryRecord : categoryRecords) { const Category* category = counterDirectory.GetCategory(categoryRecord.name); - BOOST_CHECK(category); - BOOST_CHECK(category->m_Name == categoryRecord.name); - BOOST_CHECK(category->m_Counters.size() == categoryRecord.event_count + static_cast(numberOfCores) -1); - BOOST_CHECK(category->m_Counters.size() == categoryRecord.event_count + static_cast(numberOfCores) -1); + CHECK(category); + CHECK(category->m_Name == categoryRecord.name); + CHECK(category->m_Counters.size() == categoryRecord.event_count + static_cast(numberOfCores) -1); + CHECK(category->m_Counters.size() == categoryRecord.event_count + static_cast(numberOfCores) -1); // Check that the event records are correct for (const EventRecord& eventRecord : categoryRecord.event_records) { const Counter* counter = counterDirectory.GetCounter(eventRecord.counter_uid); - BOOST_CHECK(counter); - BOOST_CHECK(counter->m_MaxCounterUid == eventRecord.max_counter_uid); - BOOST_CHECK(counter->m_DeviceUid == eventRecord.device); - BOOST_CHECK(counter->m_CounterSetUid == eventRecord.counter_set); - BOOST_CHECK(counter->m_Class == eventRecord.counter_class); - BOOST_CHECK(counter->m_Interpolation == eventRecord.interpolation); - BOOST_CHECK(counter->m_Multiplier == eventRecord.multiplier); - BOOST_CHECK(counter->m_Name == eventRecord.name); - BOOST_CHECK(counter->m_Description == eventRecord.description); - BOOST_CHECK(counter->m_Units == eventRecord.units); + CHECK(counter); + CHECK(counter->m_MaxCounterUid == eventRecord.max_counter_uid); + CHECK(counter->m_DeviceUid == eventRecord.device); + CHECK(counter->m_CounterSetUid == eventRecord.counter_set); + CHECK(counter->m_Class == eventRecord.counter_class); + CHECK(counter->m_Interpolation == eventRecord.interpolation); + CHECK(counter->m_Multiplier == eventRecord.multiplier); + CHECK(counter->m_Name == eventRecord.name); + CHECK(counter->m_Description == eventRecord.description); + CHECK(counter->m_Units == eventRecord.units); } } } -BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest3) +TEST_CASE("SendCounterDirectoryPacketTest3") { // Using a mock counter directory that allows to register invalid objects MockCounterDirectory counterDirectory; @@ -1664,17 +1666,17 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest3) // Register an invalid device const std::string deviceName = "inv@lid dev!c€"; const Device* device = nullptr; - BOOST_CHECK_NO_THROW(device = counterDirectory.RegisterDevice(deviceName, 3)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device); + CHECK_NOTHROW(device = counterDirectory.RegisterDevice(deviceName, 3)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device); // Buffer with enough space MockBufferManager mockBuffer(1024); SendCounterPacket sendCounterPacket(mockBuffer); - BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); + CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest4) +TEST_CASE("SendCounterDirectoryPacketTest4") { // Using a mock counter directory that allows to register invalid objects MockCounterDirectory counterDirectory; @@ -1682,17 +1684,17 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest4) // Register an invalid counter set const std::string counterSetName = "inv@lid count€rs€t"; const CounterSet* counterSet = nullptr; - BOOST_CHECK_NO_THROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(counterSet); + CHECK_NOTHROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(counterSet); // Buffer with enough space MockBufferManager mockBuffer(1024); SendCounterPacket sendCounterPacket(mockBuffer); - BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); + CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest5) +TEST_CASE("SendCounterDirectoryPacketTest5") { // Using a mock counter directory that allows to register invalid objects MockCounterDirectory counterDirectory; @@ -1700,17 +1702,17 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest5) // Register an invalid category const std::string categoryName = "c@t€gory"; const Category* category = nullptr; - BOOST_CHECK_NO_THROW(category = counterDirectory.RegisterCategory(categoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category); + CHECK_NOTHROW(category = counterDirectory.RegisterCategory(categoryName)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category); // Buffer with enough space MockBufferManager mockBuffer(1024); SendCounterPacket sendCounterPacket(mockBuffer); - BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); + CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest6) +TEST_CASE("SendCounterDirectoryPacketTest6") { // Using a mock counter directory that allows to register invalid objects MockCounterDirectory counterDirectory; @@ -1718,31 +1720,31 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest6) // Register an invalid device const std::string deviceName = "inv@lid dev!c€"; const Device* device = nullptr; - BOOST_CHECK_NO_THROW(device = counterDirectory.RegisterDevice(deviceName, 3)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device); + CHECK_NOTHROW(device = counterDirectory.RegisterDevice(deviceName, 3)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device); // Register an invalid counter set const std::string counterSetName = "inv@lid count€rs€t"; const CounterSet* counterSet = nullptr; - BOOST_CHECK_NO_THROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(counterSet); + CHECK_NOTHROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(counterSet); // Register an invalid category associated to an invalid device and an invalid counter set const std::string categoryName = "c@t€gory"; const Category* category = nullptr; - BOOST_CHECK_NO_THROW(category = counterDirectory.RegisterCategory(categoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category); + CHECK_NOTHROW(category = counterDirectory.RegisterCategory(categoryName)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category); // Buffer with enough space MockBufferManager mockBuffer(1024); SendCounterPacket sendCounterPacket(mockBuffer); - BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); + CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest7) +TEST_CASE("SendCounterDirectoryPacketTest7") { // Using a mock counter directory that allows to register invalid objects MockCounterDirectory counterDirectory; @@ -1750,27 +1752,27 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest7) // Register an valid device const std::string deviceName = "valid device"; const Device* device = nullptr; - BOOST_CHECK_NO_THROW(device = counterDirectory.RegisterDevice(deviceName, 3)); - BOOST_CHECK(counterDirectory.GetDeviceCount() == 1); - BOOST_CHECK(device); + CHECK_NOTHROW(device = counterDirectory.RegisterDevice(deviceName, 3)); + CHECK(counterDirectory.GetDeviceCount() == 1); + CHECK(device); // Register an valid counter set const std::string counterSetName = "valid counterset"; const CounterSet* counterSet = nullptr; - BOOST_CHECK_NO_THROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); - BOOST_CHECK(counterDirectory.GetCounterSetCount() == 1); - BOOST_CHECK(counterSet); + CHECK_NOTHROW(counterSet = counterDirectory.RegisterCounterSet(counterSetName)); + CHECK(counterDirectory.GetCounterSetCount() == 1); + CHECK(counterSet); // Register an valid category associated to a valid device and a valid counter set const std::string categoryName = "category"; const Category* category = nullptr; - BOOST_CHECK_NO_THROW(category = counterDirectory.RegisterCategory(categoryName)); - BOOST_CHECK(counterDirectory.GetCategoryCount() == 1); - BOOST_CHECK(category); + CHECK_NOTHROW(category = counterDirectory.RegisterCategory(categoryName)); + CHECK(counterDirectory.GetCategoryCount() == 1); + CHECK(category); // Register an invalid counter associated to a valid category const Counter* counter = nullptr; - BOOST_CHECK_NO_THROW(counter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, + CHECK_NOTHROW(counter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 0, categoryName, 0, @@ -1782,16 +1784,16 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest7) 5, device->m_Uid, counterSet->m_Uid)); - BOOST_CHECK(counterDirectory.GetCounterCount() == 5); - BOOST_CHECK(counter); + CHECK(counterDirectory.GetCounterCount() == 5); + CHECK(counter); // Buffer with enough space MockBufferManager mockBuffer(1024); SendCounterPacket sendCounterPacket(mockBuffer); - BOOST_CHECK_THROW(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); + CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendThreadTest0) +TEST_CASE("SendThreadTest0") { ProfilingStateMachine profilingStateMachine; SetActiveProfilingState(profilingStateMachine); @@ -1804,18 +1806,18 @@ BOOST_AUTO_TEST_CASE(SendThreadTest0) // Try to start the send thread many times, it must only start once sendThread.Start(mockProfilingConnection); - BOOST_CHECK(sendThread.IsRunning()); + CHECK(sendThread.IsRunning()); sendThread.Start(mockProfilingConnection); sendThread.Start(mockProfilingConnection); sendThread.Start(mockProfilingConnection); sendThread.Start(mockProfilingConnection); - BOOST_CHECK(sendThread.IsRunning()); + CHECK(sendThread.IsRunning()); sendThread.Stop(); - BOOST_CHECK(!sendThread.IsRunning()); + CHECK(!sendThread.IsRunning()); } -BOOST_AUTO_TEST_CASE(SendThreadTest1) +TEST_CASE("SendThreadTest1") { ProfilingStateMachine profilingStateMachine; SetActiveProfilingState(profilingStateMachine); @@ -1918,12 +1920,12 @@ BOOST_AUTO_TEST_CASE(SendThreadTest1) sendThread.Stop(); - BOOST_CHECK(mockStreamCounterBuffer.GetCommittedSize() == totalWrittenSize); - BOOST_CHECK(mockStreamCounterBuffer.GetReadableSize() == totalWrittenSize); - BOOST_CHECK(mockStreamCounterBuffer.GetReadSize() == totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetCommittedSize() == totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetReadableSize() == totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetReadSize() == totalWrittenSize); } -BOOST_AUTO_TEST_CASE(SendThreadTest2) +TEST_CASE("SendThreadTest2") { ProfilingStateMachine profilingStateMachine; SetActiveProfilingState(profilingStateMachine); @@ -2036,12 +2038,12 @@ BOOST_AUTO_TEST_CASE(SendThreadTest2) // read all what's remaining in the buffer sendThread.Stop(); - BOOST_CHECK(mockStreamCounterBuffer.GetCommittedSize() == totalWrittenSize); - BOOST_CHECK(mockStreamCounterBuffer.GetReadableSize() == totalWrittenSize); - BOOST_CHECK(mockStreamCounterBuffer.GetReadSize() == totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetCommittedSize() == totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetReadableSize() == totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetReadSize() == totalWrittenSize); } -BOOST_AUTO_TEST_CASE(SendThreadTest3) +TEST_CASE("SendThreadTest3") { ProfilingStateMachine profilingStateMachine; SetActiveProfilingState(profilingStateMachine); @@ -2137,14 +2139,14 @@ BOOST_AUTO_TEST_CASE(SendThreadTest3) // thread is not guaranteed to flush the buffer) sendThread.Stop(); - BOOST_CHECK(mockStreamCounterBuffer.GetCommittedSize() == totalWrittenSize); - BOOST_CHECK(mockStreamCounterBuffer.GetReadableSize() <= totalWrittenSize); - BOOST_CHECK(mockStreamCounterBuffer.GetReadSize() <= totalWrittenSize); - BOOST_CHECK(mockStreamCounterBuffer.GetReadSize() <= mockStreamCounterBuffer.GetReadableSize()); - BOOST_CHECK(mockStreamCounterBuffer.GetReadSize() <= mockStreamCounterBuffer.GetCommittedSize()); + CHECK(mockStreamCounterBuffer.GetCommittedSize() == totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetReadableSize() <= totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetReadSize() <= totalWrittenSize); + CHECK(mockStreamCounterBuffer.GetReadSize() <= mockStreamCounterBuffer.GetReadableSize()); + CHECK(mockStreamCounterBuffer.GetReadSize() <= mockStreamCounterBuffer.GetCommittedSize()); } -BOOST_AUTO_TEST_CASE(SendCounterPacketTestWithSendThread) +TEST_CASE("SendCounterPacketTestWithSendThread") { ProfilingStateMachine profilingStateMachine; SetWaitingForAckProfilingState(profilingStateMachine); @@ -2160,7 +2162,7 @@ BOOST_AUTO_TEST_CASE(SendCounterPacketTestWithSendThread) sendThread.Stop(); // check for packet in ProfilingConnection - BOOST_CHECK(mockProfilingConnection.CheckForPacket({PacketType::StreamMetaData, streamMetadataPacketsize}) == 1); + CHECK(mockProfilingConnection.CheckForPacket({PacketType::StreamMetaData, streamMetadataPacketsize}) == 1); SetActiveProfilingState(profilingStateMachine); sendThread.Start(mockProfilingConnection); @@ -2172,7 +2174,7 @@ BOOST_AUTO_TEST_CASE(SendCounterPacketTestWithSendThread) sendThread.Stop(); unsigned int counterDirectoryPacketSize = 32; // check for packet in ProfilingConnection - BOOST_CHECK(mockProfilingConnection.CheckForPacket( + CHECK(mockProfilingConnection.CheckForPacket( {PacketType::CounterDirectory, counterDirectoryPacketSize}) == 1); sendThread.Start(mockProfilingConnection); @@ -2187,11 +2189,11 @@ BOOST_AUTO_TEST_CASE(SendCounterPacketTestWithSendThread) sendThread.Stop(); unsigned int periodicCounterCapturePacketSize = 28; - BOOST_CHECK(mockProfilingConnection.CheckForPacket( + CHECK(mockProfilingConnection.CheckForPacket( {PacketType::PeriodicCounterCapture, periodicCounterCapturePacketSize}) == 1); } -BOOST_AUTO_TEST_CASE(SendThreadBufferTest) +TEST_CASE("SendThreadBufferTest") { ProfilingStateMachine profilingStateMachine; SetActiveProfilingState(profilingStateMachine); @@ -2208,10 +2210,10 @@ BOOST_AUTO_TEST_CASE(SendThreadBufferTest) // Read data from the buffer // Buffer should become readable after commit by SendStreamMetaDataPacket auto packetBuffer = bufferManager.GetReadableBuffer(); - BOOST_TEST(packetBuffer.get()); + CHECK(packetBuffer.get()); unsigned int streamMetadataPacketsize = GetStreamMetaDataPacketSize(); - BOOST_TEST(packetBuffer->GetSize() == streamMetadataPacketsize); + CHECK(packetBuffer->GetSize() == streamMetadataPacketsize); // Recommit to be read by sendCounterPacket bufferManager.Commit(packetBuffer, streamMetadataPacketsize); @@ -2231,26 +2233,26 @@ BOOST_AUTO_TEST_CASE(SendThreadBufferTest) // The buffer is read by the send thread so it should not be in the readable buffer. auto readBuffer = bufferManager.GetReadableBuffer(); - BOOST_TEST(!readBuffer); + CHECK(!readBuffer); // Successfully reserved the buffer with requested size unsigned int reservedSize = 0; auto reservedBuffer = bufferManager.Reserve(512, reservedSize); - BOOST_TEST(reservedSize == 512); - BOOST_TEST(reservedBuffer.get()); + CHECK(reservedSize == 512); + CHECK(reservedBuffer.get()); const auto writtenDataSize = mockProfilingConnection.GetWrittenDataSize(); const auto metaDataPacketCount = mockProfilingConnection.CheckForPacket({PacketType::StreamMetaData, streamMetadataPacketsize}); - BOOST_TEST(metaDataPacketCount >= 1); - BOOST_TEST(mockProfilingConnection.CheckForPacket({PacketType::CounterDirectory, 32}) == 1); - BOOST_TEST(mockProfilingConnection.CheckForPacket({PacketType::PeriodicCounterCapture, 28}) == 1); + CHECK(metaDataPacketCount >= 1); + CHECK(mockProfilingConnection.CheckForPacket({PacketType::CounterDirectory, 32}) == 1); + CHECK(mockProfilingConnection.CheckForPacket({PacketType::PeriodicCounterCapture, 28}) == 1); // Check that we only received the packets we expected - BOOST_TEST(metaDataPacketCount + 2 == writtenDataSize); + CHECK(metaDataPacketCount + 2 == writtenDataSize); } -BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket1) +TEST_CASE("SendThreadSendStreamMetadataPacket1") { ProfilingStateMachine profilingStateMachine; @@ -2261,10 +2263,10 @@ BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket1) sendThread.Start(mockProfilingConnection); // The profiling state is set to "Uninitialized", so the send thread should throw an exception - BOOST_CHECK_THROW(sendThread.Stop(), armnn::RuntimeException); + CHECK_THROWS_AS(sendThread.Stop(), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket2) +TEST_CASE("SendThreadSendStreamMetadataPacket2") { ProfilingStateMachine profilingStateMachine; SetNotConnectedProfilingState(profilingStateMachine); @@ -2276,10 +2278,10 @@ BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket2) sendThread.Start(mockProfilingConnection); // The profiling state is set to "NotConnected", so the send thread should throw an exception - BOOST_CHECK_THROW(sendThread.Stop(), armnn::RuntimeException); + CHECK_THROWS_AS(sendThread.Stop(), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket3) +TEST_CASE("SendThreadSendStreamMetadataPacket3") { ProfilingStateMachine profilingStateMachine; SetWaitingForAckProfilingState(profilingStateMachine); @@ -2294,17 +2296,17 @@ BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket3) // The profiling state is set to "WaitingForAck", so the send thread should send a Stream Metadata packet // Wait for sendThread to join - BOOST_CHECK_NO_THROW(sendThread.Stop()); + CHECK_NOTHROW(sendThread.Stop()); // Check that the buffer contains at least one Stream Metadata packet and no other packets const auto writtenDataSize = mockProfilingConnection.GetWrittenDataSize(); - BOOST_TEST(writtenDataSize >= 1u); - BOOST_TEST(mockProfilingConnection.CheckForPacket( + CHECK(writtenDataSize >= 1u); + CHECK(mockProfilingConnection.CheckForPacket( {PacketType::StreamMetaData, streamMetadataPacketsize}) == writtenDataSize); } -BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket4) +TEST_CASE("SendThreadSendStreamMetadataPacket4") { ProfilingStateMachine profilingStateMachine; SetWaitingForAckProfilingState(profilingStateMachine); @@ -2323,10 +2325,10 @@ BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket4) sendThread.Start(mockProfilingConnection); // Check that the profiling state is still "WaitingForAck" - BOOST_TEST((profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck)); + CHECK((profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck)); // Check that the buffer contains at least one Stream Metadata packet - BOOST_TEST(mockProfilingConnection.CheckForPacket({PacketType::StreamMetaData, streamMetadataPacketsize}) >= 1); + CHECK(mockProfilingConnection.CheckForPacket({PacketType::StreamMetaData, streamMetadataPacketsize}) >= 1); mockProfilingConnection.Clear(); @@ -2337,17 +2339,17 @@ BOOST_AUTO_TEST_CASE(SendThreadSendStreamMetadataPacket4) sendThread.SetReadyToRead(); // Wait for sendThread to join - BOOST_CHECK_NO_THROW(sendThread.Stop()); + CHECK_NOTHROW(sendThread.Stop()); // Check that the profiling state is still "WaitingForAck" - BOOST_TEST((profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck)); + CHECK((profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck)); // Check that the buffer contains at least one Stream Metadata packet and no other packets const auto writtenDataSize = mockProfilingConnection.GetWrittenDataSize(); - BOOST_TEST(writtenDataSize >= 1u); - BOOST_TEST(mockProfilingConnection.CheckForPacket( + CHECK(writtenDataSize >= 1u); + CHECK(mockProfilingConnection.CheckForPacket( {PacketType::StreamMetaData, streamMetadataPacketsize}) == writtenDataSize); } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp index 244f23dfb4..dd856d8590 100644 --- a/src/profiling/test/SendTimelinePacketTests.cpp +++ b/src/profiling/test/SendTimelinePacketTests.cpp @@ -15,16 +15,16 @@ #include -#include +#include #include #include using namespace armnn::profiling; -BOOST_AUTO_TEST_SUITE(SendTimelinePacketTests) - -BOOST_AUTO_TEST_CASE(SendTimelineMessageDirectoryPackageTest) +TEST_SUITE("SendTimelinePacketTests") +{ +TEST_CASE("SendTimelineMessageDirectoryPackageTest") { MockBufferManager mockBuffer(512); TimelinePacketWriterFactory timelinePacketWriterFactory(mockBuffer); @@ -47,111 +47,111 @@ BOOST_AUTO_TEST_CASE(SendTimelineMessageDirectoryPackageTest) uint32_t packetType = (packetHeaderWord0 >> 16) & 0x00000007; uint32_t streamId = (packetHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(packetFamily == 1); - BOOST_CHECK(packetClass == 0); - BOOST_CHECK(packetType == 0); - BOOST_CHECK(streamId == 0); + CHECK(packetFamily == 1); + CHECK(packetClass == 0); + CHECK(packetType == 0); + CHECK(streamId == 0); offset += uint32_t_size; uint32_t packetHeaderWord1 = ReadUint32(packetBuffer, offset); uint32_t sequenceNumbered = (packetHeaderWord1 >> 24) & 0x00000001; uint32_t dataLength = (packetHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(sequenceNumbered == 0); - BOOST_CHECK(dataLength == 443); + CHECK(sequenceNumbered == 0); + CHECK(dataLength == 443); offset += uint32_t_size; uint8_t readStreamVersion = ReadUint8(packetBuffer, offset); - BOOST_CHECK(readStreamVersion == 4); + CHECK(readStreamVersion == 4); offset += uint8_t_size; uint8_t readPointerBytes = ReadUint8(packetBuffer, offset); - BOOST_CHECK(readPointerBytes == uint64_t_size); + CHECK(readPointerBytes == uint64_t_size); offset += uint8_t_size; uint8_t readThreadIdBytes = ReadUint8(packetBuffer, offset); - BOOST_CHECK(readThreadIdBytes == ThreadIdSize); + CHECK(readThreadIdBytes == ThreadIdSize); offset += uint8_t_size; uint32_t DeclCount = ReadUint32(packetBuffer, offset); - BOOST_CHECK(DeclCount == 5); + CHECK(DeclCount == 5); offset += uint32_t_size; arm::pipe::SwTraceMessage swTraceMessage = arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()); - BOOST_CHECK(swTraceMessage.m_Id == 0); - BOOST_CHECK(swTraceMessage.m_Name == "declareLabel"); - BOOST_CHECK(swTraceMessage.m_UiName == "declare label"); - BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 2); - BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[1] == 's'); - BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 2); - BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "guid"); - BOOST_CHECK(swTraceMessage.m_ArgNames[1] == "value"); + CHECK(swTraceMessage.m_Id == 0); + CHECK(swTraceMessage.m_Name == "declareLabel"); + CHECK(swTraceMessage.m_UiName == "declare label"); + CHECK(swTraceMessage.m_ArgTypes.size() == 2); + CHECK(swTraceMessage.m_ArgTypes[0] == 'p'); + CHECK(swTraceMessage.m_ArgTypes[1] == 's'); + CHECK(swTraceMessage.m_ArgNames.size() == 2); + CHECK(swTraceMessage.m_ArgNames[0] == "guid"); + CHECK(swTraceMessage.m_ArgNames[1] == "value"); swTraceMessage = arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()); - BOOST_CHECK(swTraceMessage.m_Id == 1); - BOOST_CHECK(swTraceMessage.m_Name == "declareEntity"); - BOOST_CHECK(swTraceMessage.m_UiName == "declare entity"); - BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 1); - BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 1); - BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "guid"); + CHECK(swTraceMessage.m_Id == 1); + CHECK(swTraceMessage.m_Name == "declareEntity"); + CHECK(swTraceMessage.m_UiName == "declare entity"); + CHECK(swTraceMessage.m_ArgTypes.size() == 1); + CHECK(swTraceMessage.m_ArgTypes[0] == 'p'); + CHECK(swTraceMessage.m_ArgNames.size() == 1); + CHECK(swTraceMessage.m_ArgNames[0] == "guid"); swTraceMessage = arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()); - BOOST_CHECK(swTraceMessage.m_Id == 2); - BOOST_CHECK(swTraceMessage.m_Name == "declareEventClass"); - BOOST_CHECK(swTraceMessage.m_UiName == "declare event class"); - BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 2); - BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[1] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 2); - BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "guid"); - BOOST_CHECK(swTraceMessage.m_ArgNames[1] == "nameGuid"); + CHECK(swTraceMessage.m_Id == 2); + CHECK(swTraceMessage.m_Name == "declareEventClass"); + CHECK(swTraceMessage.m_UiName == "declare event class"); + CHECK(swTraceMessage.m_ArgTypes.size() == 2); + CHECK(swTraceMessage.m_ArgTypes[0] == 'p'); + CHECK(swTraceMessage.m_ArgTypes[1] == 'p'); + CHECK(swTraceMessage.m_ArgNames.size() == 2); + CHECK(swTraceMessage.m_ArgNames[0] == "guid"); + CHECK(swTraceMessage.m_ArgNames[1] == "nameGuid"); swTraceMessage = arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()); - BOOST_CHECK(swTraceMessage.m_Id == 3); - BOOST_CHECK(swTraceMessage.m_Name == "declareRelationship"); - BOOST_CHECK(swTraceMessage.m_UiName == "declare relationship"); - BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 5); - BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'I'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[1] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[2] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[3] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[4] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 5); - BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "relationshipType"); - BOOST_CHECK(swTraceMessage.m_ArgNames[1] == "relationshipGuid"); - BOOST_CHECK(swTraceMessage.m_ArgNames[2] == "headGuid"); - BOOST_CHECK(swTraceMessage.m_ArgNames[3] == "tailGuid"); - BOOST_CHECK(swTraceMessage.m_ArgNames[4] == "attributeGuid"); + CHECK(swTraceMessage.m_Id == 3); + CHECK(swTraceMessage.m_Name == "declareRelationship"); + CHECK(swTraceMessage.m_UiName == "declare relationship"); + CHECK(swTraceMessage.m_ArgTypes.size() == 5); + CHECK(swTraceMessage.m_ArgTypes[0] == 'I'); + CHECK(swTraceMessage.m_ArgTypes[1] == 'p'); + CHECK(swTraceMessage.m_ArgTypes[2] == 'p'); + CHECK(swTraceMessage.m_ArgTypes[3] == 'p'); + CHECK(swTraceMessage.m_ArgTypes[4] == 'p'); + CHECK(swTraceMessage.m_ArgNames.size() == 5); + CHECK(swTraceMessage.m_ArgNames[0] == "relationshipType"); + CHECK(swTraceMessage.m_ArgNames[1] == "relationshipGuid"); + CHECK(swTraceMessage.m_ArgNames[2] == "headGuid"); + CHECK(swTraceMessage.m_ArgNames[3] == "tailGuid"); + CHECK(swTraceMessage.m_ArgNames[4] == "attributeGuid"); swTraceMessage = arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()); - BOOST_CHECK(swTraceMessage.m_Id == 4); - BOOST_CHECK(swTraceMessage.m_Name == "declareEvent"); - BOOST_CHECK(swTraceMessage.m_UiName == "declare event"); - BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 3); - BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == '@'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[1] == 't'); - BOOST_CHECK(swTraceMessage.m_ArgTypes[2] == 'p'); - BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 3); - BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "timestamp"); - BOOST_CHECK(swTraceMessage.m_ArgNames[1] == "threadId"); - BOOST_CHECK(swTraceMessage.m_ArgNames[2] == "eventGuid"); + CHECK(swTraceMessage.m_Id == 4); + CHECK(swTraceMessage.m_Name == "declareEvent"); + CHECK(swTraceMessage.m_UiName == "declare event"); + CHECK(swTraceMessage.m_ArgTypes.size() == 3); + CHECK(swTraceMessage.m_ArgTypes[0] == '@'); + CHECK(swTraceMessage.m_ArgTypes[1] == 't'); + CHECK(swTraceMessage.m_ArgTypes[2] == 'p'); + CHECK(swTraceMessage.m_ArgNames.size() == 3); + CHECK(swTraceMessage.m_ArgNames[0] == "timestamp"); + CHECK(swTraceMessage.m_ArgNames[1] == "threadId"); + CHECK(swTraceMessage.m_ArgNames[2] == "eventGuid"); } -BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest) +TEST_CASE("SendTimelineEntityWithEventClassPacketTest") { MockBufferManager bufferManager(40); TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager); @@ -184,10 +184,10 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest) uint32_t entityBinaryPacketType = (entityBinaryPacketHeaderWord0 >> 16) & 0x00000007; uint32_t entityBinaryPacketStreamId = (entityBinaryPacketHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(entityBinaryPacketFamily == 1); - BOOST_CHECK(entityBinaryPacketClass == 0); - BOOST_CHECK(entityBinaryPacketType == 1); - BOOST_CHECK(entityBinaryPacketStreamId == 0); + CHECK(entityBinaryPacketFamily == 1); + CHECK(entityBinaryPacketClass == 0); + CHECK(entityBinaryPacketType == 1); + CHECK(entityBinaryPacketStreamId == 0); offset += uint32_t_size; @@ -196,40 +196,40 @@ BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest) uint32_t entityBinaryPacketSequenceNumbered = (entityBinaryPacketHeaderWord1 >> 24) & 0x00000001; uint32_t entityBinaryPacketDataLength = (entityBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(entityBinaryPacketSequenceNumbered == 0); - BOOST_CHECK(entityBinaryPacketDataLength == 32); + CHECK(entityBinaryPacketSequenceNumbered == 0); + CHECK(entityBinaryPacketDataLength == 32); // Check the decl_id offset += uint32_t_size; uint32_t entitytDecId = ReadUint32(packetBuffer, offset); - BOOST_CHECK(entitytDecId == uint32_t(1)); + CHECK(entitytDecId == uint32_t(1)); // Check the profiling GUID offset += uint32_t_size; uint64_t readProfilingGuid = ReadUint64(packetBuffer, offset); - BOOST_CHECK(readProfilingGuid == entityBinaryPacketProfilingGuid); + CHECK(readProfilingGuid == entityBinaryPacketProfilingGuid); // Reading TimelineEventClassBinaryPacket offset += uint64_t_size; uint32_t eventClassDeclId = ReadUint32(packetBuffer, offset); - BOOST_CHECK(eventClassDeclId == uint32_t(2)); + CHECK(eventClassDeclId == uint32_t(2)); // Check the profiling GUID offset += uint32_t_size; readProfilingGuid = ReadUint64(packetBuffer, offset); - BOOST_CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid); + CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid); offset += uint64_t_size; uint64_t readEventClassNameGuid = ReadUint64(packetBuffer, offset); - BOOST_CHECK(readEventClassNameGuid == eventClassBinaryPacketNameGuid); + CHECK(readEventClassNameGuid == eventClassBinaryPacketNameGuid); bufferManager.MarkRead(packetBuffer); } -BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) +TEST_CASE("SendEventClassAfterTimelineEntityPacketTest") { unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); @@ -258,29 +258,29 @@ BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) uint32_t entityBinaryPacketType = (entityBinaryPacketHeaderWord0 >> 16) & 0x00000007; uint32_t entityBinaryPacketStreamId = (entityBinaryPacketHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(entityBinaryPacketFamily == 1); - BOOST_CHECK(entityBinaryPacketClass == 0); - BOOST_CHECK(entityBinaryPacketType == 1); - BOOST_CHECK(entityBinaryPacketStreamId == 0); + CHECK(entityBinaryPacketFamily == 1); + CHECK(entityBinaryPacketClass == 0); + CHECK(entityBinaryPacketType == 1); + CHECK(entityBinaryPacketStreamId == 0); offset += uint32_t_size; uint32_t entityBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset); uint32_t entityBinaryPacketSequenceNumbered = (entityBinaryPacketHeaderWord1 >> 24) & 0x00000001; uint32_t entityBinaryPacketDataLength = (entityBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(entityBinaryPacketSequenceNumbered == 0); - BOOST_CHECK(entityBinaryPacketDataLength == 12); + CHECK(entityBinaryPacketSequenceNumbered == 0); + CHECK(entityBinaryPacketDataLength == 12); // Check the decl_id offset += uint32_t_size; uint32_t entitytDecId = ReadUint32(packetBuffer, offset); - BOOST_CHECK(entitytDecId == uint32_t(1)); + CHECK(entitytDecId == uint32_t(1)); // Check the profiling GUID offset += uint32_t_size; uint64_t readProfilingGuid = ReadUint64(packetBuffer, offset); - BOOST_CHECK(readProfilingGuid == entityBinaryPacketProfilingGuid); + CHECK(readProfilingGuid == entityBinaryPacketProfilingGuid); bufferManager.MarkRead(packetBuffer); @@ -306,30 +306,30 @@ BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) uint32_t eventClassBinaryPacketType = (eventClassBinaryPacketHeaderWord0 >> 16) & 0x00000007; uint32_t eventClassBinaryPacketStreamId = (eventClassBinaryPacketHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(eventClassBinaryPacketFamily == 1); - BOOST_CHECK(eventClassBinaryPacketClass == 0); - BOOST_CHECK(eventClassBinaryPacketType == 1); - BOOST_CHECK(eventClassBinaryPacketStreamId == 0); + CHECK(eventClassBinaryPacketFamily == 1); + CHECK(eventClassBinaryPacketClass == 0); + CHECK(eventClassBinaryPacketType == 1); + CHECK(eventClassBinaryPacketStreamId == 0); offset += uint32_t_size; uint32_t eventClassBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset); uint32_t eventClassBinaryPacketSequenceNumbered = (eventClassBinaryPacketHeaderWord1 >> 24) & 0x00000001; uint32_t eventClassBinaryPacketDataLength = (eventClassBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(eventClassBinaryPacketSequenceNumbered == 0); - BOOST_CHECK(eventClassBinaryPacketDataLength == 20); + CHECK(eventClassBinaryPacketSequenceNumbered == 0); + CHECK(eventClassBinaryPacketDataLength == 20); offset += uint32_t_size; uint32_t eventClassDeclId = ReadUint32(packetBuffer, offset); - BOOST_CHECK(eventClassDeclId == uint32_t(2)); + CHECK(eventClassDeclId == uint32_t(2)); // Check the profiling GUID offset += uint32_t_size; readProfilingGuid = ReadUint64(packetBuffer, offset); - BOOST_CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid); + CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid); offset += uint64_t_size; uint64_t readEventClassNameGuid = ReadUint64(packetBuffer, offset); - BOOST_CHECK(readEventClassNameGuid == eventClassBinaryPacketNameGuid); + CHECK(readEventClassNameGuid == eventClassBinaryPacketNameGuid); bufferManager.MarkRead(packetBuffer); @@ -355,51 +355,51 @@ BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest) uint32_t eventBinaryPacketType = (eventBinaryPacketHeaderWord0 >> 16) & 0x00000007; uint32_t eventBinaryPacketStreamId = (eventBinaryPacketHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(eventBinaryPacketFamily == 1); - BOOST_CHECK(eventBinaryPacketClass == 0); - BOOST_CHECK(eventBinaryPacketType == 1); - BOOST_CHECK(eventBinaryPacketStreamId == 0); + CHECK(eventBinaryPacketFamily == 1); + CHECK(eventBinaryPacketClass == 0); + CHECK(eventBinaryPacketType == 1); + CHECK(eventBinaryPacketStreamId == 0); offset += uint32_t_size; uint32_t eventBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset); uint32_t eventBinaryPacketSequenceNumbered = (eventBinaryPacketHeaderWord1 >> 24) & 0x00000001; uint32_t eventBinaryPacketDataLength = (eventBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(eventBinaryPacketSequenceNumbered == 0); - BOOST_CHECK(eventBinaryPacketDataLength == 20 + ThreadIdSize); + CHECK(eventBinaryPacketSequenceNumbered == 0); + CHECK(eventBinaryPacketDataLength == 20 + ThreadIdSize); // Check the decl_id offset += uint32_t_size; uint32_t eventDeclId = ReadUint32(packetBuffer, offset); - BOOST_CHECK(eventDeclId == 4); + CHECK(eventDeclId == 4); // Check the timestamp offset += uint32_t_size; uint64_t eventTimestamp = ReadUint64(packetBuffer, offset); - BOOST_CHECK(eventTimestamp == timestamp); + CHECK(eventTimestamp == timestamp); // Check the thread id offset += uint64_t_size; std::vector readThreadId(ThreadIdSize, 0); ReadBytes(packetBuffer, offset, ThreadIdSize, readThreadId.data()); - BOOST_CHECK(readThreadId == threadId); + CHECK(readThreadId == threadId); // Check the profiling GUID offset += ThreadIdSize; readProfilingGuid = ReadUint64(packetBuffer, offset); - BOOST_CHECK(readProfilingGuid == eventProfilingGuid); + CHECK(readProfilingGuid == eventProfilingGuid); } -BOOST_AUTO_TEST_CASE(SendTimelinePacketTests2) +TEST_CASE("SendTimelinePacketTests2") { MockBufferManager bufferManager(40); TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager); std::unique_ptr sendTimelinePacket = timelinePacketWriterFactory.GetSendTimelinePacket(); - BOOST_CHECK_THROW(sendTimelinePacket->SendTimelineMessageDirectoryPackage(), + CHECK_THROWS_AS(sendTimelinePacket->SendTimelineMessageDirectoryPackage(), armnn::RuntimeException); } -BOOST_AUTO_TEST_CASE(SendTimelinePacketTests3) +TEST_CASE("SendTimelinePacketTests3") { MockBufferManager bufferManager(512); TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager); @@ -418,12 +418,12 @@ BOOST_AUTO_TEST_CASE(SendTimelinePacketTests3) // Send TimelineEventClassBinaryPacket const uint64_t eventClassBinaryPacketProfilingGuid = 789123u; const uint64_t eventClassBinaryPacketNameGuid = 8845u; - BOOST_CHECK_THROW(sendTimelinePacket->SendTimelineEventClassBinaryPacket( + CHECK_THROWS_AS(sendTimelinePacket->SendTimelineEventClassBinaryPacket( eventClassBinaryPacketProfilingGuid, eventClassBinaryPacketNameGuid), armnn::profiling::BufferExhaustion); } -BOOST_AUTO_TEST_CASE(GetGuidsFromProfilingService) +TEST_CASE("GetGuidsFromProfilingService") { armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; @@ -435,16 +435,16 @@ BOOST_AUTO_TEST_CASE(GetGuidsFromProfilingService) std::hash hasher; uint64_t hash = static_cast(hasher("dummy")); ProfilingStaticGuid expectedStaticValue(hash | MIN_STATIC_GUID); - BOOST_CHECK(staticGuid == expectedStaticValue); + CHECK(staticGuid == expectedStaticValue); ProfilingDynamicGuid dynamicGuid = profilingService.GetNextGuid(); uint64_t dynamicGuidValue = static_cast(dynamicGuid); ++dynamicGuidValue; ProfilingDynamicGuid expectedDynamicValue(dynamicGuidValue); dynamicGuid = profilingService.GetNextGuid(); - BOOST_CHECK(dynamicGuid == expectedDynamicValue); + CHECK(dynamicGuid == expectedDynamicValue); } -BOOST_AUTO_TEST_CASE(GetTimelinePackerWriterFromProfilingService) +TEST_CASE("GetTimelinePackerWriterFromProfilingService") { armnn::IRuntime::CreationOptions::ExternalProfilingOptions options; options.m_EnableProfiling = true; @@ -452,36 +452,36 @@ BOOST_AUTO_TEST_CASE(GetTimelinePackerWriterFromProfilingService) profilingService.ResetExternalProfilingOptions(options, true); std::unique_ptr writer = profilingService.GetSendTimelinePacket(); - BOOST_CHECK(writer != nullptr); + CHECK(writer != nullptr); } -BOOST_AUTO_TEST_CASE(CheckStaticGuidsAndEvents) +TEST_CASE("CheckStaticGuidsAndEvents") { - BOOST_CHECK("name" == LabelsAndEventClasses::NAME_LABEL); - BOOST_CHECK("type" == LabelsAndEventClasses::TYPE_LABEL); - BOOST_CHECK("index" == LabelsAndEventClasses::INDEX_LABEL); + CHECK("name" == LabelsAndEventClasses::NAME_LABEL); + CHECK("type" == LabelsAndEventClasses::TYPE_LABEL); + CHECK("index" == LabelsAndEventClasses::INDEX_LABEL); std::hash hasher; uint64_t hash = static_cast(hasher(LabelsAndEventClasses::NAME_LABEL)); ProfilingStaticGuid expectedNameGuid(hash | MIN_STATIC_GUID); - BOOST_CHECK(LabelsAndEventClasses::NAME_GUID == expectedNameGuid); + CHECK(LabelsAndEventClasses::NAME_GUID == expectedNameGuid); hash = static_cast(hasher(LabelsAndEventClasses::TYPE_LABEL)); ProfilingStaticGuid expectedTypeGuid(hash | MIN_STATIC_GUID); - BOOST_CHECK(LabelsAndEventClasses::TYPE_GUID == expectedTypeGuid); + CHECK(LabelsAndEventClasses::TYPE_GUID == expectedTypeGuid); hash = static_cast(hasher(LabelsAndEventClasses::INDEX_LABEL)); ProfilingStaticGuid expectedIndexGuid(hash | MIN_STATIC_GUID); - BOOST_CHECK(LabelsAndEventClasses::INDEX_GUID == expectedIndexGuid); + CHECK(LabelsAndEventClasses::INDEX_GUID == expectedIndexGuid); hash = static_cast(hasher("ARMNN_PROFILING_SOL")); ProfilingStaticGuid expectedSol(hash | MIN_STATIC_GUID); - BOOST_CHECK(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS == expectedSol); + CHECK(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS == expectedSol); hash = static_cast(hasher("ARMNN_PROFILING_EOL")); ProfilingStaticGuid expectedEol(hash | MIN_STATIC_GUID); - BOOST_CHECK(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS == expectedEol); + CHECK(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS == expectedEol); } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/TimelinePacketTests.cpp b/src/profiling/test/TimelinePacketTests.cpp index 811918a3e3..37a6f45ab6 100644 --- a/src/profiling/test/TimelinePacketTests.cpp +++ b/src/profiling/test/TimelinePacketTests.cpp @@ -10,13 +10,13 @@ #include -#include +#include using namespace armnn::profiling; -BOOST_AUTO_TEST_SUITE(TimelinePacketTests) - -BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestNoBuffer) +TEST_SUITE("TimelinePacketTests") +{ +TEST_CASE("TimelineLabelPacketTestNoBuffer") { const uint64_t profilingGuid = 123456u; const std::string label = "some label"; @@ -26,11 +26,11 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestNoBuffer) nullptr, 512u, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestBufferExhaustionZeroValue) +TEST_CASE("TimelineLabelPacketTestBufferExhaustionZeroValue") { std::vector buffer(512, 0); @@ -42,11 +42,11 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestBufferExhaustionZeroValue) buffer.data(), 0, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestBufferExhaustionFixedValue) +TEST_CASE("TimelineLabelPacketTestBufferExhaustionFixedValue") { std::vector buffer(10, 0); @@ -58,11 +58,11 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestBufferExhaustionFixedValue) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestInvalidLabel) +TEST_CASE("TimelineLabelPacketTestInvalidLabel") { std::vector buffer(512, 0); @@ -74,11 +74,11 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestInvalidLabel) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Error); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::Error); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestSingleConstructionOfData) +TEST_CASE("TimelineLabelPacketTestSingleConstructionOfData") { std::vector buffer(512, 0); @@ -90,8 +90,8 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestSingleConstructionOfData) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 28); + CHECK(result == TimelinePacketStatus::Ok); + CHECK(numberOfBytesWritten == 28); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); @@ -99,28 +99,28 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestSingleConstructionOfData) // Check the packet header unsigned int offset = 0; uint32_t decl_Id = ReadUint32(buffer.data(), offset); - BOOST_CHECK(decl_Id == uint32_t(0)); + CHECK(decl_Id == uint32_t(0)); // Check the profiling GUID offset += uint32_t_size; uint64_t readProfilingGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readProfilingGuid == profilingGuid); + CHECK(readProfilingGuid == profilingGuid); // Check the SWTrace label offset += uint64_t_size; uint32_t swTraceLabelLength = ReadUint32(buffer.data(), offset); - BOOST_CHECK(swTraceLabelLength == 11); // Label length including the null-terminator + CHECK(swTraceLabelLength == 11); // Label length including the null-terminator offset += uint32_t_size; - BOOST_CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer + CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer label.data(), // The original label swTraceLabelLength - 1) == 0); // The length of the label offset += swTraceLabelLength * uint32_t_size; - BOOST_CHECK(buffer[offset] == '\0'); // The null-terminator at the end of the SWTrace label + CHECK(buffer[offset] == '\0'); // The null-terminator at the end of the SWTrace label } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketNullBufferTest) +TEST_CASE("TimelineRelationshipPacketNullBufferTest") { ProfilingRelationshipType relationshipType = ProfilingRelationshipType::DataLink; const uint64_t relationshipGuid = 123456u; @@ -136,11 +136,11 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketNullBufferTest) nullptr, 512u, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketZeroBufferSizeTest) +TEST_CASE("TimelineRelationshipPacketZeroBufferSizeTest") { std::vector buffer(512, 0); @@ -158,11 +158,11 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketZeroBufferSizeTest) buffer.data(), 0, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketSmallBufferSizeTest) +TEST_CASE("TimelineRelationshipPacketSmallBufferSizeTest") { std::vector buffer(10, 0); @@ -181,11 +181,11 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketSmallBufferSizeTest) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketInvalidRelationTest) +TEST_CASE("TimelineRelationshipPacketInvalidRelationTest") { std::vector buffer(512, 0); ProfilingRelationshipType relationshipType = static_cast(5); @@ -196,7 +196,7 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketInvalidRelationTest) unsigned int numberOfBytesWritten = 789u; - BOOST_CHECK_THROW(WriteTimelineRelationshipBinary(relationshipType, + CHECK_THROWS_AS(WriteTimelineRelationshipBinary(relationshipType, relationshipGuid, headGuid, tailGuid, @@ -206,10 +206,10 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketInvalidRelationTest) numberOfBytesWritten), armnn::InvalidArgumentException); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketTestDataConstruction) +TEST_CASE("TimelineRelationshipPacketTestDataConstruction") { std::vector buffer(512, 0); @@ -228,8 +228,8 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketTestDataConstruction) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 40); + CHECK(result == TimelinePacketStatus::Ok); + CHECK(numberOfBytesWritten == 40); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); @@ -238,35 +238,35 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketTestDataConstruction) unsigned int offset = 0; // Check the decl_id uint32_t readDeclId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readDeclId == 3); + CHECK(readDeclId == 3); // Check the relationship type offset += uint32_t_size; uint32_t readRelationshipType = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readRelationshipType == 0); + CHECK(readRelationshipType == 0); // Check the relationship GUID offset += uint32_t_size; uint64_t readRelationshipGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readRelationshipGuid == relationshipGuid); + CHECK(readRelationshipGuid == relationshipGuid); // Check the head GUID offset += uint64_t_size; uint64_t readHeadGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readHeadGuid == headGuid); + CHECK(readHeadGuid == headGuid); // Check the tail GUID offset += uint64_t_size; uint64_t readTailGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readTailGuid == tailGuid); + CHECK(readTailGuid == tailGuid); // Check the attribute GUID offset += uint64_t_size; uint64_t readAttributeGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readAttributeGuid == attributeGuid); + CHECK(readAttributeGuid == attributeGuid); } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketExecutionLinkTestDataConstruction) +TEST_CASE("TimelineRelationshipPacketExecutionLinkTestDataConstruction") { std::vector buffer(512, 0); @@ -285,44 +285,44 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketExecutionLinkTestDataConstruction buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 40); + CHECK(result == TimelinePacketStatus::Ok); + CHECK(numberOfBytesWritten == 40); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); unsigned int offset = 0; uint32_t readDeclId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readDeclId == 3); + CHECK(readDeclId == 3); // Check the relationship type offset += uint32_t_size; uint32_t readRelationshipType = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readRelationshipType == 1); + CHECK(readRelationshipType == 1); // Check the relationship GUID offset += uint32_t_size; uint64_t readRelationshipGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readRelationshipGuid == relationshipGuid); + CHECK(readRelationshipGuid == relationshipGuid); // Check the head GUID offset += uint64_t_size; uint64_t readHeadGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readHeadGuid == headGuid); + CHECK(readHeadGuid == headGuid); // Check the tail GUID offset += uint64_t_size; uint64_t readTailGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readTailGuid == tailGuid); + CHECK(readTailGuid == tailGuid); // Check the attribute GUID offset += uint64_t_size; uint64_t readAttributeGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readAttributeGuid == attributeGuid); + CHECK(readAttributeGuid == attributeGuid); } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketDataLinkTestDataConstruction) +TEST_CASE("TimelineRelationshipPacketDataLinkTestDataConstruction") { std::vector buffer(512, 0); @@ -341,44 +341,44 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketDataLinkTestDataConstruction) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 40); + CHECK(result == TimelinePacketStatus::Ok); + CHECK(numberOfBytesWritten == 40); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); unsigned int offset = 0; uint32_t readDeclId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readDeclId == 3); + CHECK(readDeclId == 3); // Check the relationship type offset += uint32_t_size; uint32_t readRelationshipType = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readRelationshipType == 2); + CHECK(readRelationshipType == 2); // Check the relationship GUID offset += uint32_t_size; uint64_t readRelationshipGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readRelationshipGuid == relationshipGuid); + CHECK(readRelationshipGuid == relationshipGuid); // Check the head GUID offset += uint64_t_size; uint64_t readHeadGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readHeadGuid == headGuid); + CHECK(readHeadGuid == headGuid); // Check the tail GUID offset += uint64_t_size; uint64_t readTailGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readTailGuid == tailGuid); + CHECK(readTailGuid == tailGuid); // Check the attribute GUID offset += uint64_t_size; uint64_t readAttributeGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readAttributeGuid == attributeGuid); + CHECK(readAttributeGuid == attributeGuid); } -BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketLabelLinkTestDataConstruction) +TEST_CASE("TimelineRelationshipPacketLabelLinkTestDataConstruction") { std::vector buffer(512, 0); @@ -397,8 +397,8 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketLabelLinkTestDataConstruction) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 40); + CHECK(result == TimelinePacketStatus::Ok); + CHECK(numberOfBytesWritten == 40); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); @@ -406,45 +406,45 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketLabelLinkTestDataConstruction) // Check the packet header unsigned int offset = 0; uint32_t readDeclId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readDeclId == 3); + CHECK(readDeclId == 3); // Check the relationship type offset += uint32_t_size; uint32_t readRelationshipType = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readRelationshipType == 3); + CHECK(readRelationshipType == 3); // Check the relationship GUID offset += uint32_t_size; uint64_t readRelationshipGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readRelationshipGuid == relationshipGuid); + CHECK(readRelationshipGuid == relationshipGuid); // Check the head GUID offset += uint64_t_size; uint64_t readHeadGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readHeadGuid == headGuid); + CHECK(readHeadGuid == headGuid); // Check the tail GUID offset += uint64_t_size; uint64_t readTailGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readTailGuid == tailGuid); + CHECK(readTailGuid == tailGuid); // Check the attribute GUID offset += uint64_t_size; uint64_t readAttributeGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readAttributeGuid == attributeGuid); + CHECK(readAttributeGuid == attributeGuid); } -BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestNoBuffer) +TEST_CASE("TimelineMessageDirectoryPacketTestNoBuffer") { unsigned int numberOfBytesWritten = 789u; TimelinePacketStatus result = WriteTimelineMessageDirectoryPackage(nullptr, 512u, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestBufferExhausted) +TEST_CASE("TimelineMessageDirectoryPacketTestBufferExhausted") { std::vector buffer(512, 0); @@ -452,20 +452,20 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestBufferExhausted) TimelinePacketStatus result = WriteTimelineMessageDirectoryPackage(buffer.data(), 0, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction) +TEST_CASE("TimelineMessageDirectoryPacketTestFullConstruction") { std::vector buffer(512, 0); unsigned int numberOfBytesWritten = 789u; TimelinePacketStatus result = WriteTimelineMessageDirectoryPackage(buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); + CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 451); + CHECK(numberOfBytesWritten == 451); unsigned int uint8_t_size = sizeof(uint8_t); unsigned int uint32_t_size = sizeof(uint32_t); @@ -478,38 +478,38 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction) uint32_t packetClass = (packetHeaderWord0 >> 19) & 0x0000007F; uint32_t packetType = (packetHeaderWord0 >> 16) & 0x00000007; uint32_t streamId = (packetHeaderWord0 >> 0) & 0x00000007; - BOOST_CHECK(packetFamily == 1); - BOOST_CHECK(packetClass == 0); - BOOST_CHECK(packetType == 0); - BOOST_CHECK(streamId == 0); + CHECK(packetFamily == 1); + CHECK(packetClass == 0); + CHECK(packetType == 0); + CHECK(streamId == 0); offset += uint32_t_size; uint32_t packetHeaderWord1 = ReadUint32(buffer.data(), offset); uint32_t sequenceNumbered = (packetHeaderWord1 >> 24) & 0x00000001; uint32_t dataLength = (packetHeaderWord1 >> 0) & 0x00FFFFFF; - BOOST_CHECK(sequenceNumbered == 0); - BOOST_CHECK(dataLength == 443); + CHECK(sequenceNumbered == 0); + CHECK(dataLength == 443); // Check the stream header offset += uint32_t_size; uint8_t readStreamVersion = ReadUint8(buffer.data(), offset); - BOOST_CHECK(readStreamVersion == 4); + CHECK(readStreamVersion == 4); offset += uint8_t_size; uint8_t readPointerBytes = ReadUint8(buffer.data(), offset); - BOOST_CHECK(readPointerBytes == uint64_t_size); + CHECK(readPointerBytes == uint64_t_size); offset += uint8_t_size; uint8_t readThreadIdBytes = ReadUint8(buffer.data(), offset); - BOOST_CHECK(readThreadIdBytes == ThreadIdSize); + CHECK(readThreadIdBytes == ThreadIdSize); // Check the number of declarations offset += uint8_t_size; uint32_t declCount = ReadUint32(buffer.data(), offset); - BOOST_CHECK(declCount == 5); + CHECK(declCount == 5); // Check the decl_id offset += uint32_t_size; uint32_t readDeclId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readDeclId == 0); + CHECK(readDeclId == 0); // SWTrace "namestring" format // length of the string (first 4 bytes) + string + null terminator @@ -517,11 +517,11 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction) // Check the decl_name offset += uint32_t_size; uint32_t swTraceDeclNameLength = ReadUint32(buffer.data(), offset); - BOOST_CHECK(swTraceDeclNameLength == 13); // decl_name length including the null-terminator + CHECK(swTraceDeclNameLength == 13); // decl_name length including the null-terminator std::string label = "declareLabel"; offset += uint32_t_size; - BOOST_CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer + CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer label.data(), // The original label swTraceDeclNameLength - 1) == 0); // The length of the label @@ -530,11 +530,11 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction) arm::pipe::StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; uint32_t swTraceUINameLength = ReadUint32(buffer.data(), offset); - BOOST_CHECK(swTraceUINameLength == 14); // ui_name length including the null-terminator + CHECK(swTraceUINameLength == 14); // ui_name length including the null-terminator label = "declare label"; offset += uint32_t_size; - BOOST_CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer + CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer label.data(), // The original label swTraceUINameLength - 1) == 0); // The length of the label @@ -542,11 +542,11 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction) arm::pipe::StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; uint32_t swTraceArgTypesLength = ReadUint32(buffer.data(), offset); - BOOST_CHECK(swTraceArgTypesLength == 3); // arg_types length including the null-terminator + CHECK(swTraceArgTypesLength == 3); // arg_types length including the null-terminator label = "ps"; offset += uint32_t_size; - BOOST_CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer + CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer label.data(), // The original label swTraceArgTypesLength - 1) == 0); // The length of the label @@ -554,11 +554,11 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction) arm::pipe::StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; uint32_t swTraceArgNamesLength = ReadUint32(buffer.data(), offset); - BOOST_CHECK(swTraceArgNamesLength == 11); // arg_names length including the null-terminator + CHECK(swTraceArgNamesLength == 11); // arg_names length including the null-terminator label = "guid,value"; offset += uint32_t_size; - BOOST_CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer + CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer label.data(), // The original label swTraceArgNamesLength - 1) == 0); // The length of the label @@ -566,21 +566,21 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction) arm::pipe::StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; readDeclId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readDeclId == 1); + CHECK(readDeclId == 1); // Check second decl_name offset += uint32_t_size; swTraceDeclNameLength = ReadUint32(buffer.data(), offset); - BOOST_CHECK(swTraceDeclNameLength == 14); // decl_name length including the null-terminator + CHECK(swTraceDeclNameLength == 14); // decl_name length including the null-terminator label = "declareEntity"; offset += uint32_t_size; - BOOST_CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer + CHECK(std::memcmp(buffer.data() + offset, // Offset to the label in the buffer label.data(), // The original label swTraceDeclNameLength - 1) == 0); // The length of the label } -BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestNoBuffer) +TEST_CASE("TimelineEntityPacketTestNoBuffer") { const uint64_t profilingGuid = 123456u; unsigned int numberOfBytesWritten = 789u; @@ -588,11 +588,11 @@ BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestNoBuffer) nullptr, 512u, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestBufferExhaustedWithZeroBufferSize) +TEST_CASE("TimelineEntityPacketTestBufferExhaustedWithZeroBufferSize") { std::vector buffer(512, 0); @@ -602,11 +602,11 @@ BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestBufferExhaustedWithZeroBufferSize) buffer.data(), 0, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestBufferExhaustedWithFixedBufferSize) +TEST_CASE("TimelineEntityPacketTestBufferExhaustedWithFixedBufferSize") { std::vector buffer(10, 0); @@ -616,11 +616,11 @@ BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestBufferExhaustedWithFixedBufferSize) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestFullConstructionOfData) +TEST_CASE("TimelineEntityPacketTestFullConstructionOfData") { std::vector buffer(512, 0); @@ -630,23 +630,23 @@ BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestFullConstructionOfData) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 12); + CHECK(result == TimelinePacketStatus::Ok); + CHECK(numberOfBytesWritten == 12); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int offset = 0; // Check decl_Id uint32_t decl_Id = ReadUint32(buffer.data(), offset); - BOOST_CHECK(decl_Id == uint32_t(1)); + CHECK(decl_Id == uint32_t(1)); // Check the profiling GUID offset += uint32_t_size; uint64_t readProfilingGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readProfilingGuid == profilingGuid); + CHECK(readProfilingGuid == profilingGuid); } -BOOST_AUTO_TEST_CASE(TimelineEventClassTestNoBuffer) +TEST_CASE("TimelineEventClassTestNoBuffer") { const uint64_t profilingGuid = 123456u; const uint64_t profilingNameGuid = 3345u; @@ -656,11 +656,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestNoBuffer) nullptr, 512u, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEventClassTestBufferExhaustionZeroValue) +TEST_CASE("TimelineEventClassTestBufferExhaustionZeroValue") { std::vector buffer(512, 0); @@ -672,11 +672,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestBufferExhaustionZeroValue) buffer.data(), 0, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEventClassTestBufferExhaustionFixedValue) +TEST_CASE("TimelineEventClassTestBufferExhaustionFixedValue") { std::vector buffer(10, 0); @@ -688,11 +688,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestBufferExhaustionFixedValue) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEventClassTestFullConstructionOfData) +TEST_CASE("TimelineEventClassTestFullConstructionOfData") { std::vector buffer(512, 0); @@ -704,8 +704,8 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestFullConstructionOfData) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); - BOOST_CHECK(numberOfBytesWritten == 20); + CHECK(result == TimelinePacketStatus::Ok); + CHECK(numberOfBytesWritten == 20); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); @@ -713,19 +713,19 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestFullConstructionOfData) unsigned int offset = 0; // Check the decl_id uint32_t declId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(declId == uint32_t(2)); + CHECK(declId == uint32_t(2)); // Check the profiling GUID offset += uint32_t_size; uint64_t readProfilingGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readProfilingGuid == profilingGuid); + CHECK(readProfilingGuid == profilingGuid); offset += uint64_t_size; uint64_t readProfilingNameGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readProfilingNameGuid == profilingNameGuid); + CHECK(readProfilingNameGuid == profilingNameGuid); } -BOOST_AUTO_TEST_CASE(TimelineEventPacketTestNoBuffer) +TEST_CASE("TimelineEventPacketTestNoBuffer") { const uint64_t timestamp = 456789u; const int threadId = armnnUtils::Threads::GetCurrentThreadId(); @@ -737,11 +737,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestNoBuffer) nullptr, 512u, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEventPacketTestBufferExhaustionZeroValue) +TEST_CASE("TimelineEventPacketTestBufferExhaustionZeroValue") { std::vector buffer(512, 0); @@ -755,11 +755,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestBufferExhaustionZeroValue) buffer.data(), 0, numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEventPacketTestBufferExhaustionFixedValue) +TEST_CASE("TimelineEventPacketTestBufferExhaustionFixedValue") { std::vector buffer(10, 0); @@ -773,11 +773,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestBufferExhaustionFixedValue) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::BufferExhaustion); - BOOST_CHECK(numberOfBytesWritten == 0); + CHECK(result == TimelinePacketStatus::BufferExhaustion); + CHECK(numberOfBytesWritten == 0); } -BOOST_AUTO_TEST_CASE(TimelineEventPacketTestFullConstructionOfData) +TEST_CASE("TimelineEventPacketTestFullConstructionOfData") { std::vector buffer(512, 0); @@ -791,32 +791,32 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestFullConstructionOfData) buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten); - BOOST_CHECK(result == TimelinePacketStatus::Ok); + CHECK(result == TimelinePacketStatus::Ok); unsigned int uint32_t_size = sizeof(uint32_t); unsigned int uint64_t_size = sizeof(uint64_t); - BOOST_CHECK(numberOfBytesWritten == 20 + ThreadIdSize); + CHECK(numberOfBytesWritten == 20 + ThreadIdSize); unsigned int offset = 0; // Check the decl_id uint32_t readDeclId = ReadUint32(buffer.data(), offset); - BOOST_CHECK(readDeclId == 4); + CHECK(readDeclId == 4); // Check the timestamp offset += uint32_t_size; uint64_t readTimestamp = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readTimestamp == timestamp); + CHECK(readTimestamp == timestamp); // Check the thread id offset += uint64_t_size; std::vector readThreadId(ThreadIdSize, 0); ReadBytes(buffer.data(), offset, ThreadIdSize, readThreadId.data()); - BOOST_CHECK(readThreadId == threadId); + CHECK(readThreadId == threadId); // Check the profiling GUID offset += ThreadIdSize; uint64_t readProfilingGuid = ReadUint64(buffer.data(), offset); - BOOST_CHECK(readProfilingGuid == profilingGuid); + CHECK(readProfilingGuid == profilingGuid); } -BOOST_AUTO_TEST_SUITE_END() +} diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp index cbe3b797a3..1e733df405 100644 --- a/src/profiling/test/TimelineUtilityMethodsTests.cpp +++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp @@ -13,14 +13,14 @@ #include -#include +#include using namespace armnn; using namespace armnn::profiling; -BOOST_AUTO_TEST_SUITE(TimelineUtilityMethodsTests) - -BOOST_AUTO_TEST_CASE(CreateTypedLabelTest) +TEST_SUITE("TimelineUtilityMethodsTests") +{ +TEST_CASE("CreateTypedLabelTest") { MockBufferManager mockBufferManager(1024); ProfilingService profilingService; @@ -35,18 +35,18 @@ BOOST_AUTO_TEST_CASE(CreateTypedLabelTest) const std::string entityName = "some entity"; ProfilingStaticGuid labelTypeGuid(456); - BOOST_CHECK_NO_THROW(timelineUtilityMethods.MarkEntityWithLabel(entityGuid, entityName, labelTypeGuid)); + CHECK_NOTHROW(timelineUtilityMethods.MarkEntityWithLabel(entityGuid, entityName, labelTypeGuid)); // Commit all packets at once timelineUtilityMethods.Commit(); // Get the readable buffer auto readableBuffer = mockBufferManager.GetReadableBuffer(); - BOOST_CHECK(readableBuffer != nullptr); + CHECK(readableBuffer != nullptr); unsigned int size = readableBuffer->GetSize(); - BOOST_CHECK(size == 76); + CHECK(size == 76); const unsigned char* readableData = readableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); // Utils unsigned int offset = 0; @@ -70,21 +70,21 @@ BOOST_AUTO_TEST_CASE(CreateTypedLabelTest) mockBufferManager.MarkRead(readableBuffer); } -BOOST_AUTO_TEST_CASE(SendWellKnownLabelsAndEventClassesTest) +TEST_CASE("SendWellKnownLabelsAndEventClassesTest") { MockBufferManager mockBufferManager(1024); ProfilingService profilingService; SendTimelinePacket sendTimelinePacket(mockBufferManager); - BOOST_CHECK_NO_THROW(TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(sendTimelinePacket)); + CHECK_NOTHROW(TimelineUtilityMethods::SendWellKnownLabelsAndEventClasses(sendTimelinePacket)); // Get the readable buffer auto readableBuffer = mockBufferManager.GetReadableBuffer(); - BOOST_CHECK(readableBuffer != nullptr); + CHECK(readableBuffer != nullptr); unsigned int size = readableBuffer->GetSize(); - BOOST_TEST(size == 460); + CHECK(size == 460); const unsigned char* readableData = readableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); // Utils unsigned int offset = 0; @@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE(SendWellKnownLabelsAndEventClassesTest) mockBufferManager.MarkRead(readableBuffer); } -BOOST_AUTO_TEST_CASE(CreateNamedTypedChildEntityTest) +TEST_CASE("CreateNamedTypedChildEntityTest") { MockBufferManager mockBufferManager(1024); ProfilingService profilingService; @@ -212,30 +212,30 @@ BOOST_AUTO_TEST_CASE(CreateNamedTypedChildEntityTest) // Generate first guid to ensure that the named typed entity guid is not 0 on local single test. profilingService.NextGuid(); - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, "", entityType), + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, "", entityType), InvalidArgumentException); - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName, ""), + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName, ""), InvalidArgumentException); - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity( + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity( childEntityGuid, parentEntityGuid, "", entityType), InvalidArgumentException); - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity( + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity( childEntityGuid, parentEntityGuid, entityName, ""), InvalidArgumentException); - BOOST_CHECK_NO_THROW(childEntityGuid = timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, + CHECK_NOTHROW(childEntityGuid = timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName, entityType)); - BOOST_CHECK(childEntityGuid != ProfilingGuid(0)); + CHECK(childEntityGuid != ProfilingGuid(0)); // Commit all packets at once timelineUtilityMethods.Commit(); // Get the readable buffer auto readableBuffer = mockBufferManager.GetReadableBuffer(); - BOOST_CHECK(readableBuffer != nullptr); + CHECK(readableBuffer != nullptr); unsigned int size = readableBuffer->GetSize(); - BOOST_CHECK(size == 196); + CHECK(size == 196); const unsigned char* readableData = readableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); // Utils unsigned int offset = 0; @@ -284,7 +284,7 @@ BOOST_AUTO_TEST_CASE(CreateNamedTypedChildEntityTest) mockBufferManager.MarkRead(readableBuffer); } -BOOST_AUTO_TEST_CASE(DeclareLabelTest) +TEST_CASE("DeclareLabelTest") { MockBufferManager mockBufferManager(1024); ProfilingService profilingService; @@ -295,25 +295,25 @@ BOOST_AUTO_TEST_CASE(DeclareLabelTest) profilingService.NextGuid(); // Try declaring an invalid (empty) label - BOOST_CHECK_THROW(timelineUtilityMethods.DeclareLabel(""), InvalidArgumentException); + CHECK_THROWS_AS(timelineUtilityMethods.DeclareLabel(""), InvalidArgumentException); // Try declaring an invalid (wrong SWTrace format) label - BOOST_CHECK_THROW(timelineUtilityMethods.DeclareLabel("inv@lid lab€l"), RuntimeException); + CHECK_THROWS_AS(timelineUtilityMethods.DeclareLabel("inv@lid lab€l"), RuntimeException); // Declare a valid label const std::string labelName = "valid label"; ProfilingGuid labelGuid = 0; - BOOST_CHECK_NO_THROW(labelGuid = timelineUtilityMethods.DeclareLabel(labelName)); - BOOST_CHECK(labelGuid != ProfilingGuid(0)); + CHECK_NOTHROW(labelGuid = timelineUtilityMethods.DeclareLabel(labelName)); + CHECK(labelGuid != ProfilingGuid(0)); // Try adding the same label as before ProfilingGuid newLabelGuid = 0; - BOOST_CHECK_NO_THROW(newLabelGuid = timelineUtilityMethods.DeclareLabel(labelName)); - BOOST_CHECK(newLabelGuid != ProfilingGuid(0)); - BOOST_CHECK(newLabelGuid == labelGuid); + CHECK_NOTHROW(newLabelGuid = timelineUtilityMethods.DeclareLabel(labelName)); + CHECK(newLabelGuid != ProfilingGuid(0)); + CHECK(newLabelGuid == labelGuid); } -BOOST_AUTO_TEST_CASE(CreateNameTypeEntityInvalidTest) +TEST_CASE("CreateNameTypeEntityInvalidTest") { MockBufferManager mockBufferManager(1024); ProfilingService profilingService; @@ -321,24 +321,24 @@ BOOST_AUTO_TEST_CASE(CreateNameTypeEntityInvalidTest) TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); // Invalid name - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity("", "Type"), InvalidArgumentException); + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity("", "Type"), InvalidArgumentException); // Invalid type - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity("Name", ""), InvalidArgumentException); + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity("Name", ""), InvalidArgumentException); ProfilingDynamicGuid guid = profilingService.NextGuid(); // CreatedNamedTypedEntity with Guid - Invalid name - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid, "", "Type"), + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity(guid, "", "Type"), InvalidArgumentException); // CreatedNamedTypedEntity with Guid - Invalid type - BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid, "Name", ""), + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity(guid, "Name", ""), InvalidArgumentException); } -BOOST_AUTO_TEST_CASE(CreateNameTypeEntityTest) +TEST_CASE("CreateNameTypeEntityTest") { MockBufferManager mockBufferManager(1024); ProfilingService profilingService; @@ -352,18 +352,18 @@ BOOST_AUTO_TEST_CASE(CreateNameTypeEntityTest) profilingService.NextGuid(); ProfilingDynamicGuid guid = timelineUtilityMethods.CreateNamedTypedEntity(entityName, entityType); - BOOST_CHECK(guid != ProfilingGuid(0)); + CHECK(guid != ProfilingGuid(0)); // Commit all packets at once timelineUtilityMethods.Commit(); // Get the readable buffer auto readableBuffer = mockBufferManager.GetReadableBuffer(); - BOOST_CHECK(readableBuffer != nullptr); + CHECK(readableBuffer != nullptr); unsigned int size = readableBuffer->GetSize(); - BOOST_CHECK(size == 148); + CHECK(size == 148); const unsigned char* readableData = readableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); // Utils unsigned int offset = 0; @@ -405,7 +405,7 @@ BOOST_AUTO_TEST_CASE(CreateNameTypeEntityTest) mockBufferManager.MarkRead(readableBuffer); } -BOOST_AUTO_TEST_CASE(RecordEventTest) +TEST_CASE("RecordEventTest") { MockBufferManager mockBufferManager(1024); ProfilingService profilingService; @@ -417,21 +417,21 @@ BOOST_AUTO_TEST_CASE(RecordEventTest) ProfilingGuid entityGuid(123); ProfilingStaticGuid eventClassGuid(456); ProfilingDynamicGuid eventGuid(0); - BOOST_CHECK_NO_THROW(eventGuid = timelineUtilityMethods.RecordEvent(entityGuid, eventClassGuid)); - BOOST_CHECK(eventGuid != ProfilingGuid(0)); + CHECK_NOTHROW(eventGuid = timelineUtilityMethods.RecordEvent(entityGuid, eventClassGuid)); + CHECK(eventGuid != ProfilingGuid(0)); // Commit all packets at once timelineUtilityMethods.Commit(); // Get the readable buffer auto readableBuffer = mockBufferManager.GetReadableBuffer(); - BOOST_CHECK(readableBuffer != nullptr); + CHECK(readableBuffer != nullptr); unsigned int size = readableBuffer->GetSize(); - BOOST_CHECK(size == 68 + ThreadIdSize); + CHECK(size == 68 + ThreadIdSize); const unsigned char* readableData = readableBuffer->GetReadableData(); - BOOST_CHECK(readableData != nullptr); + CHECK(readableData != nullptr); // Utils unsigned int offset = 0; @@ -455,4 +455,4 @@ BOOST_AUTO_TEST_CASE(RecordEventTest) mockBufferManager.MarkRead(readableBuffer); } -BOOST_AUTO_TEST_SUITE_END() +} -- cgit v1.2.1