some more fail tests
This commit is contained in:
parent
1b5fa2a8fa
commit
8f6f0e1d45
@ -6,6 +6,12 @@ TmStoreAndSendWrapper::TmStoreAndSendWrapper(uint8_t defaultService, TmStoreHelp
|
|||||||
TmSendHelper& sendHelper)
|
TmSendHelper& sendHelper)
|
||||||
: storeHelper(storeHelper), sendHelper(sendHelper), defaultService(defaultService) {}
|
: storeHelper(storeHelper), sendHelper(sendHelper), defaultService(defaultService) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper wrapper which stores the TM packet into the store and then sends it.
|
||||||
|
* @return
|
||||||
|
* - StorageManagerIF returnvalue if storage fails
|
||||||
|
* - MessageQueueIF returnvalue if sending fails
|
||||||
|
*/
|
||||||
ReturnValue_t TmStoreAndSendWrapper::storeAndSendTmPacket() {
|
ReturnValue_t TmStoreAndSendWrapper::storeAndSendTmPacket() {
|
||||||
ReturnValue_t result = storeHelper.addPacketToStore();
|
ReturnValue_t result = storeHelper.addPacketToStore();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -31,6 +31,13 @@ TEST_CASE("TM Store And Send Helper", "[tm-store-send-helper]") {
|
|||||||
CHECK(&tmHelper.storeHelper == &storeHelper);
|
CHECK(&tmHelper.storeHelper == &storeHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECTION("Storage Fails") {
|
||||||
|
// Too large to fit in store
|
||||||
|
std::array<uint8_t, 80> data{};
|
||||||
|
REQUIRE(storeHelper.setSourceDataRaw(data.data(), data.size()) == result::OK);
|
||||||
|
REQUIRE(tmHelper.storeAndSendTmPacket() == StorageManagerIF::DATA_TOO_LARGE);
|
||||||
|
}
|
||||||
|
|
||||||
SECTION("Base Test") {
|
SECTION("Base Test") {
|
||||||
tmHelper.prepareTmPacket(2);
|
tmHelper.prepareTmPacket(2);
|
||||||
auto& creator = storeHelper.getCreatorRef();
|
auto& creator = storeHelper.getCreatorRef();
|
||||||
|
Loading…
Reference in New Issue
Block a user