------------------------------------------------------------ revno: 13546 revision-id: squid3@treenet.co.nz-20140825045357-rrkypd1tbe917c3o parent: squid3@treenet.co.nz-20140823120416-2pqr08bsaim6ilmf committer: Amos Jeffries branch nick: trunk timestamp: Sun 2014-08-24 21:53:57 -0700 message: Cleanup: remove SQUID_NO_STRING_BUFFER_PROTECT and SQUID_UNIT_TEST macros These macros were used solely to prevent cppunit and operating system includes from generating build errors and warnings via Squid protection from unsafe use of sprintf, strdup and other allocator and string functions. The protection against these functions has long ago been move to source-maintenance script instead of runtime checking. Making these macros obsolete. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140825045357-rrkypd1tbe917c3o # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 928cc6bbc28d417107f81703a6d4c265a0fc35e9 # timestamp: 2014-08-25 05:56:42 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140823120416-\ # 2pqr08bsaim6ilmf # # Begin patch === modified file 'compat/os/solaris.h' --- compat/os/solaris.h 2014-02-13 07:02:35 +0000 +++ compat/os/solaris.h 2014-08-25 04:53:57 +0000 @@ -64,12 +64,6 @@ #define __FUNCTION__ "" #endif -/* Exclude CPPUnit tests from the allocator restrictions. */ -/* BSD implementation uses these still */ -#if defined(SQUID_UNIT_TEST) -#define SQUID_NO_STRING_BUFFER_PROTECT 1 -#endif - /* Bug 2500: Solaris 10/11 require s6_addr* defines. */ //#define s6_addr8 _S6_un._S6_u8 //#define s6_addr16 _S6_un._S6_u16 === modified file 'compat/testPreCompiler.cc' --- compat/testPreCompiler.cc 2014-02-21 10:46:19 +0000 +++ compat/testPreCompiler.cc 2014-08-25 04:53:57 +0000 @@ -1,10 +1,8 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" +#include "testPreCompiler.h" #include -#include "testPreCompiler.h" - CPPUNIT_TEST_SUITE_REGISTRATION( testPreCompiler ); /** === modified file 'lib/snmplib/mib.c' --- lib/snmplib/mib.c 2014-02-21 10:46:19 +0000 +++ lib/snmplib/mib.c 2014-08-25 04:53:57 +0000 @@ -21,7 +21,6 @@ SOFTWARE. ******************************************************************/ -#define SQUID_NO_STRING_BUFFER_PROTECT 1 #include "squid.h" #if HAVE_UNISTD_H === modified file 'lib/tests/testRFC1035.cc' --- lib/tests/testRFC1035.cc 2014-02-21 10:46:19 +0000 +++ lib/tests/testRFC1035.cc 2014-08-25 04:53:57 +0000 @@ -1,10 +1,8 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" +#include "testRFC1035.h" #include -#include "testRFC1035.h" - /* Being a C library code it is best bodily included and tested with C++ type-safe techniques. */ #include "lib/rfc1035.c" #include "lib/rfc2671.c" === modified file 'lib/tests/testRFC1738.cc' --- lib/tests/testRFC1738.cc 2014-02-21 10:46:19 +0000 +++ lib/tests/testRFC1738.cc 2014-08-25 04:53:57 +0000 @@ -1,10 +1,8 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" +#include "testRFC1738.h" #include -#include "testRFC1738.h" - /* Being a C library code it is best bodily included and tested with C++ type-safe techniques. */ #include "lib/rfc1738.c" === modified file 'src/base/testCharacterSet.cc' --- src/base/testCharacterSet.cc 2013-12-30 13:22:05 +0000 +++ src/base/testCharacterSet.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include "base/CharacterSet.h" #include "testCharacterSet.h" === modified file 'src/base/testCharacterSet.h' --- src/base/testCharacterSet.h 2013-12-30 09:44:52 +0000 +++ src/base/testCharacterSet.h 2014-08-25 04:53:57 +0000 @@ -1,8 +1,6 @@ #ifndef SQUID_BASE_TESTCHARACTERSET_H #define SQUID_BASE_TESTCHARACTERSET_H -#define SQUID_UNIT_TEST 1 - #include class testCharacterSet : public CPPUNIT_NS::TestFixture === modified file 'src/icmp/testIcmp.cc' --- src/icmp/testIcmp.cc 2012-08-14 11:53:07 +0000 +++ src/icmp/testIcmp.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #define SQUID_HELPER 1 #include "squid.h" === modified file 'src/icmp/testIcmp.h' --- src/icmp/testIcmp.h 2010-04-17 02:29:04 +0000 +++ src/icmp/testIcmp.h 2014-08-25 04:53:57 +0000 @@ -1,8 +1,6 @@ #ifndef SQUID_SRC_TEST_URL_H #define SQUID_SRC_TEST_URL_H -#define SQUID_UNIT_TEST 1 - #include "Icmp.h" #include === modified file 'src/ip/testAddress.cc' --- src/ip/testAddress.cc 2014-07-18 11:02:16 +0000 +++ src/ip/testAddress.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include "ip/Address.h" #include "ip/tools.h" === modified file 'src/tests/testACLMaxUserIP.cc' --- src/tests/testACLMaxUserIP.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testACLMaxUserIP.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #if USE_AUTH === modified file 'src/tests/testAuth.cc' --- src/tests/testAuth.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testAuth.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #if USE_AUTH === modified file 'src/tests/testBoilerplate.cc' --- src/tests/testBoilerplate.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testBoilerplate.cc 2014-08-25 04:53:57 +0000 @@ -1,6 +1,4 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" - #include "testBoilerplate.h" #include === modified file 'src/tests/testCacheManager.cc' --- src/tests/testCacheManager.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testCacheManager.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include "CacheManager.h" #include "Mem.h" === modified file 'src/tests/testConfigParser.cc' --- src/tests/testConfigParser.cc 2013-11-19 01:12:54 +0000 +++ src/tests/testConfigParser.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include "ConfigParser.h" #include "event.h" === modified file 'src/tests/testDiskIO.cc' --- src/tests/testDiskIO.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testDiskIO.cc 2014-08-25 04:53:57 +0000 @@ -1,6 +1,4 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" - #include "DiskIO/DiskIOModule.h" #include "HttpHeader.h" #include "HttpReply.h" === modified file 'src/tests/testEvent.cc' --- src/tests/testEvent.cc 2012-08-31 16:57:39 +0000 +++ src/tests/testEvent.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include === modified file 'src/tests/testEventLoop.cc' --- src/tests/testEventLoop.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testEventLoop.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include === modified file 'src/tests/testHttpParser.cc' --- src/tests/testHttpParser.cc 2013-11-18 17:03:55 +0000 +++ src/tests/testHttpParser.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include === modified file 'src/tests/testHttpReply.cc' --- src/tests/testHttpReply.cc 2014-07-22 23:17:16 +0000 +++ src/tests/testHttpReply.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include === modified file 'src/tests/testHttpRequest.cc' --- src/tests/testHttpRequest.cc 2014-04-27 07:59:17 +0000 +++ src/tests/testHttpRequest.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include === modified file 'src/tests/testHttpRequestMethod.cc' --- src/tests/testHttpRequestMethod.cc 2014-04-22 02:47:09 +0000 +++ src/tests/testHttpRequestMethod.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include === modified file 'src/tests/testMain.cc' --- src/tests/testMain.cc 2012-01-20 18:55:04 +0000 +++ src/tests/testMain.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include === modified file 'src/tests/testRock.cc' --- src/tests/testRock.cc 2014-02-21 16:14:05 +0000 +++ src/tests/testRock.cc 2014-08-25 04:53:57 +0000 @@ -1,6 +1,4 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" - #include "ConfigParser.h" #include "DiskIO/DiskIOModule.h" #include "fs/rock/RockSwapDir.h" === modified file 'src/tests/testStatHist.cc' --- src/tests/testStatHist.cc 2013-11-27 15:52:03 +0000 +++ src/tests/testStatHist.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include "StatHist.h" #include "testStatHist.h" === modified file 'src/tests/testStore.cc' --- src/tests/testStore.cc 2013-11-18 17:03:55 +0000 +++ src/tests/testStore.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include "Store.h" #include "testStore.h" === modified file 'src/tests/testStoreController.cc' --- src/tests/testStoreController.cc 2013-12-19 23:13:24 +0000 +++ src/tests/testStoreController.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include "Mem.h" #include "MemObject.h" === modified file 'src/tests/testStoreEntryStream.cc' --- src/tests/testStoreEntryStream.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testStoreEntryStream.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include "CapturingStoreEntry.h" #include "Mem.h" === modified file 'src/tests/testStoreHashIndex.cc' --- src/tests/testStoreHashIndex.cc 2013-12-19 23:13:24 +0000 +++ src/tests/testStoreHashIndex.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include "Mem.h" #include "MemObject.h" === modified file 'src/tests/testStoreSupport.cc' --- src/tests/testStoreSupport.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testStoreSupport.cc 2014-08-25 04:53:57 +0000 @@ -30,8 +30,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */ - -#define SQUID_UNIT_TEST 1 #include "squid.h" #include "event.h" #include "EventLoop.h" === modified file 'src/tests/testString.cc' --- src/tests/testString.cc 2013-10-25 00:13:46 +0000 +++ src/tests/testString.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include "event.h" #include "Mem.h" === modified file 'src/tests/testURL.cc' --- src/tests/testURL.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testURL.cc 2014-08-25 04:53:57 +0000 @@ -1,4 +1,3 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" #include === modified file 'src/tests/testUfs.cc' --- src/tests/testUfs.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testUfs.cc 2014-08-25 04:53:57 +0000 @@ -1,6 +1,4 @@ -#define SQUID_UNIT_TEST 1 #include "squid.h" - #include "DiskIO/DiskIOModule.h" #include "fs/ufs/UFSSwapDir.h" #include "globals.h" === modified file 'src/tests/testUriScheme.cc' --- src/tests/testUriScheme.cc 2014-02-21 10:46:19 +0000 +++ src/tests/testUriScheme.cc 2014-08-25 04:53:57 +0000 @@ -1,5 +1,3 @@ -#define SQUID_UNIT_TEST 1 - #include "squid.h" #include === modified file 'src/tests/test_http_range.cc' --- src/tests/test_http_range.cc 2014-06-24 22:21:48 +0000 +++ src/tests/test_http_range.cc 2014-08-25 04:53:57 +0000 @@ -29,23 +29,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */ -#define SQUID_UNIT_TEST 1 #include "squid.h" - -#if 0 -//#include "Store.h" -//#include "client_side_request.h" -#endif - -/** \todo CLEANUP: This file shoudl be called something_stub.cc */ - #include "HttpHeader.h" #include "HttpHeaderRange.h" #include "Mem.h" -#if 0 -#include "acl/Checklist.h" -#endif +/** \todo CLEANUP: This file should be called something_stub.cc */ void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str) {