]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testIcmp.h
786ce351fdc2719d3df2b712c19350cce4c509be
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_SRC_TESTS_TESTICMP_H
10 #define SQUID_SRC_TESTS_TESTICMP_H
12 #include <cppunit/extensions/HelperMacros.h>
16 #include "icmp/Icmp.h"
18 class stubIcmp
: public Icmp
22 virtual ~stubIcmp() {};
23 virtual int Open() { return 0; };
24 virtual void Close() {};
26 /// Construct ECHO request
27 virtual void SendEcho(Ip::Address
&to
, int opcode
, const char *payload
, int len
) {};
29 /// Handle ICMP responses.
30 virtual void Recv(void) {};
32 /* methods to relay test data from tester to private methods being tested */
33 int testChecksum(unsigned short *ptr
, int size
) { return CheckSum(ptr
,size
); };
34 int testHops(int ttl
) { return ipHops(ttl
); };
39 * test the ICMP base class.
41 class testIcmp
: public CPPUNIT_NS::TestFixture
43 CPPUNIT_TEST_SUITE( testIcmp
);
44 CPPUNIT_TEST( testChecksum
);
45 CPPUNIT_TEST( testHops
);
46 CPPUNIT_TEST_SUITE_END();
53 #endif /* SQUID_SRC_TESTS_TESTICMP_H */