aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/TimelinePacketTests.cpp
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2020-05-12 16:36:46 +0100
committerJim Flynn <jim.flynn@arm.com>2020-05-13 06:57:07 +0000
commit5bb3d8a1edeab3f4fdbeb9baf7922cc52bd815fb (patch)
treedde9b2ebeeccb81e089d1f4281dfbc3092bd626b /src/profiling/test/TimelinePacketTests.cpp
parent0c8cb99db6dd8b1ea073ef7227b2872a3cb0b269 (diff)
downloadarmnn-5bb3d8a1edeab3f4fdbeb9baf7922cc52bd815fb.tar.gz
IVGCVSW-4775 Centralizing definition of ThreadIdSize to fix MLCE-189
* Introduce a constant definition of the size of a POSIX thread ID. * Update all code to use the new constant definition. * Update all unit tests to use the new constant definition. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I836ab1a77ed13f774e66fd7b425923c24b9a6dab
Diffstat (limited to 'src/profiling/test/TimelinePacketTests.cpp')
-rw-r--r--src/profiling/test/TimelinePacketTests.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/profiling/test/TimelinePacketTests.cpp b/src/profiling/test/TimelinePacketTests.cpp
index 5401712205..e57ed2a652 100644
--- a/src/profiling/test/TimelinePacketTests.cpp
+++ b/src/profiling/test/TimelinePacketTests.cpp
@@ -429,7 +429,6 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction)
unsigned int uint8_t_size = sizeof(uint8_t);
unsigned int uint32_t_size = sizeof(uint32_t);
unsigned int uint64_t_size = sizeof(uint64_t);
- unsigned int threadId_size = sizeof(std::thread::id);
// Check the packet header
unsigned int offset = 0;
@@ -459,7 +458,7 @@ BOOST_AUTO_TEST_CASE(TimelineMessageDirectoryPacketTestFullConstruction)
BOOST_CHECK(readPointerBytes == uint64_t_size);
offset += uint8_t_size;
uint8_t readThreadIdBytes = ReadUint8(buffer.data(), offset);
- BOOST_CHECK(readThreadIdBytes == threadId_size);
+ BOOST_CHECK(readThreadIdBytes == ThreadIdSize);
// Check the number of declarations
offset += uint8_t_size;
@@ -742,9 +741,7 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestFullConstructionOfData)
unsigned int uint32_t_size = sizeof(uint32_t);
unsigned int uint64_t_size = sizeof(uint64_t);
- unsigned int threadId_size = sizeof(std::thread::id); // Is platform dependent
-
- BOOST_CHECK(numberOfBytesWritten == 20 + threadId_size);
+ BOOST_CHECK(numberOfBytesWritten == 20 + ThreadIdSize);
unsigned int offset = 0;
// Check the decl_id
@@ -758,12 +755,12 @@ BOOST_AUTO_TEST_CASE(TimelineEventPacketTestFullConstructionOfData)
// Check the thread id
offset += uint64_t_size;
- std::vector<uint8_t> readThreadId(threadId_size, 0);
- ReadBytes(buffer.data(), offset, threadId_size, readThreadId.data());
+ std::vector<uint8_t> readThreadId(ThreadIdSize, 0);
+ ReadBytes(buffer.data(), offset, ThreadIdSize, readThreadId.data());
BOOST_CHECK(readThreadId == threadId);
// Check the profiling GUID
- offset += threadId_size;
+ offset += ThreadIdSize;
uint64_t readProfilingGuid = ReadUint64(buffer.data(), offset);
BOOST_CHECK(readProfilingGuid == profilingGuid);
}