From eefe55370928e82339362f6d1f7bc6b90eacbda6 Mon Sep 17 00:00:00 2001 From: athatheocsd <athatheo@csd.auth.gr> Date: Thu, 3 Jan 2019 00:14:15 +0200 Subject: [PATCH] TC[19,5] completed --- inc/Services/EventActionService.hpp | 2 +- src/Services/EventActionService.cpp | 4 ++-- test/Services/EventActionService.cpp | 21 ++++++++++++++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/inc/Services/EventActionService.hpp b/inc/Services/EventActionService.hpp index 19886d5c..9a542fa7 100644 --- a/inc/Services/EventActionService.hpp +++ b/inc/Services/EventActionService.hpp @@ -40,7 +40,7 @@ public: EventActionService() { serviceType = 19; eventActionFunctionStatus = enabledFunction; - stateOfEventAction.reset(); + stateOfEventAction.set(); } /** diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index a8feab20..3fb2659d 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -85,7 +85,7 @@ void EventActionService::enableEventActionDefinitions(Message message) { uint16_t eventDefinitionID = message.readEnum16(); while (index<255){ if (eventActionDefinitionArray[index].applicationId == applicationID && - eventActionDefinitionArray[index].eventDefinitionID== eventDefinitionID) { + eventActionDefinitionArray[index].eventDefinitionID == eventDefinitionID) { stateOfEventAction[index] = 1; } index++; @@ -106,7 +106,7 @@ void EventActionService::disableEventActionDefinitions(Message message) { uint16_t eventDefinitionID = message.readEnum16(); while (index<255){ if (eventActionDefinitionArray[index].applicationId == applicationID && - eventActionDefinitionArray[index].eventDefinitionID== eventDefinitionID) { + eventActionDefinitionArray[index].eventDefinitionID == eventDefinitionID) { stateOfEventAction[index] = 0; } index++; diff --git a/test/Services/EventActionService.cpp b/test/Services/EventActionService.cpp index f088322a..0264a3fd 100644 --- a/test/Services/EventActionService.cpp +++ b/test/Services/EventActionService.cpp @@ -170,7 +170,26 @@ TEST_CASE("Enable event-action definitions TC[19,4]", "[service][st09]") { } TEST_CASE("Disable event-action definitions TC[19,5]", "[service][st09]") { - + EventActionService eventActionService; + Message message0(19, 1, Message::TC, 0); + message0.appendEnum16(1); + message0.appendEnum16(0); + String<64> data = "0"; + message0.appendString(data); + eventActionService.addEventActionDefinitions(message0); + Message message1(19, 1, Message::TC, 0); + message1.appendEnum16(1); + message1.appendEnum16(0); + data = "00"; + message1.appendString(data); + eventActionService.addEventActionDefinitions(message1); + Message message2(19, 5, Message::TC, 0); + message2.appendUint16(1); + message2.appendEnum16(1); + message2.appendEnum16(0); + eventActionService.disableEventActionDefinitions(message2); + CHECK(eventActionService.stateOfEventAction[0] == 0); + CHECK(eventActionService.stateOfEventAction[1] == 0); } TEST_CASE("Request event-action definition status TC[19,6]", "[service][st09]") { -- GitLab