Skip to content
Snippets Groups Projects
Commit ab0447ef authored by athatheo's avatar athatheo
Browse files

Fixed names in ErrorHandler and enumeration of errors and removed explicit...

Fixed names in ErrorHandler and enumeration of errors and removed explicit declaration of true or false in a CHECK
parent d3970f2c
No related branches found
No related tags found
No related merge requests found
......@@ -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,
};
/**
......
......@@ -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);
}
}
}
......
......@@ -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]"){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment