aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/SendCounterPacketTests.cpp
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2020-09-11 10:14:57 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2020-09-29 08:01:57 +0000
commit371b70e39390618cbd791b441adcf3923964b8df (patch)
treeb869b0b3e5064e9c5abab8a02b111a497a6326d2 /src/profiling/test/SendCounterPacketTests.cpp
parent1f0e2f9dbf14a719aef09649b19a656a6b03c7ce (diff)
downloadarmnn-371b70e39390618cbd791b441adcf3923964b8df.tar.gz
IVGCVSW-5301 Remove all boost::numeric_cast from armnn/src/profiling
* Replaced with armnn/utility/NumericCast.hpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I14e89c00cd1dd607315113d5b8ca56c2e9f6c363
Diffstat (limited to 'src/profiling/test/SendCounterPacketTests.cpp')
-rw-r--r--src/profiling/test/SendCounterPacketTests.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp
index 87cfb5bf58..950f8ffad0 100644
--- a/src/profiling/test/SendCounterPacketTests.cpp
+++ b/src/profiling/test/SendCounterPacketTests.cpp
@@ -20,9 +20,7 @@
#include <common/include/Constants.hpp>
-
#include <boost/test/unit_test.hpp>
-#include <boost/numeric/conversion/cast.hpp>
#include <chrono>
@@ -289,9 +287,7 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest)
BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest)
{
- using boost::numeric_cast;
-
- uint32_t sizeUint32 = numeric_cast<uint32_t>(sizeof(uint32_t));
+ uint32_t sizeUint32 = armnn::numeric_cast<uint32_t>(sizeof(uint32_t));
// Error no space left in buffer
MockBufferManager mockBuffer1(10);
@@ -302,10 +298,10 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest)
std::string processName = GetProcessName().substr(0, 60);
- uint32_t infoSize = numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1;
- uint32_t hardwareVersionSize = numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1;
- uint32_t softwareVersionSize = numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1;
- uint32_t processNameSize = numeric_cast<uint32_t>(processName.size()) + 1;
+ uint32_t infoSize = armnn::numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1;
+ uint32_t hardwareVersionSize = armnn::numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1;
+ uint32_t softwareVersionSize = armnn::numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1;
+ uint32_t processNameSize = armnn::numeric_cast<uint32_t>(processName.size()) + 1;
// Supported Packets
// Packet Encoding version 1.0.0
@@ -352,9 +348,11 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest)
BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family
BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 0); // packet id
- uint32_t totalLength = numeric_cast<uint32_t>(2 * sizeUint32 + 10 * sizeUint32 + infoSize + hardwareVersionSize +
- softwareVersionSize + processNameSize + sizeUint32 +
- 2 * packetEntries * sizeUint32);
+ uint32_t totalLength = armnn::numeric_cast<uint32_t>(2 * sizeUint32 +
+ 10 * sizeUint32 + infoSize +
+ hardwareVersionSize + softwareVersionSize +
+ processNameSize + sizeUint32 +
+ 2 * packetEntries * sizeUint32);
BOOST_TEST(headerWord1 == totalLength - (2 * sizeUint32)); // data length
@@ -366,7 +364,7 @@ BOOST_AUTO_TEST_CASE(SendStreamMetaDataPacketTest)
BOOST_TEST(ReadUint32(readBuffer2, offset) == MAX_METADATA_PACKET_LENGTH); // max_data_len
offset += sizeUint32;
int pid = armnnUtils::Processes::GetCurrentId();
- BOOST_TEST(ReadUint32(readBuffer2, offset) == numeric_cast<uint32_t>(pid));
+ BOOST_TEST(ReadUint32(readBuffer2, offset) == armnn::numeric_cast<uint32_t>(pid));
offset += sizeUint32;
uint32_t poolOffset = 10 * sizeUint32;
BOOST_TEST(ReadUint32(readBuffer2, offset) == poolOffset); // offset_info
@@ -942,7 +940,7 @@ BOOST_AUTO_TEST_CASE(CreateCategoryRecordTest)
ARMNN_ASSERT(counter1);
ARMNN_ASSERT(counter2);
ARMNN_ASSERT(counter3);
- uint16_t categoryEventCount = boost::numeric_cast<uint16_t>(counters.size());
+ uint16_t categoryEventCount = armnn::numeric_cast<uint16_t>(counters.size());
// Create a category record
SendCounterPacket::CategoryRecord categoryRecord;