From 94c97881d5971576eddca3416228b84156033395 Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Tue, 12 May 2020 17:17:59 +0100 Subject: IVGCVSW-4776 Warn when MIN_STATIC_GUID is returned from GenerateStaticId multiple times. * Modify StaticGuidGeneratorCollisionTest to identify cases where MIN_STATIC_GUID has been returned from GenerateStaticId more than once. Output a warning rather than an error as this can happen on 32bit systems. Signed-off-by: Colm Donelan Change-Id: I47e9a1d9ff09c25da24abb4b0efe63d3000aa1c5 --- src/profiling/test/ProfilingGuidTest.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/profiling/test/ProfilingGuidTest.cpp b/src/profiling/test/ProfilingGuidTest.cpp index b8f6b88479..392833a364 100644 --- a/src/profiling/test/ProfilingGuidTest.cpp +++ b/src/profiling/test/ProfilingGuidTest.cpp @@ -90,7 +90,17 @@ BOOST_AUTO_TEST_CASE(StaticGuidGeneratorCollisionTest) ProfilingStaticGuid guid = generator.GenerateStaticId(str.c_str()); if (guids.find(guid) != guids.end()) { - BOOST_ERROR(boost::str(boost::format("GUID collision occurred: %1% -> %2%") % str % guid)); + // If we're running on a 32bit system it is more likely to get a GUID clash over 1 million executions. + // We can generally detect this when the GUID turns out to be MIN_STATIC_GUID. Output a warning + // message rather than error in this case. + if (guid == ProfilingGuid(armnn::profiling::MIN_STATIC_GUID)) + { + BOOST_WARN("MIN_STATIC_GUID returned more than once from GenerateStaticId."); + } + else + { + BOOST_ERROR(boost::str(boost::format("GUID collision occurred: %1% -> %2%") % str % guid)); + } break; } guids.insert(guid); -- cgit v1.2.1