From 08c6a8ea9a9a1982518780f18c0c37c9439b473f Mon Sep 17 00:00:00 2001
From: athatheocsd <athatheo@csd.auth.gr>
Date: Mon, 3 Dec 2018 05:06:12 +0200
Subject: [PATCH] Added getter function and created the basics for some tests.

---
 inc/Services/EventReportService.hpp  |  2 ++
 src/Services/EventReportService.cpp  |  4 ++++
 src/main.cpp                         | 12 ++++++------
 test/Services/EventReportService.cpp | 20 ++++++++++++++++++++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/inc/Services/EventReportService.hpp b/inc/Services/EventReportService.hpp
index 8a2f2bd2..204015d2 100644
--- a/inc/Services/EventReportService.hpp
+++ b/inc/Services/EventReportService.hpp
@@ -134,6 +134,8 @@ public:
 	 */
 	void listOfDisabledEventsReport();
 
+	std::bitset<numberOfEvents> getStateOfEvents();
+
 };
 
 #endif //ECSS_SERVICES_EVENTREPORTSERVICE_HPP
diff --git a/src/Services/EventReportService.cpp b/src/Services/EventReportService.cpp
index 40772172..f25f70f9 100644
--- a/src/Services/EventReportService.cpp
+++ b/src/Services/EventReportService.cpp
@@ -83,3 +83,7 @@ void EventReportService::listOfDisabledEventsReport() {
 
 	storeMessage(report);
 }
+
+std::bitset<7> EventReportService::getStateOfEvents() {
+	return stateOfEvents;
+}
diff --git a/src/main.cpp b/src/main.cpp
index da89ca73..4961b299 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -137,14 +137,14 @@ int main() {
 	EventReportService::Event eventIDs[] =
 		{EventReportService::HighSeverityUnknownEvent,
 		 EventReportService::HighSeverityUnknownEvent};
-	std::cout << eventReportService.stateOfEvents[0];
+	std::cout << eventReportService.getStateOfEvents()[0];
 
 	eventReportService.enableReportGeneration(2, eventIDs);
-	std::cout << eventReportService.stateOfEvents[0];
-	std::cout << eventReportService.stateOfEvents[1];
-	std::cout << eventReportService.stateOfEvents[3];
-	std::cout << eventReportService.stateOfEvents[4];
-	std::cout << eventReportService.stateOfEvents[6];
+	std::cout << eventReportService.getStateOfEvents()[0];
+	std::cout << eventReportService.getStateOfEvents()[1];
+	std::cout << eventReportService.getStateOfEvents()[3];
+	std::cout << eventReportService.getStateOfEvents()[4];
+	std::cout << eventReportService.getStateOfEvents()[6];
 
 	return 0;
 }
diff --git a/test/Services/EventReportService.cpp b/test/Services/EventReportService.cpp
index ad14befc..ccf95a2d 100644
--- a/test/Services/EventReportService.cpp
+++ b/test/Services/EventReportService.cpp
@@ -86,3 +86,23 @@ TEST_CASE("High Severity Anomaly Report TM[5,4]", "[service][st05]") {
 	report.readString(checkString, 10);
 	CHECK(strcmp(checkString, reinterpret_cast<const char *>(eventReportData)) == 0);
 }
+
+TEST_CASE("Enable Report Generation TC[5,5]", "[service][st05]"){
+
+}
+
+TEST_CASE("Disable Report Generation TC[5,6]", "[service][st05]"){
+
+}
+
+TEST_CASE("Request list of disabled events TC[5,7]", "[service][st05]"){
+
+}
+
+TEST_CASE("List of Disabled Events Report TM[5,8]", "[service][st05]"){
+
+}
+
+TEST_CASE("Getter for stateOfEvents variable"){
+
+}
\ No newline at end of file
-- 
GitLab