]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix unit test linker issues in testHttpReply and testStore
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Jul 2014 23:17:16 +0000 (16:17 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Jul 2014 23:17:16 +0000 (16:17 -0700)
Also, update STUB files for comm.cc, event.cc, and libssl-squid.la

src/Makefile.am
src/tests/stub_comm.cc
src/tests/stub_event.cc
src/tests/stub_libsslsquid.cc
src/tests/testHttpReply.cc

index f37471e4db15f396f31fe2500ae9c427817a242f..c1f3baf9bdde09e04ea626641d369e6c91db82aa 100644 (file)
@@ -1148,6 +1148,8 @@ tests_testHttpReply_SOURCES=\
        HttpMsg.h \
        HttpReply.cc \
        HttpReply.h \
+       MasterXaction.cc \
+       MasterXaction.h \
        Mem.h \
        tests/stub_mem.cc \
        RegexList.h \
@@ -1174,12 +1176,17 @@ tests_testHttpReply_SOURCES=\
        YesNoNone.h \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
+       tests/stub_comm.cc \
        tests/stub_debug.cc \
        tests/stub_errorpage.cc \
+       tests/stub_event.cc \
+       tests/stub_fd.cc \
        tests/stub_HelperChildConfig.cc \
        tests/stub_libformat.cc \
        tests/stub_libauth.cc \
        tests/stub_libcomm.cc \
+       tests/stub_libmgr.cc \
+       tests/stub_libsslsquid.cc \
        StatCounters.h \
        StatCounters.cc \
        StatHist.h \
@@ -1201,6 +1208,7 @@ nodist_tests_testHttpReply_SOURCES=\
        $(TESTSOURCES)
 tests_testHttpReply_LDFLAGS = $(LIBADD_DL)
 tests_testHttpReply_LDADD=\
+       CommCalls.o \
        http/libsquid-http.la \
        acl/libacls.la \
        acl/libapi.la \
@@ -1208,7 +1216,7 @@ tests_testHttpReply_LDADD=\
        anyp/libanyp.la \
        ip/libip.la \
        base/libbase.la \
-       $(SSL_LIBS) \
+       ipc/libipc.la \
        $(top_builddir)/lib/libmisccontainers.la \
        $(top_builddir)/lib/libmiscencoding.la \
        $(top_builddir)/lib/libmiscutil.la \
@@ -2953,6 +2961,7 @@ tests_testStore_SOURCES= \
        tests/stub_libauth.cc \
        tests/stub_libeui.cc \
        tests/stub_libformat.cc \
+       tests/stub_libsslsquid.cc \
        HttpBody.h \
        HttpBody.cc \
        tests/stub_HttpReply.cc \
@@ -3007,7 +3016,6 @@ tests_testStore_LDADD= \
        ip/libip.la \
        fs/libfs.la \
        mgr/libmgr.la \
-       $(SSL_LIBS) \
        ipc/libipc.la \
        anyp/libanyp.la \
        $(top_builddir)/lib/libmisccontainers.la \
index 789c34bbc8e03e94c402ad6e4c20ef84b8fc3859..c16a7531ce824630d0c2246130ee23e0ff2cb12e 100644 (file)
@@ -1,37 +1,4 @@
-/*
- * DEBUG: section 84    Helper process maintenance
- * AUTHOR: Robert Collins
- *
- * 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.
- *
- */
-
 #include "squid.h"
-#include "comm.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
 #include "fde.h"
@@ -51,15 +18,45 @@ DeferredRead::DeferredRead(DeferrableRead *, void *, CommRead const &) STUB
 void DeferredReadManager::delayRead(DeferredRead const &aRead) STUB
 void DeferredReadManager::kickReads(int const count) STUB
 
-void commSetCloseOnExec(int fd) STUB_NOP
-int ignoreErrno(int ierrno) STUB_RETVAL(-1)
-
-void commUnsetFdTimeout(int fd) STUB
+#include "comm.h"
+bool comm_iocallbackpending(void) STUB_RETVAL(false)
 int commSetNonBlocking(int fd) STUB_RETVAL(Comm::COMM_ERROR)
 int commUnsetNonBlocking(int fd) STUB_RETVAL(-1)
-
-// MinGW needs also a stub of _comm_close()
+void commSetCloseOnExec(int fd) STUB_NOP
+void commSetTcpKeepalive(int fd, int idle, int interval, int timeout) STUB
 void _comm_close(int fd, char const *file, int line) STUB
-int commSetTimeout(int fd, int timeout, AsyncCall::Pointer& callback) STUB_RETVAL(-1)
+void old_comm_reset_close(int fd) STUB
+void comm_reset_close(const Comm::ConnectionPointer &conn) STUB
+#if LINGERING_CLOSE
+void comm_lingering_close(int fd) STUB
+#endif
+int comm_connect_addr(int sock, const Ip::Address &addr) STUB_RETVAL(-1)
+void comm_init(void) STUB
+void comm_exit(void) STUB
+int comm_open(int, int, Ip::Address &, int, const char *note) STUB_RETVAL(-1)
 int comm_open_uds(int sock_type, int proto, struct sockaddr_un* addr, int flags) STUB_RETVAL(-1)
-void comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func) STUB
+void comm_import_opened(const Comm::ConnectionPointer &, const char *note, struct addrinfo *AI) STUB
+int comm_open_listener(int sock_type, int proto, Ip::Address &addr, int flags, const char *note) STUB_RETVAL(-1)
+void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note) STUB
+int comm_openex(int, int, Ip::Address &, int, tos_t tos, nfmark_t nfmark, const char *) STUB_RETVAL(-1)
+unsigned short comm_local_port(int fd) STUB_RETVAL(0)
+int comm_udp_sendto(int sock, const Ip::Address &to, const void *buf, int buflen) STUB_RETVAL(-1)
+void commCallCloseHandlers(int fd) STUB
+void commUnsetFdTimeout(int fd) STUB
+int commSetTimeout(const Comm::ConnectionPointer &, int, AsyncCall::Pointer&) STUB_RETVAL(-1)
+int commSetConnTimeout(const Comm::ConnectionPointer &conn, int seconds, AsyncCall::Pointer &callback) STUB_RETVAL(-1)
+int commUnsetConnTimeout(const Comm::ConnectionPointer &conn) STUB_RETVAL(-1)
+int ignoreErrno(int ierrno) STUB_RETVAL(-1)
+void commCloseAllSockets(void) STUB
+void checkTimeouts(void) STUB
+void comm_add_close_handler(int fd, CLCB *, void *) STUB
+void comm_add_close_handler(int fd, AsyncCall::Pointer &) STUB
+void comm_remove_close_handler(int fd, CLCB *, void *) STUB
+void comm_remove_close_handler(int fd, AsyncCall::Pointer &)STUB
+int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, Ip::Address &from) STUB_RETVAL(-1)
+int comm_udp_recv(int fd, void *buf, size_t len, int flags) STUB_RETVAL(-1)
+ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags) STUB_RETVAL(-1)
+bool comm_has_incomplete_write(int) STUB_RETVAL(false)
+void commStartHalfClosedMonitor(int fd) STUB
+bool commHasHalfClosedMonitor(int fd) STUB_RETVAL(false)
+int CommSelectEngine::checkEvents(int timeout) STUB_RETVAL(0)
index 8c02f711bbf50734441a3da7c1d905b2db8efcea..ae8b0f7b0f912a5022a517ea93cabaf64a300b1b 100644 (file)
@@ -4,7 +4,7 @@
 #define STUB_API "event.cc"
 #include "tests/STUB.h"
 
-void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata) STUB
+void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata) STUB_NOP
 void eventAddIsh(const char *name, EVH * func, void *arg, double delta_ish, int) STUB
 void eventDelete(EVH * func, void *arg) STUB
 void eventInit(void) STUB
index 6a3adc387f292f5c53a1dd4966287672074b140b..8cf71d73efac0b905a2911142085b0c18f14666c 100644 (file)
@@ -40,20 +40,47 @@ Ssl::ErrorDetail::ErrorDetail(ErrorDetail const &) STUB
 const String & Ssl::ErrorDetail::toString() const STUB_RETSTATREF(String)
 
 #include "ssl/support.h"
-SSL_CTX *sslCreateServerContext(AnyP::PortCfg &) STUB_RETVAL(NULL)
+namespace Ssl
+{
+//CertError::CertError(ssl_error_t anErr, X509 *aCert) STUB
+//CertError::CertError(CertError const &err) STUB
+CertError & CertError::operator = (const CertError &old) STUB_RETVAL(*this)
+bool CertError::operator == (const CertError &ce) const STUB_RETVAL(false)
+bool CertError::operator != (const CertError &ce) const STUB_RETVAL(false)
+} // namespace Ssl
+SSL_CTX *sslCreateServerContext(AnyP::PortCfg &port) STUB_RETVAL(NULL)
 SSL_CTX *sslCreateClientContext(const char *certfile, const char *keyfile, int version, const char *cipher, const char *options, const char *flags, const char *CAfile, const char *CApath, const char *CRLfile) STUB_RETVAL(NULL)
 int ssl_read_method(int, char *, int) STUB_RETVAL(0)
 int ssl_write_method(int, const char *, int) STUB_RETVAL(0)
-void ssl_shutdown_method(SSL *) STUB
+void ssl_shutdown_method(SSL *ssl) STUB
 const char *sslGetUserEmail(SSL *ssl) STUB_RETVAL(NULL)
-// typedef char const *Ssl::GETATTRIBUTE(X509 *, const char *);
-// Ssl::GETATTRIBUTE Ssl::GetX509UserAttribute;
-// Ssl::GETATTRIBUTE Ssl::GetX509CAAttribute;
+const char *sslGetUserAttribute(SSL *ssl, const char *attribute_name) STUB_RETVAL(NULL)
+const char *sslGetCAAttribute(SSL *ssl, const char *attribute_name) STUB_RETVAL(NULL)
 const char *sslGetUserCertificatePEM(SSL *ssl) STUB_RETVAL(NULL)
 const char *sslGetUserCertificateChainPEM(SSL *ssl) STUB_RETVAL(NULL)
-SSL_CTX * Ssl::generateSslContext(CertificateProperties const &properties, AnyP::PortCfg &) STUB_RETVAL(NULL)
-SSL_CTX * Ssl::generateSslContextUsingPkeyAndCertFromMemory(const char * data, AnyP::PortCfg &) STUB_RETVAL(NULL)
-int Ssl::matchX509CommonNames(X509 *peer_cert, void *check_data, int (*check_func)(void *check_data,  ASN1_STRING *cn_data)) STUB_RETVAL(0)
-int Ssl::asn1timeToString(ASN1_TIME *tm, char *buf, int len) STUB_RETVAL(0)
+namespace Ssl
+{
+//GETX509ATTRIBUTE GetX509UserAttribute;
+//GETX509ATTRIBUTE GetX509CAAttribute;
+//GETX509ATTRIBUTE GetX509Fingerprint;
+const char *BumpModeStr[] = {""};
+long parse_flags(const char *flags) STUB_RETVAL(0)
+long parse_options(const char *options) STUB_RETVAL(0)
+STACK_OF(X509_CRL) *loadCrl(const char *CRLFile, long &flags) STUB_RETVAL(NULL)
+DH *readDHParams(const char *dhfile) STUB_RETVAL(NULL)
+ContextMethod contextMethod(int version) STUB_RETVAL(ContextMethod())
+bool generateUntrustedCert(X509_Pointer & untrustedCert, EVP_PKEY_Pointer & untrustedPkey, X509_Pointer const & cert, EVP_PKEY_Pointer const & pkey) STUB_RETVAL(false)
+SSL_CTX * generateSslContext(CertificateProperties const &properties, AnyP::PortCfg &port) STUB_RETVAL(NULL)
+bool verifySslCertificate(SSL_CTX * sslContext,  CertificateProperties const &properties) STUB_RETVAL(false)
+SSL_CTX * generateSslContextUsingPkeyAndCertFromMemory(const char * data, AnyP::PortCfg &port) STUB_RETVAL(NULL)
+void addChainToSslContext(SSL_CTX *sslContext, STACK_OF(X509) *certList) STUB
+void readCertChainAndPrivateKeyFromFiles(X509_Pointer & cert, EVP_PKEY_Pointer & pkey, X509_STACK_Pointer & chain, char const * certFilename, char const * keyFilename) STUB
+int matchX509CommonNames(X509 *peer_cert, void *check_data, int (*check_func)(void *check_data,  ASN1_STRING *cn_data)) STUB_RETVAL(0)
+bool checkX509ServerValidity(X509 *cert, const char *server) STUB_RETVAL(false)
+int asn1timeToString(ASN1_TIME *tm, char *buf, int len) STUB_RETVAL(0)
+bool setClientSNI(SSL *ssl, const char *fqdn) STUB_RETVAL(false)
+void initialize_session_cache() STUB
+void destruct_session_cache() STUB
+} //namespace Ssl
 
 #endif
index d3c378b957fe2c3e5554c9197e11c7bd8fcabdc1..18503f021dd0c5ec473a2bd2f5a828b2be2c0b60 100644 (file)
@@ -22,15 +22,6 @@ MemObject::endOffset() const
     return 0;
 }
 
-#include "ConfigParser.h"
-
-void
-eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)
-{
-// CALLED as setUp no-op
-//    fatal("eventAdd. Not implemented.");
-}
-
 /* end */
 
 void