From a10e2a26b20b124aaa03f20554172d88683257f7 Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 26 Mar 2020 12:04:54 +0000 Subject: IVGCVSW-4526 Fix UnitTest errors when running on raspberry pi * The std::thread::id is included in some timeline packages of the profiler. But the size of thread::id is platform dependent. That's why some tests expected a wrong package size Signed-off-by: Jan Eilers Change-Id: I4794ebbdda2d75ed5be7112f6a3bf2e5f14f221b --- src/profiling/test/TimelineUtilityMethodsTests.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/profiling/test/TimelineUtilityMethodsTests.cpp') diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp index 43a5b0a4f5..caffcc74b0 100644 --- a/src/profiling/test/TimelineUtilityMethodsTests.cpp +++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp @@ -429,7 +429,9 @@ BOOST_AUTO_TEST_CASE(RecordEventTest) auto readableBuffer = mockBufferManager.GetReadableBuffer(); BOOST_CHECK(readableBuffer != nullptr); unsigned int size = readableBuffer->GetSize(); - BOOST_CHECK(size == 100); + unsigned int threadId_size = sizeof(std::thread::id); // Is platform dependent + BOOST_CHECK(size == 92 + threadId_size); + const unsigned char* readableData = readableBuffer->GetReadableData(); BOOST_CHECK(readableData != nullptr); @@ -437,7 +439,7 @@ BOOST_AUTO_TEST_CASE(RecordEventTest) unsigned int offset = 0; // Verify Header - VerifyTimelineHeaderBinary(readableData, offset, 92); + VerifyTimelineHeaderBinary(readableData, offset, 84 + threadId_size); // First dataset sent: TimelineEntityBinaryPacket VerifyTimelineEventBinaryPacket(EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); -- cgit v1.2.1