aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/ProfilingTestUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/test/ProfilingTestUtils.cpp')
-rw-r--r--src/profiling/test/ProfilingTestUtils.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp
index 5c63b54b8f..c1386820e8 100644
--- a/src/profiling/test/ProfilingTestUtils.cpp
+++ b/src/profiling/test/ProfilingTestUtils.cpp
@@ -14,6 +14,26 @@
#include <boost/test/unit_test.hpp>
+uint32_t GetStreamMetaDataPacketSize()
+{
+ uint32_t sizeUint32 = sizeof(uint32_t);
+ uint32_t payloadSize = 0;
+ payloadSize += boost::numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1;
+ payloadSize += boost::numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1;
+ payloadSize += boost::numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1;
+ payloadSize += boost::numeric_cast<uint32_t>(GetProcessName().size()) + 1;
+
+ // Add packetVersionEntries
+ payloadSize += 6 * 2 * sizeUint32;
+ // Add packetVersionCountSize
+ payloadSize += sizeUint32;
+
+ uint32_t headerSize = 2 * sizeUint32;
+ uint32_t bodySize = 10 * sizeUint32;
+
+ return headerSize + bodySize + payloadSize;
+}
+
inline unsigned int OffsetToNextWord(unsigned int numberOfBytes)
{
unsigned int uint32_t_size = sizeof(uint32_t);