From 8c9efdcd568917a7a1dea77ae49cd6c92468ecc2 Mon Sep 17 00:00:00 2001
From: kpetridis <petridkon@gmail.com>
Date: Sun, 8 May 2022 15:17:31 +0300
Subject: [PATCH] Removed redundant check

---
 src/Services/RealTimeForwardingControlService.cpp | 2 +-
 test/Services/RealTimeForwardingControl.cpp       | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Services/RealTimeForwardingControlService.cpp b/src/Services/RealTimeForwardingControlService.cpp
index 72303f2b..75c20e69 100644
--- a/src/Services/RealTimeForwardingControlService.cpp
+++ b/src/Services/RealTimeForwardingControlService.cpp
@@ -71,7 +71,7 @@ bool RealTimeForwardingControlService::maxServiceTypesReached(Message& request,
 
 bool RealTimeForwardingControlService::checkService(Message& request, uint8_t applicationID, uint8_t serviceType,
                                                     uint8_t numOfMessages) {
-	if (maxServiceTypesReached(request, applicationID) or allReportTypesAllowed(request, applicationID, serviceType)) {
+	if (maxServiceTypesReached(request, applicationID)) {
 		request.skipBytes(numOfMessages);
 		return false;
 	}
diff --git a/test/Services/RealTimeForwardingControl.cpp b/test/Services/RealTimeForwardingControl.cpp
index cfcab115..4ea1f1a9 100644
--- a/test/Services/RealTimeForwardingControl.cpp
+++ b/test/Services/RealTimeForwardingControl.cpp
@@ -314,9 +314,9 @@ TEST_CASE("Add report types to the Application Process Configuration") {
 
 		MessageParser::execute(request);
 
-		CHECK(ServiceTests::count() == 1);
-		CHECK(ServiceTests::countThrownErrors(ErrorHandler::ExecutionStartErrorType::AllReportTypesAlreadyAllowed) ==
-		      1);
+		CHECK(ServiceTests::count() == 2);
+		CHECK(ServiceTests::countThrownErrors(ErrorHandler::ExecutionStartErrorType::MaxReportTypesReached) ==
+		      2);
 		REQUIRE(
 		    realTimeForwarding.applicationProcessConfiguration.definitions[std::make_pair(applicationID, serviceType)]
 		        .size() == AllMessageTypes::messagesOfService[serviceType].size());
-- 
GitLab