From fe5a24beeef6e9a41366e694f41093565e748048 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Thu, 9 Apr 2020 16:05:28 +0100 Subject: IVGCVSW-4666 Call EnableProfiling when state switches to active * Move the call to EnableProfiling() into ConnectionAcknowledgedHandler * Fix an issue with MockGatord forcing some command handlers to be quiet * Add some small unrelated improvements and typo fixes to the periodic counter command handlers Signed-off-by: Finn Williams Change-Id: I9e6066b78d1f782cfaf27c11571c0ec5cb5d126f --- tests/profiling/gatordmock/GatordMockService.hpp | 8 ++++---- tests/profiling/gatordmock/tests/GatordMockTests.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'tests/profiling/gatordmock') diff --git a/tests/profiling/gatordmock/GatordMockService.hpp b/tests/profiling/gatordmock/GatordMockService.hpp index 2ff93c9de6..9b72f72feb 100644 --- a/tests/profiling/gatordmock/GatordMockService.hpp +++ b/tests/profiling/gatordmock/GatordMockService.hpp @@ -57,16 +57,16 @@ public: , m_HandlerRegistry() , m_TimelineDecoder() , m_StreamMetadataCommandHandler( - 0, 0, m_PacketVersionResolver.ResolvePacketVersion(0, 0).GetEncodedValue(), true) + 0, 0, m_PacketVersionResolver.ResolvePacketVersion(0, 0).GetEncodedValue(), !echoPackets) , m_CounterCaptureCommandHandler( - 0, 4, m_PacketVersionResolver.ResolvePacketVersion(0, 4).GetEncodedValue(), true) + 0, 4, m_PacketVersionResolver.ResolvePacketVersion(0, 4).GetEncodedValue(), !echoPackets) , m_DirectoryCaptureCommandHandler( - 0, 2, m_PacketVersionResolver.ResolvePacketVersion(0, 2).GetEncodedValue(), true) + 0, 2, m_PacketVersionResolver.ResolvePacketVersion(0, 2).GetEncodedValue(), !echoPackets) , m_TimelineCaptureCommandHandler( 1, 1, m_PacketVersionResolver.ResolvePacketVersion(1, 1).GetEncodedValue(), m_TimelineDecoder) , m_TimelineDirectoryCaptureCommandHandler( 1, 0, m_PacketVersionResolver.ResolvePacketVersion(1, 0).GetEncodedValue(), - m_TimelineCaptureCommandHandler, true) + m_TimelineCaptureCommandHandler, !echoPackets) { m_TimelineDecoder.SetDefaultCallbacks(); diff --git a/tests/profiling/gatordmock/tests/GatordMockTests.cpp b/tests/profiling/gatordmock/tests/GatordMockTests.cpp index f8b42df674..11a96fdd7d 100644 --- a/tests/profiling/gatordmock/tests/GatordMockTests.cpp +++ b/tests/profiling/gatordmock/tests/GatordMockTests.cpp @@ -443,8 +443,11 @@ BOOST_AUTO_TEST_CASE(GatorDMockTimeLineActivation) WaitFor([&](){return timelineDecoder.GetModel().m_EventClasses.size() >= 2;}, "MockGatord did not receive well known timeline labels"); + WaitFor([&](){return timelineDecoder.GetModel().m_Entities.size() >= 1;}, + "MockGatord did not receive mock backend test entity"); + // Packets we expect from SendWellKnownLabelsAndEventClassesTest - BOOST_CHECK(timelineDecoder.GetModel().m_Entities.size() == 0); + BOOST_CHECK(timelineDecoder.GetModel().m_Entities.size() == 1); BOOST_CHECK(timelineDecoder.GetModel().m_EventClasses.size() == 2); BOOST_CHECK(timelineDecoder.GetModel().m_Labels.size() == 10); BOOST_CHECK(timelineDecoder.GetModel().m_Relationships.size() == 0); @@ -471,7 +474,7 @@ BOOST_AUTO_TEST_CASE(GatorDMockTimeLineActivation) "MockGatord did not receive well known timeline labels"); // Packets we expect from SendWellKnownLabelsAndEventClassesTest * 2 and the loaded model - BOOST_CHECK(timelineDecoder.GetModel().m_Entities.size() == 5); + BOOST_CHECK(timelineDecoder.GetModel().m_Entities.size() == 6); BOOST_CHECK(timelineDecoder.GetModel().m_EventClasses.size() == 4); BOOST_CHECK(timelineDecoder.GetModel().m_Labels.size() == 24); BOOST_CHECK(timelineDecoder.GetModel().m_Relationships.size() == 28); -- cgit v1.2.1