From dbdd1b438815606bd423cbcfb95d51a3dd206683 Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Fri, 15 Nov 2019 17:38:44 +0000 Subject: IVGCVSW-3980 Implementation of Guid generator * Improve implementation of Guid Generator to separate the range of Static Guid and Dynamic Guid * Unit tests to ensure non-collision Signed-off-by: Narumol Prangnawarat Change-Id: I4ad1a75ea0b1f37155da0decafb51fc5a61e4187 --- src/profiling/test/SendTimelinePacketTests.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/profiling/test/SendTimelinePacketTests.cpp') diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp index 26b49dfb18..771e117955 100644 --- a/src/profiling/test/SendTimelinePacketTests.cpp +++ b/src/profiling/test/SendTimelinePacketTests.cpp @@ -415,10 +415,9 @@ BOOST_AUTO_TEST_CASE(GetGuidsFromProfilingService) ProfilingService& profilingService = ProfilingService::Instance(); profilingService.ResetExternalProfilingOptions(options, true); ProfilingStaticGuid staticGuid = profilingService.GenerateStaticId("dummy"); - // TODO this will change again... std::hash hasher; uint64_t hash = static_cast(hasher("dummy")); - ProfilingStaticGuid expectedStaticValue(hash); + ProfilingStaticGuid expectedStaticValue(hash | MIN_STATIC_GUID); BOOST_CHECK(staticGuid == expectedStaticValue); ProfilingDynamicGuid dynamicGuid = profilingService.NextGuid(); uint64_t dynamicGuidValue = static_cast(dynamicGuid); @@ -448,23 +447,23 @@ BOOST_AUTO_TEST_CASE(CheckStaticGuidsAndEvents) std::hash hasher; uint64_t hash = static_cast(hasher(LabelsAndEventClasses::NAME_LABEL)); - ProfilingStaticGuid expectedNameGuid(hash); + ProfilingStaticGuid expectedNameGuid(hash | MIN_STATIC_GUID); BOOST_CHECK(LabelsAndEventClasses::NAME_GUID == expectedNameGuid); hash = static_cast(hasher(LabelsAndEventClasses::TYPE_LABEL)); - ProfilingStaticGuid expectedTypeGuid(hash); + ProfilingStaticGuid expectedTypeGuid(hash | MIN_STATIC_GUID); BOOST_CHECK(LabelsAndEventClasses::TYPE_GUID == expectedTypeGuid); hash = static_cast(hasher(LabelsAndEventClasses::INDEX_LABEL)); - ProfilingStaticGuid expectedIndexGuid(hash); + ProfilingStaticGuid expectedIndexGuid(hash | MIN_STATIC_GUID); BOOST_CHECK(LabelsAndEventClasses::INDEX_GUID == expectedIndexGuid); hash = static_cast(hasher("ARMNN_PROFILING_SOL")); - ProfilingStaticGuid expectedSol(hash); + ProfilingStaticGuid expectedSol(hash | MIN_STATIC_GUID); BOOST_CHECK(LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS == expectedSol); hash = static_cast(hasher("ARMNN_PROFILING_EOL")); - ProfilingStaticGuid expectedEol(hash); + ProfilingStaticGuid expectedEol(hash | MIN_STATIC_GUID); BOOST_CHECK(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS == expectedEol); } -- cgit v1.2.1