From ab0447ef7ad44bf4b68cfa25330a1f0ed5de7c33 Mon Sep 17 00:00:00 2001 From: athatheo <vostidi@hotmail.com> Date: Fri, 12 Apr 2019 00:41:51 +0300 Subject: [PATCH] Fixed names in ErrorHandler and enumeration of errors and removed explicit declaration of true or false in a CHECK --- inc/ErrorHandler.hpp | 10 +++++----- src/Services/EventActionService.cpp | 2 +- test/Services/EventActionService.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/inc/ErrorHandler.hpp b/inc/ErrorHandler.hpp index 4d62938f..eac15f5c 100644 --- a/inc/ErrorHandler.hpp +++ b/inc/ErrorHandler.hpp @@ -111,11 +111,10 @@ public: enum ExecutionStartErrorType { UnknownExecutionStartError = 0, /** - * EventAction refers to the service, EventActionIDefinitionID refers to the variable * In the Event Action Service, in the addEventActionDefinition function an attempt was * made to add an event Action Definition with an eventActionDefinitionID that exists */ - EventActionEventActionDefinitionIDExistsError = 1, + EventActionDefinitionIDExistsError = 1, /** * In the Event Action Service, in the deleteEventActionDefinition function, an attempt * was made to delete an event action definition that was enabled @@ -126,13 +125,14 @@ public: * action definition */ EventActionUnknownEventDefinitionError = 3, - SubServiceExecutionStartError = 4, - InstructionExecutionStartError = 5, /** * EventAction refers to the service, EventActionIDefinitionID refers to the variable * In the Event Action Service, an access attempt was made to an unknown eventActionDefinitionID */ - EventActionUnknownEventActionDefinitionIDError = 6, + EventActionUnknownEventActionDefinitionIDError = 4, + SubServiceExecutionStartError = 5, + InstructionExecutionStartError = 6, + }; /** diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index 9aee53f1..7edb1c6b 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -15,7 +15,7 @@ void EventActionService::addEventActionDefinitions(Message& message) { for (auto& element = range.first; element != range.second; ++element) { if (element->second.eventActionDefinitionID == eventActionDefinitionID) { canBeAdded = false; - ErrorHandler::reportError(message, ErrorHandler::EventActionEventActionDefinitionIDExistsError); + ErrorHandler::reportError(message, ErrorHandler::EventActionDefinitionIDExistsError); } } } diff --git a/test/Services/EventActionService.cpp b/test/Services/EventActionService.cpp index 1ba23a7c..cacbe5d4 100644 --- a/test/Services/EventActionService.cpp +++ b/test/Services/EventActionService.cpp @@ -60,7 +60,7 @@ TEST_CASE("Add event-action definitions TC[19,1]", "[service][st19]") { data = "456"; message3.appendString(data); eventActionService.addEventActionDefinitions(message3); - CHECK(ServiceTests::thrownError(ErrorHandler::EventActionEventActionDefinitionIDExistsError)); + CHECK(ServiceTests::thrownError(ErrorHandler::EventActionDefinitionIDExistsError)); CHECK(ServiceTests::countErrors() == 2); } @@ -401,7 +401,7 @@ TEST_CASE("Enable event-action function TC[19,8]", "[service][st19]") { Message message(19, 8, Message::TC, 0); eventActionService.enableEventActionFunction(message); - CHECK(eventActionService.getEventActionFunctionStatus() == true); + CHECK(eventActionService.getEventActionFunctionStatus()); } TEST_CASE("Disable event-action function TC[19,9]", "[service][st19]") { @@ -410,7 +410,7 @@ TEST_CASE("Disable event-action function TC[19,9]", "[service][st19]") { Message message(19, 9, Message::TC, 0); eventActionService.disableEventActionFunction(message); - CHECK(eventActionService.getEventActionFunctionStatus() == false); + CHECK(eventActionService.getEventActionFunctionStatus()); } TEST_CASE("Execute a TC request", "[service][st19]"){ -- GitLab