Replace virtual with override where possible.

Using clang-tidy
This commit is contained in:
Alexey Sokolov
2015-12-08 20:51:50 +00:00
parent 79e979e5cd
commit 16a8c77737
59 changed files with 101 additions and 104 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class CAdminLogMod : public CModule {
openlog("znc", LOG_PID, LOG_DAEMON);
}
virtual ~CAdminLogMod() {
~CAdminLogMod() override {
Log("Logging ended.");
closelog();
}
+1 -1
View File
@@ -155,7 +155,7 @@ class CChanAttach : public CModule {
"", "List all entries");
}
virtual ~CChanAttach() {}
~CChanAttach() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
VCString vsChans;
+1 -1
View File
@@ -36,7 +36,7 @@ class CAutoCycleMod : public CModule {
m_recentlyCycled.SetTTL(15 * 1000);
}
virtual ~CAutoCycleMod() {}
~CAutoCycleMod() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
VCString vsChans;
+2 -2
View File
@@ -33,7 +33,7 @@ class CAutoOpTimer : public CTimer {
m_pParent = pModule;
}
virtual ~CAutoOpTimer() {}
~CAutoOpTimer() override {}
private:
protected:
@@ -195,7 +195,7 @@ class CAutoOpMod : public CModule {
return true;
}
virtual ~CAutoOpMod() {
~CAutoOpMod() override {
for (const auto& it : m_msUsers) {
delete it.second;
}
+1 -1
View File
@@ -31,7 +31,7 @@ class CAutoReplyMod : public CModule {
m_Messaged.SetTTL(1000 * 120);
}
virtual ~CAutoReplyMod() {}
~CAutoReplyMod() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
if (!sArgs.empty()) {
+1 -1
View File
@@ -163,7 +163,7 @@ class CAutoVoiceMod : public CModule {
return true;
}
virtual ~CAutoVoiceMod() {
~CAutoVoiceMod() override {
for (const auto& it : m_msUsers) {
delete it.second;
}
+2 -2
View File
@@ -49,7 +49,7 @@ class CAwayJob : public CTimer {
const CString& sLabel, const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CAwayJob() {}
~CAwayJob() override {}
protected:
void RunJob() override;
@@ -250,7 +250,7 @@ class CAway : public CModule {
static_cast<CModCommand::ModCmdFunc>(&CAway::TimerCommand));
}
virtual ~CAway() {
~CAway() override {
if (!m_bBootError) SaveBufferToDisk();
}
+1 -1
View File
@@ -27,7 +27,7 @@ class CBlockMotd : public CModule {
"specify which server to query.");
}
virtual ~CBlockMotd() {}
~CBlockMotd() override {}
void OverrideCommand(const CString& sLine) {
m_bTemporaryAcceptMotd = true;
+1 -1
View File
@@ -36,7 +36,7 @@ class CBlockUser : public CModule {
"<user>", "Unblock a user");
}
virtual ~CBlockUser() {}
~CBlockUser() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
VCString vArgs;
+2 -2
View File
@@ -30,7 +30,7 @@ class CDCCBounce : public CSocket {
unsigned short uPort, const CString& sRemoteNick,
const CString& sRemoteIP, const CString& sFileName,
int iTimeout = 60, bool bIsChat = false);
virtual ~CDCCBounce();
~CDCCBounce() override;
static unsigned short DCCRequest(const CString& sNick,
unsigned long uLongIP,
@@ -158,7 +158,7 @@ class CBounceDCCMod : public CModule {
"<true|false>");
}
virtual ~CBounceDCCMod() {}
~CBounceDCCMod() override {}
CString GetLocalDCCIP() { return GetUser()->GetLocalDCCIP(); }
+1 -1
View File
@@ -23,7 +23,7 @@ class CBuffExtras : public CModule {
public:
MODCONSTRUCTOR(CBuffExtras) {}
virtual ~CBuffExtras() {}
~CBuffExtras() override {}
void AddBuffer(CChan& Channel, const CString& sMessage,
const timeval* tv = nullptr,
+1 -1
View File
@@ -57,7 +57,7 @@ class CCertMod : public CModule {
"Show the current certificate");
}
virtual ~CCertMod() {}
~CCertMod() override {}
CString PemFile() const { return GetSavePath() + "/user.pem"; }
+1 -1
View File
@@ -43,7 +43,7 @@ class CSSLClientCertMod : public CModule {
"", "Print your current key");
}
virtual ~CSSLClientCertMod() {}
~CSSLClientCertMod() override {}
bool OnBoot() override {
const vector<CListener*>& vListeners = CZNC::Get().GetListeners();
+1 -1
View File
@@ -22,7 +22,7 @@ class CChanSaverMod : public CModule {
public:
MODCONSTRUCTOR(CChanSaverMod) {}
virtual ~CChanSaverMod() {}
~CChanSaverMod() override {}
bool OnLoad(const CString& sArgsi, CString& sMessage) override {
switch (GetType()) {
+1 -1
View File
@@ -1557,7 +1557,7 @@ class CAdminMod : public CModule {
"[username]", "List all networks for a user");
}
virtual ~CAdminMod() {}
~CAdminMod() override {}
};
template <>
+1 -1
View File
@@ -67,7 +67,7 @@ class CCryptMod : public CModule {
"", "List all keys");
}
virtual ~CCryptMod() {}
~CCryptMod() override {}
EModRet OnUserMsg(CString& sTarget, CString& sMessage) override {
sTarget.TrimPrefix(NickPrefix());
+1 -1
View File
@@ -33,7 +33,7 @@ class CCtcpFloodMod : public CModule {
"", "Show the current limits");
}
~CCtcpFloodMod() {}
~CCtcpFloodMod() override {}
void Save() {
// We save the settings twice because the module arguments can
+1 -1
View File
@@ -50,7 +50,7 @@ class CSASLAuthMod : public CModule {
&CSASLAuthMod::DisableCloneUserCommand));
}
virtual ~CSASLAuthMod() { sasl_done(); }
~CSASLAuthMod() override { sasl_done(); }
void OnModCommand(const CString& sCommand) override {
if (GetUser()->IsAdmin()) {
+2 -2
View File
@@ -30,7 +30,7 @@ class CDCCSock : public CSocket {
CDCCSock(CDCCMod* pMod, const CString& sRemoteNick,
const CString& sRemoteIP, unsigned short uRemotePort,
const CString& sLocalFile, unsigned long uFileSize);
virtual ~CDCCSock();
~CDCCSock() override;
void ReadData(const char* data, size_t len) override;
void ConnectionRefused() override;
@@ -95,7 +95,7 @@ class CDCCMod : public CModule {
&CDCCMod::ListTransfersCommand));
}
virtual ~CDCCMod() {}
~CDCCMod() override {}
#ifndef MOD_DCC_ALLOW_EVERYONE
bool OnLoad(const CString& sArgs, CString& sMessage) override {
+1 -1
View File
@@ -38,7 +38,7 @@ class CFailToBanMod : public CModule {
&CFailToBanMod::OnListCommand),
"", "List banned hosts.");
}
virtual ~CFailToBanMod() {}
~CFailToBanMod() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
CString sTimeout = sArgs.Token(0);
+1 -1
View File
@@ -41,7 +41,7 @@ class CFloodDetachMod : public CModule {
"[yes|no]");
}
~CFloodDetachMod() {}
~CFloodDetachMod() override {}
void Save() {
// We save the settings twice because the module arguments can
+1 -1
View File
@@ -44,7 +44,7 @@ class CIdentFileModule : public CModule {
m_pIRCSock = nullptr;
}
virtual ~CIdentFileModule() { ReleaseISpoof(); }
~CIdentFileModule() override { ReleaseISpoof(); }
void GetFile(const CString& sLine) {
PutModule("File is set to: " + GetNV("File"));
+2 -2
View File
@@ -30,7 +30,7 @@ class CIMAPSock : public CSocket {
EnableReadLine();
}
virtual ~CIMAPSock() {
~CIMAPSock() override {
if (!m_bSentReply) {
m_spAuth->RefuseLogin(
"IMAP server is down, please try again later");
@@ -56,7 +56,7 @@ class CIMAPAuthMod : public CModule {
m_bSSL = false;
}
virtual ~CIMAPAuthMod() {}
~CIMAPAuthMod() override {}
bool OnBoot() override { return true; }
+2 -2
View File
@@ -24,7 +24,7 @@ class CKeepNickMod;
class CKeepNickTimer : public CTimer {
public:
CKeepNickTimer(CKeepNickMod* pMod);
~CKeepNickTimer() {}
~CKeepNickTimer() override {}
void RunJob() override;
@@ -47,7 +47,7 @@ class CKeepNickMod : public CModule {
"", "Show the current state");
}
~CKeepNickMod() {}
~CKeepNickMod() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
m_pTimer = nullptr;
+2 -2
View File
@@ -31,7 +31,7 @@ class CRejoinJob : public CTimer {
const CString& sLabel, const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CRejoinJob() {}
~CRejoinJob() override {}
protected:
void RunJob() override {
@@ -60,7 +60,7 @@ class CRejoinMod : public CModule {
&CRejoinMod::OnShowDelayCommand),
"", "Show the rejoin delay");
}
virtual ~CRejoinMod() {}
~CRejoinMod() override {}
bool OnLoad(const CString& sArgs, CString& sErrorMsg) override {
if (sArgs.empty()) {
+1 -1
View File
@@ -77,7 +77,7 @@ class CLastSeenMod : public CModule {
"", "Shows list of users and when they last logged in");
}
virtual ~CLastSeenMod() {}
~CLastSeenMod() override {}
// Event stuff:
+1 -1
View File
@@ -245,7 +245,7 @@ class CListSockets : public CModule {
return;
}
virtual ~CListSockets() {}
~CListSockets() override {}
};
template <>
+6 -7
View File
@@ -118,10 +118,9 @@ class CModPerl : public CModule {
return true;
}
virtual EModRet OnModuleLoading(const CString& sModName,
const CString& sArgs,
CModInfo::EModuleType eType, bool& bSuccess,
CString& sRetMsg) override {
EModRet OnModuleLoading(const CString& sModName, const CString& sArgs,
CModInfo::EModuleType eType, bool& bSuccess,
CString& sRetMsg) override {
EModRet result = HALT;
PSTART;
PUSH_STR(sModName);
@@ -192,8 +191,8 @@ class CModPerl : public CModule {
return CONTINUE;
}
virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg) override {
EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg) override {
PSTART;
PUSH_STR(sModule);
PUSH_PTR(CModInfo*, &ModInfo);
@@ -268,7 +267,7 @@ class CModPerl : public CModule {
}
}
virtual ~CModPerl() {
~CModPerl() override {
if (m_pPerl) {
PSTART;
PCALL("ZNC::Core::UnloadAll");
+6 -7
View File
@@ -146,10 +146,9 @@ class CModPython : public CModule {
return true;
}
virtual EModRet OnModuleLoading(const CString& sModName,
const CString& sArgs,
CModInfo::EModuleType eType, bool& bSuccess,
CString& sRetMsg) override {
EModRet OnModuleLoading(const CString& sModName, const CString& sArgs,
CModInfo::EModuleType eType, bool& bSuccess,
CString& sRetMsg) override {
PyObject* pyFunc = PyObject_GetAttrString(m_PyZNCModule, "load_module");
if (!pyFunc) {
sRetMsg = GetPyExceptionStr();
@@ -240,8 +239,8 @@ class CModPython : public CModule {
return CONTINUE;
}
virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg) override {
EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg) override {
PyObject* pyFunc =
PyObject_GetAttrString(m_PyZNCModule, "get_mod_info");
if (!pyFunc) {
@@ -361,7 +360,7 @@ class CModPython : public CModule {
}
}
virtual ~CModPython() {
~CModPython() override {
if (!m_PyZNCModule) {
DEBUG(
"~CModPython(): seems like CModPython::OnLoad() didn't "
+3 -3
View File
@@ -44,7 +44,7 @@ class CModTclTimer : public CTimer {
const CString& sLabel, const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription),
m_pParent(nullptr) {}
virtual ~CModTclTimer() {}
~CModTclTimer() override {}
protected:
void RunJob() override;
@@ -58,7 +58,7 @@ class CModTclStartTimer : public CTimer {
const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription),
m_pParent(nullptr) {}
virtual ~CModTclStartTimer() {}
~CModTclStartTimer() override {}
protected:
void RunJob() override;
@@ -69,7 +69,7 @@ class CModTcl : public CModule {
public:
MODCONSTRUCTOR(CModTcl) { interp = nullptr; }
virtual ~CModTcl() {
~CModTcl() override {
if (interp) {
Tcl_DeleteInterp(interp);
}
+1 -1
View File
@@ -21,7 +21,7 @@
class CFOModule : public CModule {
public:
MODCONSTRUCTOR(CFOModule) {}
virtual ~CFOModule() {}
~CFOModule() override {}
bool IsOnlineModNick(const CString& sNick) {
const CString& sPrefix = GetUser()->GetStatusPrefix();
+1 -1
View File
@@ -81,7 +81,7 @@ class CNickServ : public CModule {
"cmd new-pattern", "Set pattern for commands");
}
virtual ~CNickServ() {}
~CNickServ() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
if (!sArgs.empty() && sArgs != "<hidden>") {
+1 -1
View File
@@ -87,7 +87,7 @@ class CNotesMod : public CModule {
[this](const CString& sLine) { GetCommand(sLine); });
}
virtual ~CNotesMod() {}
~CNotesMod() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
m_bShowNotesOnLogin = !sArgs.Equals("-disableNotesOnLogin");
+1 -1
View File
@@ -84,7 +84,7 @@ class CPartylineMod : public CModule {
"", "List all open channels");
}
virtual ~CPartylineMod() {
~CPartylineMod() override {
// Kick all clients who are in partyline channels
for (set<CPartylineChannel*>::iterator it = m_ssChannels.begin();
it != m_ssChannels.end(); ++it) {
+1 -1
View File
@@ -107,7 +107,7 @@ class CPerform : public CModule {
"<number> <number>", "Swap two perform commands");
}
virtual ~CPerform() {}
~CPerform() override {}
CString ParsePerform(const CString& sArg) const {
CString sPerf = sArg;
+1 -1
View File
@@ -28,7 +28,7 @@ using std::set;
class CQModule : public CModule {
public:
MODCONSTRUCTOR(CQModule) {}
virtual ~CQModule() {}
~CQModule() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
if (!sArgs.empty()) {
+1 -1
View File
@@ -19,7 +19,7 @@
class CRawMod : public CModule {
public:
MODCONSTRUCTOR(CRawMod) {}
virtual ~CRawMod() {}
~CRawMod() override {}
EModRet OnRaw(CString& sLine) override {
PutModule("IRC -> [" + sLine + "]");
+2 -2
View File
@@ -186,7 +186,7 @@ class CRouteTimeout : public CTimer {
unsigned int uCycles, const CString& sLabel,
const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CRouteTimeout() {}
~CRouteTimeout() override {}
protected:
void RunJob() override;
@@ -212,7 +212,7 @@ class CRouteRepliesMod : public CModule {
"Decides whether to show the timeout messages or not");
}
virtual ~CRouteRepliesMod() {
~CRouteRepliesMod() override {
requestQueue::iterator it;
while (!m_vsPending.empty()) {
+3 -3
View File
@@ -26,7 +26,7 @@ class CSampleJob : public CModuleJob {
CSampleJob(CModule* pModule)
: CModuleJob(pModule, "sample", "Message the user after a delay") {}
~CSampleJob() {
~CSampleJob() override {
if (wasCancelled()) {
GetModule()->PutModule("Sample job cancelled");
} else {
@@ -55,7 +55,7 @@ class CSampleTimer : public CTimer {
CSampleTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles,
const CString& sLabel, const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CSampleTimer() {}
~CSampleTimer() override {}
private:
protected:
@@ -78,7 +78,7 @@ class CSampleMod : public CModule {
return true;
}
virtual ~CSampleMod() { PutModule("I'm being unloaded!"); }
~CSampleMod() override { PutModule("I'm being unloaded!"); }
bool OnBoot() override {
// This is called when the app starts up (only modules that are loaded
+2 -2
View File
@@ -50,7 +50,7 @@ class CSaveBuffJob : public CTimer {
const CString& sLabel, const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CSaveBuffJob() {}
~CSaveBuffJob() override {}
protected:
void RunJob() override;
@@ -72,7 +72,7 @@ class CSaveBuff : public CModule {
&CSaveBuff::OnSaveCommand),
"", "Saves all buffers");
}
virtual ~CSaveBuff() {
~CSaveBuff() override {
if (!m_bBootError) {
SaveBuffersToDisk();
}
+3 -3
View File
@@ -40,7 +40,7 @@ class CRemMarkerJob : public CTimer {
const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CRemMarkerJob() {}
~CRemMarkerJob() override {}
void SetNick(const CString& sNick) { m_sNick = sNick; }
protected:
@@ -53,7 +53,7 @@ class CSChatSock : public CSocket {
CSChatSock(CSChat* pMod, const CString& sChatNick);
CSChatSock(CSChat* pMod, const CString& sChatNick, const CString& sHost,
u_short iPort, int iTimeout = 60);
~CSChatSock() {}
~CSChatSock() override {}
Csock* GetSockObj(const CS_STRING& sHostname, u_short iPort) override {
CSChatSock* p =
@@ -104,7 +104,7 @@ class CSChatSock : public CSocket {
class CSChat : public CModule {
public:
MODCONSTRUCTOR(CSChat) {}
virtual ~CSChat() {}
~CSChat() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
m_sPemFile = sArgs;
+1 -1
View File
@@ -66,7 +66,7 @@ class CSendRaw_Mod : public CModule {
}
public:
virtual ~CSendRaw_Mod() {}
~CSendRaw_Mod() override {}
bool OnLoad(const CString& sArgs, CString& sErrorMsg) override {
if (!GetUser()->IsAdmin()) {
+1 -1
View File
@@ -59,7 +59,7 @@ class CShellMod : public CModule {
public:
MODCONSTRUCTOR(CShellMod) { m_sPath = CZNC::Get().GetHomePath(); }
virtual ~CShellMod() {
~CShellMod() override {
vector<Csock*> vSocks = GetManager()->FindSocksByName("SHELL");
for (unsigned int a = 0; a < vSocks.size(); a++) {
+2 -2
View File
@@ -30,7 +30,7 @@ class CSimpleAwayJob : public CTimer {
const CString& sDescription)
: CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
virtual ~CSimpleAwayJob() {}
~CSimpleAwayJob() override {}
protected:
void RunJob() override;
@@ -76,7 +76,7 @@ class CSimpleAway : public CModule {
"", "Get or set the minimum number of clients before going away");
}
virtual ~CSimpleAway() {}
~CSimpleAway() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override {
CString sReasonArg;
+3 -4
View File
@@ -33,7 +33,7 @@ class CStickyChan : public CModule {
&CStickyChan::OnListCommand),
"", "Lists sticky channels");
}
virtual ~CStickyChan() {}
~CStickyChan() override {}
bool OnLoad(const CString& sArgs, CString& sMessage) override;
@@ -56,9 +56,8 @@ class CStickyChan : public CModule {
return CONTINUE;
}
virtual void OnMode(const CNick& pOpNick, CChan& Channel, char uMode,
const CString& sArg, bool bAdded,
bool bNoChange) override {
void OnMode(const CNick& pOpNick, CChan& Channel, char uMode,
const CString& sArg, bool bAdded, bool bNoChange) override {
if (uMode == CChan::M_Key) {
if (bAdded) {
// We ignore channel key "*" because of some broken nets.
+1 -1
View File
@@ -177,7 +177,7 @@ class CWatcherMod : public CModule {
Load();
}
virtual ~CWatcherMod() {}
~CWatcherMod() override {}
void OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes,
const CString& sArgs) override {
+1 -1
View File
@@ -97,7 +97,7 @@ class CWebAdminMod : public CModule {
CWebSubPage::F_ADMIN));
}
virtual ~CWebAdminMod() {}
~CWebAdminMod() override {}
bool OnLoad(const CString& sArgStr, CString& sMessage) override {
if (sArgStr.empty() || CModInfo::GlobalModule != GetType()) return true;
+2 -2
View File
@@ -39,7 +39,7 @@ class CIRCNetworkPingTimer : public CCron {
Start(CIRCNetwork::PING_SLACK);
}
virtual ~CIRCNetworkPingTimer() {}
~CIRCNetworkPingTimer() override {}
CIRCNetworkPingTimer(const CIRCNetworkPingTimer&) = delete;
CIRCNetworkPingTimer& operator=(const CIRCNetworkPingTimer&) = delete;
@@ -77,7 +77,7 @@ class CIRCNetworkJoinTimer : public CCron {
Start(CIRCNetwork::JOIN_FREQUENCY);
}
virtual ~CIRCNetworkJoinTimer() {}
~CIRCNetworkJoinTimer() override {}
CIRCNetworkJoinTimer(const CIRCNetworkJoinTimer&) = delete;
CIRCNetworkJoinTimer& operator=(const CIRCNetworkJoinTimer&) = delete;
+1 -1
View File
@@ -34,7 +34,7 @@ class CUserTimer : public CCron {
SetName("CUserTimer::" + m_pUser->GetUserName());
Start(CIRCNetwork::PING_SLACK);
}
virtual ~CUserTimer() {}
~CUserTimer() override {}
CUserTimer(const CUserTimer&) = delete;
CUserTimer& operator=(const CUserTimer&) = delete;
+2 -2
View File
@@ -416,7 +416,7 @@ inline CString FixGMT(CString sTZ) {
}
return sTZ;
}
}
} // namespace
CString CUtils::CTime(time_t t, const CString& sTimezone) {
char s[30] = {}; // should have at least 26 bytes
@@ -537,7 +537,7 @@ void FillTimezones(const CString& sPath, SCString& result,
}
}
}
}
} // namespace
SCString CUtils::GetTimezones() {
static SCString result;
+1 -1
View File
@@ -53,7 +53,7 @@ class CWebAuth : public CAuthBase {
public:
CWebAuth(CWebSock* pWebSock, const CString& sUsername,
const CString& sPassword, bool bBasic);
virtual ~CWebAuth() {}
~CWebAuth() override {}
CWebAuth(const CWebAuth&) = delete;
CWebAuth& operator=(const CWebAuth&) = delete;
+1 -1
View File
@@ -1929,7 +1929,7 @@ class CConnectQueueTimer : public CCron {
// Don't wait iSecs seconds for first timer run
m_bRunOnNextCall = true;
}
virtual ~CConnectQueueTimer() {
~CConnectQueueTimer() override {
// This is only needed when ZNC shuts down:
// CZNC::~CZNC() sets its CConnectQueueTimer pointer to nullptr and
// calls the manager's Cleanup() which destroys all sockets and
+2 -2
View File
@@ -24,8 +24,8 @@ using ::testing::ContainerEq;
class BufferTest : public ::testing::Test {
protected:
void SetUp() { CZNC::CreateInstance(); }
void TearDown() { CZNC::DestroyInstance(); }
void SetUp() override { CZNC::CreateInstance(); }
void TearDown() override { CZNC::DestroyInstance(); }
};
TEST_F(BufferTest, BufLine) {
+1 -1
View File
@@ -20,7 +20,7 @@
class CConfigTest : public ::testing::Test {
public:
virtual ~CConfigTest() { m_File.Delete(); }
~CConfigTest() override { m_File.Delete(); }
protected:
CFile& WriteFile(const CString& sConfig) {
+1 -1
View File
@@ -137,7 +137,7 @@ class Process : public IO<QProcess> {
m_proc.setProcessEnvironment(env);
m_proc.start(cmd, args);
}
~Process() {
~Process() override {
if (m_kill) m_proc.terminate();
[this]() {
ASSERT_TRUE(m_proc.waitForFinished());
+2 -2
View File
@@ -20,8 +20,8 @@
class ModulesTest : public ::testing::Test {
protected:
void SetUp() { CZNC::CreateInstance(); }
void TearDown() { CZNC::DestroyInstance(); }
void SetUp() override { CZNC::CreateInstance(); }
void TearDown() override { CZNC::DestroyInstance(); }
};
class CLegacyModule : public CModule {
+2 -2
View File
@@ -21,8 +21,8 @@
class NetworkTest : public ::testing::Test {
protected:
void SetUp() { CZNC::CreateInstance(); }
void TearDown() { CZNC::DestroyInstance(); }
void SetUp() override { CZNC::CreateInstance(); }
void TearDown() override { CZNC::DestroyInstance(); }
};
TEST_F(NetworkTest, FindChan) {
+2 -2
View File
@@ -25,8 +25,8 @@ using ::testing::MatchesRegex;
class QueryTest : public ::testing::Test {
protected:
void SetUp() { CZNC::CreateInstance(); }
void TearDown() { CZNC::DestroyInstance(); }
void SetUp() override { CZNC::CreateInstance(); }
void TearDown() override { CZNC::DestroyInstance(); }
};
TEST_F(QueryTest, Name) {
+9 -9
View File
@@ -27,7 +27,7 @@ class CWaitingJob : public CJob {
m_bThreadReady(false),
m_bThreadDone(false){};
~CWaitingJob() {
~CWaitingJob() override {
EXPECT_TRUE(m_bThreadReady);
EXPECT_TRUE(m_bThreadDone);
EXPECT_FALSE(wasCancelled());
@@ -44,7 +44,7 @@ class CWaitingJob : public CJob {
m_CV.notify_all();
}
virtual void runThread() {
void runThread() override {
CMutexLocker locker(m_Mutex);
// We are running
m_bThreadReady = true;
@@ -54,7 +54,7 @@ class CWaitingJob : public CJob {
while (!m_bThreadDone) m_CV.wait(m_Mutex);
}
virtual void runMain() {}
void runMain() override {}
private:
bool& m_bDestroyed;
@@ -82,7 +82,7 @@ class CCancelJob : public CJob {
m_CVThreadReady(),
m_bThreadReady(false) {}
~CCancelJob() {
~CCancelJob() override {
EXPECT_TRUE(wasCancelled());
m_bDestroyed = true;
}
@@ -93,7 +93,7 @@ class CCancelJob : public CJob {
while (!m_bThreadReady) m_CVThreadReady.wait(m_Mutex);
}
virtual void runThread() {
void runThread() override {
m_Mutex.lock();
// We are running, tell the main thread
m_bThreadReady = true;
@@ -113,7 +113,7 @@ class CCancelJob : public CJob {
}
}
virtual void runMain() {}
void runMain() override {}
private:
bool& m_bDestroyed;
@@ -152,13 +152,13 @@ class CEmptyJob : public CJob {
public:
CEmptyJob(bool& destroyed) : m_bDestroyed(destroyed) {}
~CEmptyJob() {
~CEmptyJob() override {
EXPECT_TRUE(wasCancelled());
m_bDestroyed = true;
}
virtual void runThread() {}
virtual void runMain() {}
void runThread() override {}
void runMain() override {}
private:
bool& m_bDestroyed;