completed send helper tests
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
target_sources(${FSFW_TEST_TGT} PRIVATE
|
||||
TestNewAccessor.cpp
|
||||
TestPool.cpp
|
||||
testAccessor.cpp
|
||||
testPool.cpp
|
||||
)
|
||||
|
@ -6,11 +6,11 @@
|
||||
|
||||
#include "CatchDefinitions.h"
|
||||
|
||||
TEST_CASE("New Accessor", "[NewAccessor]") {
|
||||
TEST_CASE("Pool Accessor", "[pool-accessor]") {
|
||||
LocalPool::LocalPoolConfig poolCfg = {{1, 10}};
|
||||
LocalPool SimplePool = LocalPool(0, poolCfg);
|
||||
std::array<uint8_t, 20> testDataArray;
|
||||
std::array<uint8_t, 20> receptionArray;
|
||||
std::array<uint8_t, 20> testDataArray{};
|
||||
std::array<uint8_t, 20> receptionArray{};
|
||||
store_address_t testStoreId;
|
||||
ReturnValue_t result = retval::CATCH_FAILED;
|
||||
|
@ -10,10 +10,10 @@
|
||||
TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") {
|
||||
LocalPool::LocalPoolConfig config = {{1, 10}};
|
||||
LocalPool simplePool(0, config);
|
||||
std::array<uint8_t, 20> testDataArray;
|
||||
std::array<uint8_t, 20> receptionArray;
|
||||
std::array<uint8_t, 20> testDataArray{};
|
||||
std::array<uint8_t, 20> receptionArray{};
|
||||
store_address_t testStoreId;
|
||||
ReturnValue_t result = retval::CATCH_FAILED;
|
||||
ReturnValue_t result;
|
||||
uint8_t* pointer = nullptr;
|
||||
const uint8_t* constPointer = nullptr;
|
||||
|
||||
@ -23,8 +23,10 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") {
|
||||
size_t size = 10;
|
||||
|
||||
SECTION("Basic tests") {
|
||||
REQUIRE(not simplePool.hasDataAtId(testStoreId));
|
||||
result = simplePool.addData(&testStoreId, testDataArray.data(), size);
|
||||
REQUIRE(result == retval::CATCH_OK);
|
||||
REQUIRE(simplePool.hasDataAtId(testStoreId));
|
||||
result = simplePool.getData(testStoreId, &constPointer, &size);
|
||||
REQUIRE(result == retval::CATCH_OK);
|
||||
memcpy(receptionArray.data(), constPointer, size);
|
||||
@ -40,6 +42,7 @@ TEST_CASE("Local Pool Simple Tests [1 Pool]", "[TestPool]") {
|
||||
}
|
||||
result = simplePool.deleteData(testStoreId);
|
||||
REQUIRE(result == retval::CATCH_OK);
|
||||
REQUIRE(not simplePool.hasDataAtId(testStoreId));
|
||||
result = simplePool.addData(&testStoreId, testDataArray.data(), 15);
|
||||
CHECK(result == (int)StorageManagerIF::DATA_TOO_LARGE);
|
||||
}
|
Reference in New Issue
Block a user