]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/cppunit.h
2 * Copyright (C) 1996-2023 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_COMPAT_CPPUNIT_H
10 #define SQUID_COMPAT_CPPUNIT_H
12 // CPPUNIT test suite uses auto_ptr which is deprecated in C++0x
14 #if HAVE_CPPUNIT_EXTENSIONS_HELPERMACROS_H
15 #if defined(__cplusplus)
16 #include <cppunit/extensions/HelperMacros.h>
18 #undef CPPUNIT_TEST_SUITE_END
20 // Clone from cppunit 1.12.1
21 #define CPPUNIT_TEST_SUITE_END() \
24 static CPPUNIT_NS::TestSuite *suite() \
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(), \
33 TestFixtureType::addTestsToSuite( context ); \
34 return suite.release(); \
36 private: /* dummy typedef so that the macro can still end with ';'*/ \
37 typedef int CppUnitDummyTypedefForSemiColonEnding__
39 #endif /* __cplusplus */
40 #endif /* HAVE_CPPUNIT_EXTENSIONS_HELPERMACROS_H */
41 #endif /* SQUID_COMPAT_CPPUNIT_H */