1//
2// ICMPClientTest.h
3//
4// Definition of the ICMPClientTest 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 ICMPClientTest_INCLUDED
14#define ICMPClientTest_INCLUDED
15
16
17#include "Poco/Net/Net.h"
18#include "Poco/CppUnit/TestCase.h"
19#include "Poco/Net/ICMPClient.h"
20#include "Poco/Net/ICMPEventArgs.h"
21#include "Poco/Mutex.h"
22
23
24class ICMPClientTest: public CppUnit::TestCase
25{
26public:
27 ICMPClientTest(const std::string& name);
28 ~ICMPClientTest();
29
30 void testPing();
31 void testBigPing();
32
33 void setUp();
34 void tearDown();
35
36 static CppUnit::Test* suite();
37
38 void onBegin(const void* pSender, Poco::Net::ICMPEventArgs& args);
39 void onReply(const void* pSender, Poco::Net::ICMPEventArgs& args);
40 void onError(const void* pSender, Poco::Net::ICMPEventArgs& args);
41 void onEnd(const void* pSender, Poco::Net::ICMPEventArgs& args);
42
43private:
44 void registerDelegates(const Poco::Net::ICMPClient& icmpClient);
45 void unregisterDelegates(const Poco::Net::ICMPClient& icmpClient);
46 static Poco::FastMutex _mutex;
47};
48
49
50#endif // ICMPClientTest_INCLUDED
51