Skip to content
Snippets Groups Projects
Commit d265ae72 authored by thodkatz's avatar thodkatz
Browse files

Fix the current tests based on the previous changes

parent 6280930f
No related branches found
No related tags found
No related merge requests found
......@@ -19,14 +19,14 @@ TEST_CASE("Error: Failed Acceptance", "[errors]") {
CHECK(report.readBits(1) == static_cast<uint16_t>(Message::TC));
CHECK(report.readBits(1) == false);
CHECK(report.readBits(11) == 47);
CHECK(report.readBits(2) == 0);
CHECK(report.readBits(2) == ECSS_SEQUENCE_FLAGS);
CHECK(report.readBits(14) == failedMessage.packetSequenceCount);
CHECK(report.readEnum16() == 0);
CHECK(report.readEnum16() == ErrorHandler::MessageTooShort);
}
TEST_CASE("Error: Failed Execution Completion", "[errors]") {
Message failedMessage(38, 32, Message::TC, 56);
ErrorHandler::reportError(failedMessage, ErrorHandler::UnknownExecutionError);
ErrorHandler::reportError(failedMessage, ErrorHandler::UnknownCompletionExecutionError);
REQUIRE(ServiceTests::hasOneMessage());
Message report = ServiceTests::get(0);
......@@ -41,9 +41,9 @@ TEST_CASE("Error: Failed Execution Completion", "[errors]") {
CHECK(report.readBits(1) == static_cast<uint16_t>(Message::TC));
CHECK(report.readBits(1) == false);
CHECK(report.readBits(11) == 56);
CHECK(report.readBits(2) == 0);
CHECK(report.readBits(2) == ECSS_SEQUENCE_FLAGS);
CHECK(report.readBits(14) == failedMessage.packetSequenceCount);
CHECK(report.readEnum16() == 0);
CHECK(report.readEnum16() == ErrorHandler::UnknownCompletionExecutionError);
}
TEST_CASE("Error: Failed Routing", "[errors]") {
......@@ -63,7 +63,7 @@ TEST_CASE("Error: Failed Routing", "[errors]") {
CHECK(report.readBits(1) == static_cast<uint16_t>(Message::TC));
CHECK(report.readBits(1) == false);
CHECK(report.readBits(11) == 71);
CHECK(report.readBits(2) == 0);
CHECK(report.readBits(2) == ECSS_SEQUENCE_FLAGS);
CHECK(report.readBits(14) == failedMessage.packetSequenceCount);
CHECK(report.readEnum16() == 0);
CHECK(report.readEnum16() == ErrorHandler::UnknownRoutingError);
}
......@@ -5,7 +5,7 @@
#include <cstring>
#include "MessageParser.hpp"
#include "Services/ServiceTests.hpp"
/*
TEST_CASE("ST[01] message execution", "[MessageParser][st01]") {
MessageParser messageParser;
......@@ -44,7 +44,7 @@ TEST_CASE("ST[01] message execution", "[MessageParser][st01]") {
CHECK(response.messageType == 10);
CHECK(response.packetType == Message::TM);
}
*/
TEST_CASE("ST[17] message execution", "[MessageParser][st17]") {
MessageParser messageParser;
......
......@@ -22,7 +22,7 @@ TEST_CASE("TM[1,1]", "[service][st01]") {
CHECK(response.readEnumerated(1) == Message::TC); // packet type
CHECK(response.readBits(1) == 0); // secondary header flag
CHECK(response.readEnumerated(11) == 3); // application process ID
CHECK(response.readEnumerated(2) == 0); // sequence flags
CHECK(response.readEnumerated(2) == 3); // sequence flags
CHECK(response.readBits(14) == 0); // packet sequence count
}
......@@ -30,7 +30,8 @@ TEST_CASE("TM[1,2]", "[service][st01]") {
RequestVerificationService reqVerifService;
Message receivedMessage = Message(1, 2, Message::TC, 3);
reqVerifService.failAcceptanceVerification(receivedMessage);
reqVerifService.failAcceptanceVerification(receivedMessage,
ErrorHandler::UnknownAcceptanceError);
REQUIRE(ServiceTests::hasOneMessage());
Message response = ServiceTests::get(0);
......@@ -45,16 +46,16 @@ TEST_CASE("TM[1,2]", "[service][st01]") {
CHECK(response.readEnumerated(1) == Message::TC); // packet type
CHECK(response.readBits(1) == 0); // secondary header flag
CHECK(response.readEnumerated(11) == 3); // application process ID
CHECK(response.readEnumerated(2) == 0); // sequence flags
CHECK(response.readEnumerated(2) == 3); // sequence flags
CHECK(response.readBits(14) == 0); // packet sequence count
CHECK(response.readEnum16() == 0); // error code
CHECK(response.readEnum16() == ErrorHandler::UnknownAcceptanceError); // error code
}
TEST_CASE("TM[1,7]", "[service][st01]") {
RequestVerificationService reqVerifService;
Message receivedMessage = Message(1, 7, Message::TC, 3);
reqVerifService.successExecutionVerification(receivedMessage);
reqVerifService.successCompletionExecutionVerification(receivedMessage);
REQUIRE(ServiceTests::hasOneMessage());
Message response = ServiceTests::get(0);
......@@ -69,7 +70,7 @@ TEST_CASE("TM[1,7]", "[service][st01]") {
CHECK(response.readEnumerated(1) == Message::TC); // packet type
CHECK(response.readBits(1) == 0); // secondary header flag
CHECK(response.readEnumerated(11) == 3); // application process ID
CHECK(response.readEnumerated(2) == 0); // sequence flags
CHECK(response.readEnumerated(2) == 3); // sequence flags
CHECK(response.readBits(14) == 0); // packet sequence count
}
......@@ -77,7 +78,8 @@ TEST_CASE("TM[1,8]", "[service][st01]") {
RequestVerificationService reqVerifService;
Message receivedMessage = Message(1, 8, Message::TC, 3);
reqVerifService.failExecutionVerification(receivedMessage);
reqVerifService.failCompletionExecutionVerification(receivedMessage,
ErrorHandler::UnknownCompletionExecutionError);
REQUIRE(ServiceTests::hasOneMessage());
Message response = ServiceTests::get(0);
......@@ -91,16 +93,16 @@ TEST_CASE("TM[1,8]", "[service][st01]") {
CHECK(response.readEnumerated(1) == Message::TC); // packet type
CHECK(response.readBits(1) == 0); // secondary header flag
CHECK(response.readEnumerated(11) == 3); // application process ID
CHECK(response.readEnumerated(2) == 0); // sequence flags
CHECK(response.readEnumerated(2) == 3); // sequence flags
CHECK(response.readBits(14) == 0); // packet sequence count
CHECK(response.readEnum16() == 0); // error code
CHECK(response.readEnum16() == ErrorHandler::UnknownCompletionExecutionError); // error code
}
TEST_CASE("TM[1,10]", "[service][st01]") {
RequestVerificationService reqVerifService;
Message receivedMessage = Message(1, 10, Message::TC, 3);
reqVerifService.failRoutingVerification(receivedMessage);
reqVerifService.failRoutingVerification(receivedMessage, ErrorHandler::UnknownRoutingError);
REQUIRE(ServiceTests::hasOneMessage());
Message response = ServiceTests::get(0);
......@@ -115,7 +117,7 @@ TEST_CASE("TM[1,10]", "[service][st01]") {
CHECK(response.readEnumerated(1) == Message::TC); // packet type
CHECK(response.readBits(1) == 0); // secondary header flag
CHECK(response.readEnumerated(11) == 3); // application process ID
CHECK(response.readEnumerated(2) == 0); // sequence flags
CHECK(response.readEnumerated(2) == 3); // sequence flags
CHECK(response.readBits(14) == 0); // packet sequence count
CHECK(response.readEnum16() == 0); // error code
CHECK(response.readEnum16() == ErrorHandler::UnknownRoutingError); // error code
}
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