]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/stub_comm.cc
Renamed squid.h to squid-old.h and config.h to squid.h
[thirdparty/squid.git] / src / tests / stub_comm.cc
index 875c6ead12d2910db50d224662958eaaf9c2200d..272949ce395be844b10b9fac086c9a9514594c22 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stub_comm.cc,v 1.7 2008/02/26 00:19:59 rousskov Exp $
+ * $Id$
  *
  * DEBUG: section 84    Helper process maintenance
  * AUTHOR: Robert Collins
 
 #include "squid.h"
 #include "comm.h"
-#include "CommRead.h"
+#include "comm/Connection.h"
+#include "comm/Loops.h"
 #include "fde.h"
 
-DeferredReadManager::~DeferredReadManager()
-{
-    /* no networked tests yet */
-}
-
-DeferredRead::DeferredRead (DeferrableRead *, void *, CommRead const &)
-{
-    fatal ("Not implemented");
-}
-
-void
-DeferredReadManager::delayRead(DeferredRead const &aRead)
-{
-    fatal ("Not implemented");
-}
-
-void
-DeferredReadManager::kickReads(int const count)
-{
-    fatal ("Not implemented");
-}
-
-void
-comm_read(int fd, char *buf, int size, IOCB *handler, void *handler_data)
-{
-    fatal ("Not implemented");
-}
+#define STUB_API "comm.cc"
+#include "tests/STUB.h"
 
-void
-comm_read(int, char*, int, AsyncCall::Pointer &callback)
-{
-    fatal ("Not implemented");
-}
+void comm_read(const Comm::ConnectionPointer &conn, char *buf, int size, IOCB *handler, void *handler_data) STUB
+void comm_read(const Comm::ConnectionPointer &conn, char*, int, AsyncCall::Pointer &callback) STUB
 
 /* should be in stub_CommRead */
 #include "CommRead.h"
-CommRead::CommRead (int fd, char *buf, int len, AsyncCall::Pointer &callback)
-{
-    fatal ("Not implemented");
-}
-
-CommRead::CommRead ()
-{
-    fatal ("Not implemented");
-}
-
-void
-commSetCloseOnExec(int fd)
-{
-    /* for tests... ignore */
-}
-
-void
-commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
-              time_t timeout)
-{
-    /* all test code runs synchronously at the moment */
-}
-
-void
-comm_quick_poll_required()
-{
-  /* for tests ... ignore */
-}
-
-int
-ignoreErrno(int ierrno)
-{
-    fatal ("Not implemented");
-    return -1;
-}
-
-int
-commSetTimeout(int fd, int timeout, PF * handler, void *data)
-{
-    fatal ("Not implemented");
-    return -1;
-}
-
-int
-commSetNonBlocking(int fd)
-{
-    fatal ("Not implemented");
-    return COMM_ERROR;
-}
-
-int
-commUnsetNonBlocking(int fd)
-{
-    fatal ("Not implemented");
-    return -1;
-}
-
-/* bah, cheating on stub count */
-
-pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IPAddress &local_addr, int *rfd, int *wfd, void **hIpc)
-{
-    fatal ("Not implemented");
-    return -1;
-}
-
-void
-comm_init(void)
-{
-    fd_table =(fde *) xcalloc(Squid_MaxFD, sizeof(fde));
-
-    /* Keep a few file descriptors free so that we don't run out of FD's
-     * after accepting a client but before it opens a socket or a file.
-     * Since Squid_MaxFD can be as high as several thousand, don't waste them */
-    RESERVED_FD = XMIN(100, Squid_MaxFD / 4);
-}
-
-/* MinGW needs also a stub of _comm_close() */
-void
-_comm_close(int fd, char const *file, int line)
-{
-    fatal ("Not implemented");
-}
+CommRead::CommRead(const Comm::ConnectionPointer &, char *buf, int len, AsyncCall::Pointer &callback) STUB
+CommRead::CommRead() STUB
+DeferredReadManager::~DeferredReadManager() STUB
+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
+int commSetNonBlocking(int fd) STUB_RETVAL(COMM_ERROR)
+int commUnsetNonBlocking(int fd) STUB_RETVAL(-1)
+
+// MinGW needs also a stub of _comm_close()
+void _comm_close(int fd, char const *file, int line) STUB
+int commSetTimeout(int fd, int timeout, AsyncCall::Pointer& callback) 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