From 234d525ac7dbfb3dc387a5555ce7ac0023f97ebe Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Tue, 19 Nov 2019 15:49:18 +0000 Subject: IVGCVSW-4070 Add CreatedNamedTypeEntity and CreateNamedTypedChildEntity functions with Guid Signed-off-by: Narumol Prangnawarat Change-Id: Ide3c3b0a05830af055b3a2c733af4c1c57c0dbaa --- src/profiling/test/TimelineUtilityMethodsTests.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/profiling/test') diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp index 2eb96e62d1..7d1a7c1a87 100644 --- a/src/profiling/test/TimelineUtilityMethodsTests.cpp +++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp @@ -474,6 +474,7 @@ BOOST_AUTO_TEST_CASE(CreateNamedTypedChildEntityTest) SendTimelinePacket sendTimelinePacket(mockBufferManager); TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); + ProfilingDynamicGuid childEntityGuid(0); ProfilingGuid parentEntityGuid(123); const std::string entityName = "some entity"; const std::string entityType = "some type"; @@ -485,8 +486,11 @@ BOOST_AUTO_TEST_CASE(CreateNamedTypedChildEntityTest) InvalidArgumentException); BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName, ""), InvalidArgumentException); + BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity( + childEntityGuid, parentEntityGuid, "", entityType), InvalidArgumentException); + BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity( + childEntityGuid, parentEntityGuid, entityName, ""), InvalidArgumentException); - ProfilingGuid childEntityGuid(0); BOOST_CHECK_NO_THROW(childEntityGuid = timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName, entityType)); @@ -599,6 +603,16 @@ BOOST_AUTO_TEST_CASE(CreateNameTypeEntityInvalidTest) // Invalid type BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity("Name", ""), InvalidArgumentException); + ProfilingDynamicGuid guid = ProfilingService::Instance().NextGuid(); + + // CreatedNamedTypedEntity with Guid - Invalid name + BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid, "", "Type"), + InvalidArgumentException); + + // CreatedNamedTypedEntity with Guid - Invalid type + BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid, "Name", ""), + InvalidArgumentException); + } BOOST_AUTO_TEST_CASE(CreateNameTypeEntityTest) -- cgit v1.2.1