1
0
forked from fsfw/fsfw

fnish CFDP distributor unittests

This commit is contained in:
2022-08-09 13:04:23 +02:00
parent 192956c2c7
commit 0d26a0f54b
9 changed files with 66 additions and 29 deletions

View File

@ -42,6 +42,14 @@ class CfdpDistributor : public TcDistributorBase, public AcceptsTelecommandsIF {
[[nodiscard]] const char* getName() const override;
[[nodiscard]] uint32_t getIdentifier() const override;
[[nodiscard]] MessageQueueId_t getRequestQueue() const override;
/**
* Register a new CFDP entity which can receive PDUs.
* @param address
* @param tcDest
* @return
* - @c RETURN_FAILED: Entry already exists for the given address
*/
ReturnValue_t registerTcDestination(const cfdp::EntityId& address, AcceptsTelecommandsIF& tcDest);
protected:

View File

@ -80,8 +80,8 @@ class ConstStorageAccessor {
* @param
* @return
*/
ConstStorageAccessor& operator=(ConstStorageAccessor&&) noexcept ;
ConstStorageAccessor(ConstStorageAccessor&&) noexcept ;
ConstStorageAccessor& operator=(ConstStorageAccessor&&) noexcept;
ConstStorageAccessor(ConstStorageAccessor&&) noexcept;
//! The copy ctor and copy assignemnt should be deleted implicitely
//! according to https://foonathan.net/2019/02/special-member-functions/

View File

@ -167,8 +167,7 @@ void LocalPool::clearStore() {
}
}
ReturnValue_t LocalPool::reserveSpace(size_t size, store_address_t* storeId,
bool ignoreFault) {
ReturnValue_t LocalPool::reserveSpace(size_t size, store_address_t* storeId, bool ignoreFault) {
ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex);
if (status != RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1

View File

@ -27,7 +27,7 @@ class PoolManager : public LocalPool {
* @brief In the PoolManager's destructor all allocated memory
* is freed.
*/
virtual ~PoolManager();
~PoolManager() override;
/**
* Set the default mutex timeout for internal calls.
@ -40,8 +40,7 @@ class PoolManager : public LocalPool {
* which wraps LocalPool calls with a mutex protection.
*/
ReturnValue_t deleteData(store_address_t) override;
ReturnValue_t deleteData(uint8_t* buffer, size_t size,
store_address_t* storeId = nullptr) override;
ReturnValue_t deleteData(uint8_t* buffer, size_t size, store_address_t* storeId) override;
/**
* The developer is allowed to lock the mutex in case the lock needs
@ -58,8 +57,7 @@ class PoolManager : public LocalPool {
//! Default mutex timeout value to prevent permanent blocking.
uint32_t mutexTimeoutMs = 20;
ReturnValue_t reserveSpace(const size_t size, store_address_t* address,
bool ignoreFault) override;
ReturnValue_t reserveSpace(size_t size, store_address_t* address, bool ignoreFault) override;
/**
* @brief The mutex is created in the constructor and makes

View File

@ -26,8 +26,8 @@ class StorageAccessor : public ConstStorageAccessor {
* @param
* @return
*/
StorageAccessor& operator=(StorageAccessor&&) noexcept ;
StorageAccessor(StorageAccessor&&) noexcept ;
StorageAccessor& operator=(StorageAccessor&&) noexcept;
StorageAccessor(StorageAccessor&&) noexcept;
ReturnValue_t write(uint8_t* data, size_t size, uint16_t offset = 0);
uint8_t* data();

View File

@ -92,8 +92,7 @@ class StorageManagerIF : public HasReturnvaluesIF {
* @return @li RETURN_OK on success.
* @li failure code if deletion did not work
*/
virtual ReturnValue_t deleteData(uint8_t* buffer, size_t size,
store_address_t* storeId) = 0;
virtual ReturnValue_t deleteData(uint8_t* buffer, size_t size, store_address_t* storeId) = 0;
virtual ReturnValue_t deleteData(uint8_t* buffer, size_t size) {
return deleteData(buffer, size, nullptr);
}