]> git.ipfire.org Git - thirdparty/squid.git/blame - compat/cppunit.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / compat / cppunit.h
CommitLineData
37be9888 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
37be9888
AJ
3 *
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.
7 */
8
a203dec7
AJ
9#ifndef SQUID_COMPAT_CPPUNIT_H
10#define SQUID_COMPAT_CPPUNIT_H
11
12// CPPUNIT test suite uses auto_ptr which is deprecated in C++0x
13
7b81a8f7 14#if HAVE_CPPUNIT_EXTENSIONS_HELPERMACROS_H
1e6ceb8f 15#if defined(__cplusplus)
a203dec7
AJ
16#include <cppunit/extensions/HelperMacros.h>
17
18#undef CPPUNIT_TEST_SUITE_END
19
20// Clone from cppunit 1.12.1
21#define CPPUNIT_TEST_SUITE_END() \
22 } \
23 \
24 static CPPUNIT_NS::TestSuite *suite() \
25 { \
26 const CPPUNIT_NS::TestNamer &namer = getTestNamer__(); \
27 std::unique_ptr<CPPUNIT_NS::TestSuite> suite( \
28 new CPPUNIT_NS::TestSuite( namer.getFixtureName() )); \
29 CPPUNIT_NS::ConcretTestFixtureFactory<TestFixtureType> factory; \
30 CPPUNIT_NS::TestSuiteBuilderContextBase context( *suite.get(), \
31 namer, \
32 factory ); \
33 TestFixtureType::addTestsToSuite( context ); \
34 return suite.release(); \
35 } \
36 private: /* dummy typedef so that the macro can still end with ';'*/ \
37 typedef int CppUnitDummyTypedefForSemiColonEnding__
38
1e6ceb8f 39#endif /* __cplusplus */
7b81a8f7 40#endif /* HAVE_CPPUNIT_EXTENSIONS_HELPERMACROS_H */
a203dec7 41#endif /* SQUID_COMPAT_CPPUNIT_H */
f53969cc 42