unittest folder added
This commit is contained in:
48
unittest/config/cdatapool/dataPoolInit.cpp
Normal file
48
unittest/config/cdatapool/dataPoolInit.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
#include <fsfw/unittest/config/cdatapool/dataPoolInit.h>
|
||||
|
||||
void datapool::dataPoolInit(std::map<uint32_t, PoolEntryIF*> * poolMap) {
|
||||
uint8_t UINT8T_INIT[1] = {0};
|
||||
uint16_t UINT16T_INIT[1] = {0};
|
||||
uint32_t UINT32T_INIT[1] = {0};
|
||||
float FLOAT_INIT[2] = {0.0, 0.0};
|
||||
/* FSFW */
|
||||
poolMap->emplace(datapool::INTERNAL_ERROR_STORE_FULL,
|
||||
new PoolEntry<uint32_t>(UINT32T_INIT,1));
|
||||
poolMap->emplace(datapool::INTERNAL_ERROR_MISSED_LIVE_TM,
|
||||
new PoolEntry<uint32_t>(UINT32T_INIT,1));
|
||||
poolMap->emplace(datapool::INTERNAL_ERROR_FULL_MSG_QUEUES,
|
||||
new PoolEntry<uint32_t>(UINT32T_INIT,1));
|
||||
|
||||
/* TEST */
|
||||
poolMap->emplace(datapool::TEST_UINT8,
|
||||
new PoolEntry<uint8_t>(UINT8T_INIT,1));
|
||||
poolMap->emplace(datapool::TEST_UINT16,
|
||||
new PoolEntry<uint16_t>(UINT16T_INIT,1));
|
||||
poolMap->emplace(datapool::TEST_UINT32,
|
||||
new PoolEntry<uint32_t>(UINT32T_INIT,1));
|
||||
poolMap->emplace(datapool::TEST_FLOAT_VECTOR,
|
||||
new PoolEntry<float>(FLOAT_INIT,2));
|
||||
|
||||
// With new initializer list feature and boolean entries.
|
||||
|
||||
// /* FSFW */
|
||||
// poolMap->emplace(datapool::INTERNAL_ERROR_STORE_FULL,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
// poolMap->emplace(datapool::INTERNAL_ERROR_MISSED_LIVE_TM,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
// poolMap->emplace(datapool::INTERNAL_ERROR_FULL_MSG_QUEUES,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
//
|
||||
// /* TEST */
|
||||
// poolMap->emplace(datapool::TEST_BOOLEAN,
|
||||
// new PoolEntry<bool>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_UINT8,
|
||||
// new PoolEntry<uint8_t>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_UINT16,
|
||||
// new PoolEntry<uint16_t>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_UINT32,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_FLOAT_VECTOR,
|
||||
// new PoolEntry<float>({0, 0},2));
|
||||
|
||||
}
|
29
unittest/config/cdatapool/dataPoolInit.h
Normal file
29
unittest/config/cdatapool/dataPoolInit.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
||||
#define HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
||||
|
||||
#include <fsfw/datapool/DataPool.h>
|
||||
#include <fsfw/datapool/PoolEntryIF.h>
|
||||
#include <map>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
namespace datapool {
|
||||
void dataPoolInit(std::map<uint32_t, PoolEntryIF*> * poolMap);
|
||||
|
||||
enum datapoolvariables {
|
||||
NO_PARAMETER = 0,
|
||||
|
||||
/** [EXPORT] : [GROUP] FSFW */
|
||||
INTERNAL_ERROR_STORE_FULL = 0xEE000001, //!< [EXPORT] : [NAME] Internal Error Store Entry [UNIT] (-) [SIZE] 1 [TYPE] uint32_t
|
||||
INTERNAL_ERROR_MISSED_LIVE_TM = 0xEE000001, //!< [EXPORT] : [NAME] Internal Error Missed Live Tm [UNIT] (-) [SIZE] 1 [TYPE] uint32_t
|
||||
INTERNAL_ERROR_FULL_MSG_QUEUES = 0xEE000001, //!< [EXPORT] : [NAME] Internal Error Full Msg Queue [UNIT] (-) [SIZE] 1 [TYPE] uint32_t
|
||||
|
||||
/** [EXPORT] : [GROUP] TEST */
|
||||
TEST_BOOLEAN = 0x01010102, //!< [EXPORT] : [NAME] Test Boolean [UNIT] (-) [SIZE] 1 [TYPE] bool
|
||||
TEST_UINT8 = 0x02020204, //!< [EXPORT] : [NAME] Test Byte [UNIT] (-) [SIZE] 1 [TYPE] uint8_t
|
||||
TEST_UINT16 = 0x03030306, //!< [EXPORT] : [NAME] Test UINT16 [UNIT] (-) [SIZE] 1 [TYPE] uint16_t
|
||||
TEST_UINT32 = 0x04040408, //!< [EXPORT] : [NAME] Test UINT32 [UNIT] (-) [SIZE] 1 [TYPE] uint32_t
|
||||
TEST_FLOAT_VECTOR = 0x05050510, //!< [EXPORT] : [NAME] Test Float [UNIT] (-) [SIZE] 2 [TYPE] float
|
||||
};
|
||||
}
|
||||
#endif /* CONFIG_CDATAPOOL_DATAPOOLINIT_H_ */
|
Reference in New Issue
Block a user