1 | // |
2 | // FIFOEventTest.h |
3 | // |
4 | // Definition of the FIFOEventTest class. |
5 | // |
6 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. |
7 | // and Contributors. |
8 | // |
9 | // SPDX-License-Identifier: BSL-1.0 |
10 | // |
11 | |
12 | |
13 | #ifndef FIFOEventTest_INCLUDED |
14 | #define FIFOEventTest_INCLUDED |
15 | |
16 | |
17 | #include "Poco/Foundation.h" |
18 | #include "Poco/CppUnit/TestCase.h" |
19 | #include "Poco/FIFOEvent.h" |
20 | #include "Poco/EventArgs.h" |
21 | |
22 | |
23 | class FIFOEventTest: public CppUnit::TestCase |
24 | { |
25 | Poco::FIFOEvent<void> Void; |
26 | Poco::FIFOEvent<int> Simple; |
27 | Poco::FIFOEvent<const int> ConstSimple; |
28 | Poco::FIFOEvent<Poco::EventArgs*> Complex; |
29 | Poco::FIFOEvent<Poco::EventArgs> Complex2; |
30 | Poco::FIFOEvent<const Poco::EventArgs*> ConstComplex; |
31 | Poco::FIFOEvent<const Poco::EventArgs * const> Const2Complex; |
32 | public: |
33 | FIFOEventTest(const std::string& name); |
34 | ~FIFOEventTest(); |
35 | |
36 | void testNoDelegate(); |
37 | void testSingleDelegate(); |
38 | void testDuplicateRegister(); |
39 | void testDuplicateUnregister(); |
40 | void testDisabling(); |
41 | void testFIFOOrder(); |
42 | void testFIFOOrderExpire(); |
43 | void testExpire(); |
44 | void testExpireReRegister(); |
45 | void testReturnParams(); |
46 | void testOverwriteDelegate(); |
47 | void testAsyncNotify(); |
48 | |
49 | void setUp(); |
50 | void tearDown(); |
51 | static CppUnit::Test* suite(); |
52 | |
53 | protected: |
54 | void onVoid(const void* pSender); |
55 | void onSimple(const void* pSender, int& i); |
56 | void onSimpleOther(const void* pSender, int& i); |
57 | void onConstSimple(const void* pSender, const int& i); |
58 | void onComplex(const void* pSender, Poco::EventArgs* & i); |
59 | void onComplex2(const void* pSender, Poco::EventArgs & i); |
60 | void onConstComplex(const void* pSender, const Poco::EventArgs*& i); |
61 | void onConst2Complex(const void* pSender, const Poco::EventArgs * const & i); |
62 | void onAsync(const void* pSender, int& i); |
63 | |
64 | int getCount() const; |
65 | private: |
66 | int _count; |
67 | }; |
68 | |
69 | |
70 | #endif // FIFOEventTest_INCLUDED |
71 | |