SmartTester  2.0.0
Smart Tester is unit testing and regression testing framework used for testing SmartCGMS system.
TestFilter.h
1 //
2 // Author: markovd@students.zcu.cz
3 //
4 
5 #ifndef SMARTTESTER_TESTFILTER_H
6 #define SMARTTESTER_TESTFILTER_H
7 
8 #include <iface/FilterIface.h>
9 #include <rtl/referencedImpl.h>
10 
15 class TestFilter : public virtual scgms::IFilter, public virtual refcnt::CNotReferenced {
16 
17  using IFilter_Configuration = refcnt::IVector_Container<scgms::IFilter_Parameter*>;
18 private:
20  std::vector<scgms::TDevice_Event> m_receivedEvents;
21 public:
22  TestFilter() = default;
23  ~TestFilter() override = default;
24 
26  const scgms::TDevice_Event& getLastReceivedEvent();
28  const scgms::TDevice_Event& getFirstReceivedEvent();
30  void clearReceivedEvents() noexcept;
33 
34  const scgms::TDevice_Event* getLastNonShutDownEvent();
35  std::size_t getReceivedEventsCount();
36 
37  HRESULT IfaceCalling Execute(scgms::IDevice_Event *event) final;
38 
39  HRESULT IfaceCalling Configure(IFilter_Configuration* configuration, refcnt::wstr_list *error_description) final;
40 };
41 #endif //SMARTTESTER_TESTFILTER_H
TestFilter::getUniqueSegmentIdsFromReceivedEventsCount
std::size_t getUniqueSegmentIdsFromReceivedEventsCount()
Returns the number of unique segment id's on the vector of received events.
Definition: TestFilter.cpp:56
TestFilter::getLastReceivedEvent
const scgms::TDevice_Event & getLastReceivedEvent()
Returns a reference to the event data we got from the tested filter.
Definition: TestFilter.cpp:27
TestFilter
Definition: TestFilter.h:15
TestFilter::Execute
HRESULT IfaceCalling Execute(scgms::IDevice_Event *event) final
Definition: TestFilter.cpp:13
TestFilter::getFirstReceivedEvent
const scgms::TDevice_Event & getFirstReceivedEvent()
Returns a reference to the first event we received from the tested filter.
Definition: TestFilter.cpp:31
TestFilter::clearReceivedEvents
void clearReceivedEvents() noexcept
Clears the vector of received events.
Definition: TestFilter.cpp:35