#ifndef UNITTEST_HOSTED_TESTACTIONHELPER_H_ #define UNITTEST_HOSTED_TESTACTIONHELPER_H_ #include #include #include #include class ActionHelperOwnerMockBase: public HasActionsIF { public: bool getCommandQueueCalled = false; bool executeActionCalled = false; static const size_t MAX_SIZE = 3; uint8_t buffer[MAX_SIZE] = {0, 0, 0}; size_t size = 0; MessageQueueId_t getCommandQueue() const override { return tconst::testQueueId; } ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) override { executeActionCalled = true; if(size > MAX_SIZE){ return 0xAFFE; } this->size = size; memcpy(buffer, data, size); return HasReturnvaluesIF::RETURN_OK; } void clearBuffer(){ this->size = 0; for(size_t i = 0; isize; } if(ptr != nullptr){ *ptr = buffer; } } }; #endif /* UNITTEST_TESTFW_NEWTESTS_TESTACTIONHELPER_H_ */