- uint32_t bodyHeader1Word0 = ReadUint32(readBuffer1, 8);
- uint32_t bodyHeader1Word1 = ReadUint32(readBuffer1, 12);
- uint32_t bodyHeader1Word2 = ReadUint32(readBuffer1, 16);
- uint32_t bodyHeader1Word3 = ReadUint32(readBuffer1, 20);
- uint32_t bodyHeader1Word4 = ReadUint32(readBuffer1, 24);
- uint32_t bodyHeader1Word5 = ReadUint32(readBuffer1, 28);
- uint16_t deviceRecordCount = numeric_cast<uint16_t>(bodyHeader1Word0 >> 16);
- uint16_t counterSetRecordCount = numeric_cast<uint16_t>(bodyHeader1Word2 >> 16);
- uint16_t categoryRecordCount = numeric_cast<uint16_t>(bodyHeader1Word4 >> 16);
- BOOST_TEST(deviceRecordCount == 1); // device_records_count
- BOOST_TEST(bodyHeader1Word1 == 0); // device_records_pointer_table_offset
- BOOST_TEST(counterSetRecordCount == 1); // counter_set_count
- BOOST_TEST(bodyHeader1Word3 == 4); // counter_set_pointer_table_offset
- BOOST_TEST(categoryRecordCount == 1); // categories_count
- BOOST_TEST(bodyHeader1Word5 == 8); // categories_pointer_table_offset
-
- uint32_t deviceRecordOffset = ReadUint32(readBuffer1, 32);
+ const uint32_t bodyHeaderSizeBytes = bodyHeaderSize * sizeof(uint32_t);
+
+ const uint32_t bodyHeader1Word0 = ReadUint32(readBuffer1, 8);
+ const uint32_t bodyHeader1Word1 = ReadUint32(readBuffer1, 12);
+ const uint32_t bodyHeader1Word2 = ReadUint32(readBuffer1, 16);
+ const uint32_t bodyHeader1Word3 = ReadUint32(readBuffer1, 20);
+ const uint32_t bodyHeader1Word4 = ReadUint32(readBuffer1, 24);
+ const uint32_t bodyHeader1Word5 = ReadUint32(readBuffer1, 28);
+ const uint16_t deviceRecordCount = numeric_cast<uint16_t>(bodyHeader1Word0 >> 16);
+ const uint16_t counterSetRecordCount = numeric_cast<uint16_t>(bodyHeader1Word2 >> 16);
+ const uint16_t categoryRecordCount = numeric_cast<uint16_t>(bodyHeader1Word4 >> 16);
+ BOOST_TEST(deviceRecordCount == 1); // device_records_count
+ BOOST_TEST(bodyHeader1Word1 == 0 + bodyHeaderSizeBytes); // device_records_pointer_table_offset
+ BOOST_TEST(counterSetRecordCount == 1); // counter_set_count
+ BOOST_TEST(bodyHeader1Word3 == 4 + bodyHeaderSizeBytes); // counter_set_pointer_table_offset
+ BOOST_TEST(categoryRecordCount == 1); // categories_count
+ BOOST_TEST(bodyHeader1Word5 == 8 + bodyHeaderSizeBytes); // categories_pointer_table_offset
+
+ const uint32_t deviceRecordOffset = ReadUint32(readBuffer1, 32);