From f74ff2ff7f67ff0141c058a242758de97e10dd99 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Tue, 24 Sep 2019 11:38:32 +0100 Subject: IVGCVSW-3691 Fix the Counter Directory Packet data length * The data_length field in the header represents only the size of the data included in the packet after the header, so the header size is not included * Removed a number of conversion macros in SendCounterPacket by using numeric casts where possible * Updated the unit tests accordingly Signed-off-by: Matteo Martincigh Change-Id: Ifb23c341c442ff3d33b234d4213b739a77ceb658 --- src/profiling/test/ProfilingTests.cpp | 4 ++-- src/profiling/test/SendCounterPacketTests.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/profiling/test') diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index 2a20aac8a4..32a41f37c2 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -2022,7 +2022,7 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest0) BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 2); // packet id - BOOST_TEST(headerWord1 == 32); // data lenght; + BOOST_TEST(headerWord1 == 24); // data length uint32_t bodyHeaderWord0 = ReadUint32(readBuffer, 8); uint16_t deviceRecordCount = numeric_cast(bodyHeaderWord0 >> 16); @@ -2061,7 +2061,7 @@ BOOST_AUTO_TEST_CASE(RequestCounterDirectoryCommandHandlerTest1) BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 0); // packet family BOOST_TEST(((headerWord0 >> 16) & 0x3FF) == 2); // packet id - BOOST_TEST(headerWord1 == 248); // data lenght; + BOOST_TEST(headerWord1 == 240); // data length uint32_t bodyHeaderWord0 = ReadUint32(readBuffer, 8); uint32_t bodyHeaderWord1 = ReadUint32(readBuffer, 12); diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp index f32c3684c1..90bc9225a0 100644 --- a/src/profiling/test/SendCounterPacketTests.cpp +++ b/src/profiling/test/SendCounterPacketTests.cpp @@ -1143,7 +1143,7 @@ BOOST_AUTO_TEST_CASE(SendCounterDirectoryPacketTest2) 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 == 944); // data_length + BOOST_TEST(packetHeaderWord1 == 936); // data_length // Check the body header uint32_t bodyHeaderWord0 = ReadUint32(readBuffer, 8); -- cgit v1.2.1