updates for storage manager mock

This commit is contained in:
Robin Müller 2022-11-14 14:57:37 +01:00
parent ab9b6c8c89
commit 72d7c43445
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 6 additions and 8 deletions

View File

@ -1,11 +1,11 @@
#include "StorageManagerMock.h"
ReturnValue_t StorageManagerMock::addData(store_address_t *storageId, const uint8_t *data,
size_t size, bool ignoreFault) {
size_t size) {
if (nextAddDataCallFails.first) {
return nextAddDataCallFails.second;
}
return LocalPool::addData(storageId, data, size, ignoreFault);
return LocalPool::addData(storageId, data, size);
}
ReturnValue_t StorageManagerMock::deleteData(store_address_t packet_id) {
if (nextDeleteDataCallFails.first) {
@ -36,11 +36,11 @@ ReturnValue_t StorageManagerMock::modifyData(store_address_t packet_id, uint8_t
}
ReturnValue_t StorageManagerMock::getFreeElement(store_address_t *storageId, size_t size,
uint8_t **p_data, bool ignoreFault) {
uint8_t **p_data) {
if (nextFreeElementCallFails.first) {
return nextFreeElementCallFails.second;
}
return LocalPool::getFreeElement(storageId, size, p_data, ignoreFault);
return LocalPool::getFreeElement(storageId, size, p_data);
}
bool StorageManagerMock::hasDataAtId(store_address_t storeId) const {

View File

@ -8,15 +8,13 @@ class StorageManagerMock : public LocalPool {
public:
StorageManagerMock(object_id_t setObjectId, const LocalPoolConfig &poolConfig);
ReturnValue_t addData(store_address_t *storageId, const uint8_t *data, size_t size,
bool ignoreFault) override;
ReturnValue_t addData(store_address_t *storageId, const uint8_t *data, size_t size) override;
ReturnValue_t deleteData(store_address_t packet_id) override;
ReturnValue_t deleteData(uint8_t *buffer, size_t size, store_address_t *storeId) override;
ReturnValue_t getData(store_address_t packet_id, const uint8_t **packet_ptr,
size_t *size) override;
ReturnValue_t modifyData(store_address_t packet_id, uint8_t **packet_ptr, size_t *size) override;
ReturnValue_t getFreeElement(store_address_t *storageId, size_t size, uint8_t **p_data,
bool ignoreFault) override;
ReturnValue_t getFreeElement(store_address_t *storageId, size_t size, uint8_t **p_data) override;
[[nodiscard]] bool hasDataAtId(store_address_t storeId) const override;
void clearStore() override;
void clearSubPool(uint8_t poolIndex) override;