aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/TimelinePacketTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/test/TimelinePacketTests.cpp')
-rw-r--r--src/profiling/test/TimelinePacketTests.cpp296
1 files changed, 148 insertions, 148 deletions
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 <common/include/SwTrace.hpp>
-#include <boost/test/unit_test.hpp>
+#include <doctest/doctest.h>
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<unsigned char> 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<unsigned char> buffer(10, 0);
@@ -58,11 +58,11 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestBufferExhaustionFixedValue)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -74,11 +74,11 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestInvalidLabel)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -90,8 +90,8 @@ BOOST_AUTO_TEST_CASE(TimelineLabelPacketTestSingleConstructionOfData)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> 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<unsigned char> buffer(10, 0);
@@ -181,11 +181,11 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketSmallBufferSizeTest)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
ProfilingRelationshipType relationshipType = static_cast<ProfilingRelationshipType>(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<unsigned char> buffer(512, 0);
@@ -228,8 +228,8 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketTestDataConstruction)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -285,44 +285,44 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketExecutionLinkTestDataConstruction
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -341,44 +341,44 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketDataLinkTestDataConstruction)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -397,8 +397,8 @@ BOOST_AUTO_TEST_CASE(TimelineRelationshipPacketLabelLinkTestDataConstruction)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> 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<unsigned char> buffer(512, 0);
unsigned int numberOfBytesWritten = 789u;
TimelinePacketStatus result = WriteTimelineMessageDirectoryPackage(buffer.data(),
armnn::numeric_cast<unsigned int>(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<arm::pipe::SwTraceCharPolicy>(label, swTraceString);
offset += (armnn::numeric_cast<unsigned int>(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<arm::pipe::SwTraceCharPolicy>(label, swTraceString);
offset += (armnn::numeric_cast<unsigned int>(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<arm::pipe::SwTraceCharPolicy>(label, swTraceString);
offset += (armnn::numeric_cast<unsigned int>(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<arm::pipe::SwTraceCharPolicy>(label, swTraceString);
offset += (armnn::numeric_cast<unsigned int>(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<unsigned char> 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<unsigned char> buffer(10, 0);
@@ -616,11 +616,11 @@ BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestBufferExhaustedWithFixedBufferSize)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -630,23 +630,23 @@ BOOST_AUTO_TEST_CASE(TimelineEntityPacketTestFullConstructionOfData)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> 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<unsigned char> buffer(10, 0);
@@ -688,11 +688,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestBufferExhaustionFixedValue)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -704,8 +704,8 @@ BOOST_AUTO_TEST_CASE(TimelineEventClassTestFullConstructionOfData)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> 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<unsigned char> buffer(10, 0);
@@ -773,11 +773,11 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestBufferExhaustionFixedValue)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<unsigned char> buffer(512, 0);
@@ -791,32 +791,32 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestFullConstructionOfData)
buffer.data(),
armnn::numeric_cast<unsigned int>(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<uint8_t> 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()
+}