From d35781726b56fb01bf2fb919199b2bf53e6357f4 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Mon, 16 Aug 2010 16:47:39 +0200 Subject: [PATCH] Moved stubs for calls in main.cc to a specific stub-file. --- src/Makefile.am | 6 +++++ src/tests/stub_main_cc.cc | 47 +++++++++++++++++++++++++++++++++++ src/tests/testCacheManager.cc | 11 -------- src/tests/testEvent.cc | 11 -------- src/tests/testEventLoop.cc | 11 -------- src/tests/testHttpRequest.cc | 11 -------- src/tests/testURL.cc | 11 -------- src/tests/test_http_range.cc | 9 ------- 8 files changed, 53 insertions(+), 64 deletions(-) create mode 100644 src/tests/stub_main_cc.cc diff --git a/src/Makefile.am b/src/Makefile.am index 36bba933f4..5f80e0ff96 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1114,6 +1114,7 @@ tests_testCacheManager_SOURCES = \ tests/testCacheManager.cc \ tests/testCacheManager.h \ tests/testMain.cc \ + tests/stub_main_cc.cc \ time.cc \ BodyPipe.cc \ cache_manager.cc \ @@ -1298,6 +1299,7 @@ tests_testEvent_SOURCES = \ tests/testEvent.cc \ tests/testEvent.h \ tests/testMain.cc \ + tests/stub_main_cc.cc \ time.cc \ BodyPipe.cc \ cache_manager.cc \ @@ -1453,6 +1455,7 @@ tests_testEventLoop_SOURCES = \ tests/testEventLoop.cc \ tests/testEventLoop.h \ tests/testMain.cc \ + tests/stub_main_cc.cc \ time.cc \ BodyPipe.cc \ cache_manager.cc \ @@ -1615,6 +1618,7 @@ tests_test_http_range_SOURCES = \ $(squid_COMMSOURCES) \ ConfigOption.cc \ ConfigParser.cc \ + tests/stub_main_cc.cc \ debug.cc \ $(DELAY_POOL_SOURCE) \ disk.cc \ @@ -1757,6 +1761,7 @@ tests_testHttpRequest_SOURCES = \ tests/testHttpRequestMethod.h \ tests/testHttpRequestMethod.cc \ tests/testMain.cc \ + tests/stub_main_cc.cc \ time.cc \ BodyPipe.cc \ cache_manager.cc \ @@ -2132,6 +2137,7 @@ tests_testURL_SOURCES = \ tests/testURLScheme.cc \ tests/testURLScheme.h \ tests/testMain.cc \ + tests/stub_main_cc.cc \ time.cc \ BodyPipe.cc \ cache_manager.cc \ diff --git a/src/tests/stub_main_cc.cc b/src/tests/stub_main_cc.cc new file mode 100644 index 0000000000..24f4fad0ce --- /dev/null +++ b/src/tests/stub_main_cc.cc @@ -0,0 +1,47 @@ +/* + * $Id$ + * + * AUTHOR: Francesco Chemolli + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + * Stubs for calls to stuff defined in main.cc + * + */ + +void +shut_down(int) +{ /* stub */ } + +void +reconfigure(int) +{ /* stub */ } + +void +rotate_logs(int) +{ /* stub */ } + diff --git a/src/tests/testCacheManager.cc b/src/tests/testCacheManager.cc index 035e587daa..39d9d806a1 100644 --- a/src/tests/testCacheManager.cc +++ b/src/tests/testCacheManager.cc @@ -11,17 +11,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testCacheManager ); -/* stub functions to link successfully */ -void -shut_down(int) -{} - -void -reconfigure(int) -{} - -/* end stubs */ - /* init memory pools */ void testCacheManager::setUp() diff --git a/src/tests/testEvent.cc b/src/tests/testEvent.cc index e0b54bbe52..57fb0a3df4 100644 --- a/src/tests/testEvent.cc +++ b/src/tests/testEvent.cc @@ -12,17 +12,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testEvent ); -/* stub functions to link successfully */ -void -shut_down(int) -{} - -void -reconfigure(int) -{} - -/* end stubs */ - /* init legacy static-initialized modules */ void diff --git a/src/tests/testEventLoop.cc b/src/tests/testEventLoop.cc index b490ad8e1d..03412038d2 100644 --- a/src/tests/testEventLoop.cc +++ b/src/tests/testEventLoop.cc @@ -15,17 +15,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testEventLoop ); -/* stub functions to link successfully */ -void -shut_down(int) -{} - -void -reconfigure(int) -{} - -/* end stubs */ - /* init legacy static-initialized modules */ void diff --git a/src/tests/testHttpRequest.cc b/src/tests/testHttpRequest.cc index ae1e8bc873..841b1cf225 100644 --- a/src/tests/testHttpRequest.cc +++ b/src/tests/testHttpRequest.cc @@ -17,17 +17,6 @@ public: bool doSanityCheckStartLine(MemBuf *b, const size_t h, http_status *e) { return sanityCheckStartLine(b,h,e); }; }; -/* stub functions to link successfully */ -void -shut_down(int) -{} - -void -reconfigure(int) -{} - -/* end stubs */ - /* init memory pools */ void diff --git a/src/tests/testURL.cc b/src/tests/testURL.cc index 371eda69d4..aba0f174c4 100644 --- a/src/tests/testURL.cc +++ b/src/tests/testURL.cc @@ -13,17 +13,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testURL ); -/* stub functions to link successfully */ -void -shut_down(int) -{} - -void -reconfigure(int) -{} - -/* end stubs */ - /* init memory pools */ void diff --git a/src/tests/test_http_range.cc b/src/tests/test_http_range.cc index e106f8fe3a..02212f2312 100644 --- a/src/tests/test_http_range.cc +++ b/src/tests/test_http_range.cc @@ -49,15 +49,6 @@ #include "acl/Checklist.h" #endif -/* Stub routines */ -void -shut_down(int) -{} - -void -reconfigure(int) -{} - SQUIDCEXTERN void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str) { fatal ("dummy function\n"); -- 2.47.2