From: Amos Jeffries Date: Tue, 23 May 2017 06:17:35 +0000 (+1200) Subject: Tests: Add stub_url.cc X-Git-Tag: M-staged-PR71~170 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c849cc50dd59d550b31b475158c9995f26cfbdc;p=thirdparty%2Fsquid.git Tests: Add stub_url.cc --- diff --git a/src/Makefile.am b/src/Makefile.am index c4ae896eec..0726ae63c5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -993,7 +993,7 @@ tests_testHttpReply_SOURCES=\ tests/testHttpReply.cc \ tests/testHttpReply.h \ tests/stub_time.cc \ - url.cc \ + tests/stub_url.cc \ wordlist.h \ wordlist.cc nodist_tests_testHttpReply_SOURCES=\ @@ -1114,7 +1114,7 @@ tests_testACLMaxUserIP_SOURCES= \ tests/testACLMaxUserIP.cc \ tests/testACLMaxUserIP.h \ tests/stub_time.cc \ - url.cc \ + tests/stub_url.cc \ URL.h \ MemBuf.cc \ wordlist.h \ @@ -1363,7 +1363,7 @@ tests_testCacheManager_SOURCES = \ tests/stub_SwapDir.cc \ MemStore.cc \ $(UNLINKDSOURCE) \ - url.cc \ + tests/stub_url.cc \ urn.h \ urn.cc \ wccp2.h \ @@ -1545,7 +1545,7 @@ tests_testDiskIO_SOURCES = \ tests/testStoreSupport.h \ tests/stub_time.cc \ $(UNLINKDSOURCE) \ - url.cc \ + tests/stub_url.cc \ $(WIN32_SOURCE) \ wordlist.h \ wordlist.cc \ @@ -1793,7 +1793,7 @@ tests_testEvent_SOURCES = \ tests/stub_tunnel.cc \ MemStore.cc \ $(UNLINKDSOURCE) \ - url.cc \ + tests/stub_url.cc \ urn.h \ urn.cc \ wccp2.h \ @@ -2027,7 +2027,7 @@ tests_testEventLoop_SOURCES = \ tests/stub_tunnel.cc \ MemStore.cc \ $(UNLINKDSOURCE) \ - url.cc \ + tests/stub_url.cc \ urn.h \ urn.cc \ wccp2.h \ @@ -2256,7 +2256,7 @@ tests_test_http_range_SOURCES = \ tools.cc \ tests/stub_tunnel.cc \ $(UNLINKDSOURCE) \ - url.cc \ + tests/stub_url.cc \ urn.h \ urn.cc \ wccp2.h \ @@ -2361,6 +2361,7 @@ tests_testHttp1Parser_SOURCES = \ tests/testHttp1Parser.cc \ tests/testHttp1Parser.h \ tests/stub_time.cc \ + tests/stub_url.cc \ wordlist.h \ wordlist.cc nodist_tests_testHttp1Parser_SOURCES = \ @@ -2791,7 +2792,7 @@ tests_testStore_SOURCES= \ tests/TestSwapDir.cc \ tests/TestSwapDir.h \ tests/stub_time.cc \ - url.cc \ + tests/stub_url.cc \ wordlist.h \ wordlist.cc @@ -2988,7 +2989,7 @@ tests_testUfs_SOURCES = \ HttpHdrCc.cc \ HttpHdrSc.cc \ HttpHdrScTarget.cc \ - url.cc \ + tests/stub_url.cc \ StatCounters.h \ StatCounters.cc \ StatHist.h \ @@ -3187,7 +3188,7 @@ tests_testRock_SOURCES = \ tools.h \ tests/stub_tools.cc \ time.cc \ - url.cc \ + tests/stub_url.cc \ wordlist.h \ wordlist.cc \ $(DELAY_POOL_SOURCE) \ diff --git a/src/tests/stub_url.cc b/src/tests/stub_url.cc new file mode 100644 index 0000000000..82319cf476 --- /dev/null +++ b/src/tests/stub_url.cc @@ -0,0 +1,43 @@ +/* + * Copyright (C) 1996-2014 The Squid Software Foundation and contributors + * + * Squid software is distributed under GPLv2+ license and includes + * contributions from numerous individuals and organizations. + * Please see the COPYING and CONTRIBUTORS files for details. + */ + +#include "squid.h" + +#define STUB_API "url.cc" +#include "tests/STUB.h" + +#include "URL.h" +URL::URL(AnyP::UriScheme const &) {STUB} +void URL::touch() STUB +void URL::host(const char *) STUB +static SBuf nil; +const SBuf &URL::path() const STUB_RETVAL(nil) +const SBuf &URL::SlashPath() +{ + static SBuf slash("/"); + return slash; +} +const SBuf &URL::Asterisk() +{ + static SBuf asterisk("*"); + return asterisk; +} +SBuf &URL::authority(bool) const STUB_RETVAL(nil) +SBuf &URL::absolute() const STUB_RETVAL(nil) +void urlInitialize() STUB +HttpRequest *urlParse(const HttpRequestMethod&, char *, HttpRequest *) STUB_RETVAL(nullptr) +char *urlCanonicalClean(const HttpRequest *) STUB_RETVAL(nullptr) +const char *urlCanonicalFakeHttps(const HttpRequest *) STUB_RETVAL(nullptr) +bool urlIsRelative(const char *) STUB_RETVAL(false) +char *urlMakeAbsolute(const HttpRequest *, const char *)STUB_RETVAL(nullptr) +char *urlRInternal(const char *, unsigned short, const char *, const char *) STUB_RETVAL(nullptr) +char *urlInternal(const char *, const char *) STUB_RETVAL(nullptr) +int matchDomainName(const char *, const char *, uint) STUB_RETVAL(0) +int urlCheckRequest(const HttpRequest *) STUB_RETVAL(0) +char *urlHostname(const char *) STUB_RETVAL(nullptr) +void urlExtMethodConfigure() STUB