Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECSS Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AcubeSat-OBC
ECSS Services
Commits
1582db45
Commit
1582db45
authored
6 years ago
by
athatheocsd
Browse files
Options
Downloads
Patches
Plain Diff
comments added and tests changed
parent
98c8e26a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Services/EventReportService.cpp
+4
-1
4 additions, 1 deletion
src/Services/EventReportService.cpp
test/Services/EventReportService.cpp
+3
-3
3 additions, 3 deletions
test/Services/EventReportService.cpp
with
7 additions
and
4 deletions
src/Services/EventReportService.cpp
+
4
−
1
View file @
1582db45
#include
<Services/EventReportService.hpp>
#include
<Services/EventReportService.hpp>
#include
"Services/EventReportService.hpp"
#include
"Services/EventReportService.hpp"
#include
"Message.hpp"
#include
"Message.hpp"
/**
*
* @todo: this code is error prone, depending on parameters given, add fail safes
*/
void
EventReportService
::
informativeEventReport
(
Event
eventID
,
const
uint8_t
*
data
,
void
EventReportService
::
informativeEventReport
(
Event
eventID
,
const
uint8_t
*
data
,
uint8_t
length
)
{
uint8_t
length
)
{
// TM[5,1]
// TM[5,1]
...
...
This diff is collapsed.
Click to expand it.
test/Services/EventReportService.cpp
+
3
−
3
View file @
1582db45
...
@@ -42,7 +42,7 @@ TEST_CASE("Low Severity Anomaly Report TM[5,2]", "[service][st05]") {
...
@@ -42,7 +42,7 @@ TEST_CASE("Low Severity Anomaly Report TM[5,2]", "[service][st05]") {
CHECK
(
report
.
packetType
==
Message
::
TM
);
// packet type(TM = 0, TC = 1)
CHECK
(
report
.
packetType
==
Message
::
TM
);
// packet type(TM = 0, TC = 1)
REQUIRE
(
report
.
dataSize
==
12
);
REQUIRE
(
report
.
dataSize
==
12
);
// Check for the value that is stored in <<data>> array(data-member of object response)
// Check for the value that is stored in <<data>> array(data-member of object response)
CHECK
(
report
.
readEnum16
()
==
1
);
CHECK
(
report
.
readEnum16
()
==
4
);
report
.
readString
(
checkString
,
10
);
report
.
readString
(
checkString
,
10
);
CHECK
(
strcmp
(
checkString
,
reinterpret_cast
<
const
char
*>
(
eventReportData
))
==
0
);
CHECK
(
strcmp
(
checkString
,
reinterpret_cast
<
const
char
*>
(
eventReportData
))
==
0
);
}
}
...
@@ -62,7 +62,7 @@ TEST_CASE("Medium Severity Anomaly Report TM[5,3]", "[service][st05]") {
...
@@ -62,7 +62,7 @@ TEST_CASE("Medium Severity Anomaly Report TM[5,3]", "[service][st05]") {
CHECK
(
report
.
packetType
==
Message
::
TM
);
// packet type(TM = 0, TC = 1)
CHECK
(
report
.
packetType
==
Message
::
TM
);
// packet type(TM = 0, TC = 1)
REQUIRE
(
report
.
dataSize
==
12
);
REQUIRE
(
report
.
dataSize
==
12
);
// Check for the value that is stored in <<data>> array(data-member of object response)
// Check for the value that is stored in <<data>> array(data-member of object response)
CHECK
(
report
.
readEnum16
()
==
2
);
CHECK
(
report
.
readEnum16
()
==
5
);
report
.
readString
(
checkString
,
10
);
report
.
readString
(
checkString
,
10
);
CHECK
(
strcmp
(
checkString
,
reinterpret_cast
<
const
char
*>
(
eventReportData
))
==
0
);
CHECK
(
strcmp
(
checkString
,
reinterpret_cast
<
const
char
*>
(
eventReportData
))
==
0
);
}
}
...
@@ -82,7 +82,7 @@ TEST_CASE("High Severity Anomaly Report TM[5,4]", "[service][st05]") {
...
@@ -82,7 +82,7 @@ TEST_CASE("High Severity Anomaly Report TM[5,4]", "[service][st05]") {
CHECK
(
report
.
packetType
==
Message
::
TM
);
// packet type(TM = 0, TC = 1)
CHECK
(
report
.
packetType
==
Message
::
TM
);
// packet type(TM = 0, TC = 1)
REQUIRE
(
report
.
dataSize
==
12
);
REQUIRE
(
report
.
dataSize
==
12
);
// Check for the value that is stored in <<data>> array(data-member of object response)
// Check for the value that is stored in <<data>> array(data-member of object response)
CHECK
(
report
.
readEnum16
()
==
3
);
CHECK
(
report
.
readEnum16
()
==
6
);
report
.
readString
(
checkString
,
10
);
report
.
readString
(
checkString
,
10
);
CHECK
(
strcmp
(
checkString
,
reinterpret_cast
<
const
char
*>
(
eventReportData
))
==
0
);
CHECK
(
strcmp
(
checkString
,
reinterpret_cast
<
const
char
*>
(
eventReportData
))
==
0
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment