]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/stub_tools.cc
Merge from trunk
[thirdparty/squid.git] / src / tests / stub_tools.cc
1 /*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #include "squid.h"
10 // XXX: need src/ to avoid clashes with ip/tools.h in testIpAddress
11 #include "src/tools.h"
12
13 #define STUB_API "tools.cc"
14 #include "tests/STUB.h"
15
16 int DebugSignal = -1;
17 SBuf service_name(APP_SHORTNAME);
18 void releaseServerSockets(void) STUB
19 char * dead_msg(void) STUB_RETVAL(NULL)
20 void mail_warranty(void) STUB
21 void dumpMallocStats(void) STUB
22 void squid_getrusage(struct rusage *r) STUB
23 double rusage_cputime(struct rusage *r) STUB_RETVAL(0)
24 int rusage_maxrss(struct rusage *r) STUB_RETVAL(0)
25 int rusage_pagefaults(struct rusage *r) STUB_RETVAL(0)
26 void PrintRusage(void) STUB
27 void death(int sig) STUB
28 void BroadcastSignalIfAny(int& sig) STUB
29 void sigusr2_handle(int sig) STUB
30 void debug_trap(const char *message) STUB
31 void sig_child(int sig) STUB
32 void sig_shutdown(int sig) STUB
33 const char * getMyHostname(void) STUB_RETVAL(NULL)
34 const char * uniqueHostname(void) STUB_RETVAL(NULL)
35 void leave_suid(void) STUB
36 void enter_suid(void) STUB
37 void no_suid(void) STUB
38
39 bool
40 IamMasterProcess()
41 {
42 //std::cerr << STUB_API << " IamMasterProcess() Not implemented\n";
43 // Since most tests run as a single process, this is the best default.
44 // TODO: If some test case uses multiple processes and cares about
45 // its role, we may need to parameterize or remove this stub.
46 return true;
47 }
48
49 bool
50 IamWorkerProcess()
51 {
52 //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n";
53 return true;
54 }
55
56 bool IamDiskProcess() STUB_RETVAL_NOP(false)
57 bool InDaemonMode() STUB_RETVAL_NOP(false)
58 bool UsingSmp() STUB_RETVAL_NOP(false)
59 bool IamCoordinatorProcess() STUB_RETVAL(false)
60 bool IamPrimaryProcess() STUB_RETVAL(false)
61 int NumberOfKids() STUB_RETVAL(0)
62
63 //not yet needed in the Stub, causes dependency on String
64 //String ProcessRoles() STUB_RETVAL(String())
65 void writePidFile(void) STUB
66 pid_t readPidFile(void) STUB_RETVAL(0)
67 void setMaxFD(void) STUB
68 void setSystemLimits(void) STUB
69 void squid_signal(int sig, SIGHDLR * func, int flags) STUB
70 void logsFlush(void) STUB
71 void kb_incr(kb_t * k, size_t v) STUB
72 void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm) STUB
73 void parseEtcHosts(void) STUB
74 int getMyPort(void) STUB_RETVAL(0)
75 void setUmask(mode_t mask) STUB
76 void strwordquote(MemBuf * mb, const char *str) STUB
77 void keepCapabilities(void) STUB
78 void restoreCapabilities(bool keep) STUB
79