]> git.ipfire.org Git - thirdparty/squid.git/blame - src/tests/stub_tools.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / stub_tools.cc
CommitLineData
4e0938ef 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4e0938ef
AJ
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
f7f3304a 9#include "squid.h"
8b505ba9
AJ
10// XXX: need src/ to avoid clashes with ip/tools.h in testIpAddress
11#include "src/tools.h"
c8f4eac4 12
081edc2d
AJ
13#define STUB_API "tools.cc"
14#include "tests/STUB.h"
c8f4eac4 15
081edc2d 16int DebugSignal = -1;
8b505ba9 17SBuf service_name(APP_SHORTNAME);
e852298f 18void releaseServerSockets(void) STUB_NOP
081edc2d
AJ
19char * dead_msg(void) STUB_RETVAL(NULL)
20void mail_warranty(void) STUB
21void dumpMallocStats(void) STUB
22void squid_getrusage(struct rusage *r) STUB
23double rusage_cputime(struct rusage *r) STUB_RETVAL(0)
24int rusage_maxrss(struct rusage *r) STUB_RETVAL(0)
25int rusage_pagefaults(struct rusage *r) STUB_RETVAL(0)
26void PrintRusage(void) STUB
27void death(int sig) STUB
28void BroadcastSignalIfAny(int& sig) STUB
29void sigusr2_handle(int sig) STUB
081edc2d
AJ
30void debug_trap(const char *message) STUB
31void sig_child(int sig) STUB
081edc2d
AJ
32const char * getMyHostname(void) STUB_RETVAL(NULL)
33const char * uniqueHostname(void) STUB_RETVAL(NULL)
e852298f 34void leave_suid(void) STUB_NOP
081edc2d
AJ
35void enter_suid(void) STUB
36void no_suid(void) STUB
8822ebee 37
081edc2d
AJ
38bool
39IamMasterProcess()
8822ebee 40{
081edc2d
AJ
41 //std::cerr << STUB_API << " IamMasterProcess() Not implemented\n";
42 // Since most tests run as a single process, this is the best default.
43 // TODO: If some test case uses multiple processes and cares about
44 // its role, we may need to parameterize or remove this stub.
45 return true;
8822ebee 46}
d5d5493b
DK
47
48bool
49IamWorkerProcess()
50{
081edc2d 51 //std::cerr << STUB_API << " IamWorkerProcess() Not implemented\n";
d5d5493b
DK
52 return true;
53}
54
bd765fdc
FC
55bool IamDiskProcess() STUB_RETVAL_NOP(false)
56bool InDaemonMode() STUB_RETVAL_NOP(false)
57bool UsingSmp() STUB_RETVAL_NOP(false)
081edc2d
AJ
58bool IamCoordinatorProcess() STUB_RETVAL(false)
59bool IamPrimaryProcess() STUB_RETVAL(false)
60int NumberOfKids() STUB_RETVAL(0)
bd765fdc 61
1fdc4f42
AJ
62//not actually needed in the Stub, causes dependency on SBuf
63//SBuf ProcessRoles() STUB_RETVAL(SBuf())
081edc2d 64void writePidFile(void) STUB
dbf55289 65void removePidFile(void) STUB
081edc2d
AJ
66pid_t readPidFile(void) STUB_RETVAL(0)
67void setMaxFD(void) STUB
68void setSystemLimits(void) STUB
69void squid_signal(int sig, SIGHDLR * func, int flags) STUB
70void logsFlush(void) STUB
081edc2d
AJ
71void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm) STUB
72void parseEtcHosts(void) STUB
73int getMyPort(void) STUB_RETVAL(0)
74void setUmask(mode_t mask) STUB
75void strwordquote(MemBuf * mb, const char *str) STUB
76void keepCapabilities(void) STUB
ff2afd7f 77void restoreCapabilities(bool keep) STUB
dbf55289 78pid_t WaitForOnePid(pid_t pid, PidStatus &status, int flags) STUB_RETVAL(0)
f53969cc 79