From bf046f87c8d322939c6a883a405056003b8b1abd Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 5 Feb 2019 17:11:54 +0000 Subject: Delete the old broken test suite. This doesn't work properly and is disabled in both debug & release builds. It will be resurrected with a proper unit testing framework in the future. --- src/inspircd.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 09e48ea1f..94132cf95 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -47,7 +47,6 @@ #include #include "xline.h" #include "exitcodes.h" -#include "testsuite.h" InspIRCd* ServerInstance = NULL; @@ -78,13 +77,6 @@ const char* ExitCodes[] = "Received SIGTERM" // 10 }; -#ifdef INSPIRCD_ENABLE_TESTSUITE -/** True if we have been told to run the testsuite from the commandline, - * rather than entering the mainloop. - */ -static int do_testsuite = 0; -#endif - template static void DeleteZero(T*&n) { T* t = n; @@ -290,9 +282,6 @@ InspIRCd::InspIRCd(int argc, char** argv) : { "nopid", no_argument, &do_nopid, 1 }, { "runasroot", no_argument, &do_root, 1 }, { "version", no_argument, &do_version, 1 }, -#ifdef INSPIRCD_ENABLE_TESTSUITE - { "testsuite", no_argument, &do_testsuite, 1 }, -#endif { 0, 0, 0, 0 } }; @@ -330,11 +319,6 @@ InspIRCd::InspIRCd(int argc, char** argv) : } } -#ifdef INSPIRCD_ENABLE_TESTSUITE - if (do_testsuite) - do_nofork = do_debug = true; -#endif - if (do_version) { std::cout << std::endl << INSPIRCD_VERSION << std::endl; @@ -585,16 +569,6 @@ void InspIRCd::UpdateTime() void InspIRCd::Run() { -#ifdef INSPIRCD_ENABLE_TESTSUITE - /* See if we're supposed to be running the test suite rather than entering the mainloop */ - if (do_testsuite) - { - TestSuite* ts = new TestSuite; - delete ts; - return; - } -#endif - UpdateTime(); time_t OLDTIME = TIME.tv_sec; -- cgit v1.3.1-10-gc9f91 From 01451ab26ef427267effead17d526d2b20fd3e8b Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 5 Feb 2019 17:26:19 +0000 Subject: Quit users during cleanup instead of when /DIE is executed. --- src/coremods/core_oper/cmd_die.cpp | 9 --------- src/inspircd.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/coremods/core_oper/cmd_die.cpp b/src/coremods/core_oper/cmd_die.cpp index 8b80dd115..724db2f32 100644 --- a/src/coremods/core_oper/cmd_die.cpp +++ b/src/coremods/core_oper/cmd_die.cpp @@ -30,14 +30,6 @@ CommandDie::CommandDie(Module* parent, std::string& hashref) syntax = ""; } -static void QuitAll() -{ - const std::string quitmsg = "Server shutdown"; - const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); - while (!list.empty()) - ServerInstance->Users.QuitUser(list.front(), quitmsg); -} - void DieRestart::SendError(const std::string& message) { ClientProtocol::Messages::Error errormsg(message); @@ -70,7 +62,6 @@ CmdResult CommandDie::Handle(User* user, const Params& parameters) DieRestart::SendError(diebuf); } - QuitAll(); ServerInstance->Exit(EXIT_STATUS_DIE); } else diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 94132cf95..b6c252104 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -94,6 +94,12 @@ void InspIRCd::Cleanup() } ports.clear(); + // Disconnect all local users + const std::string quitmsg = "Server shutting down"; + const UserManager::LocalList& list = Users.GetLocalUsers(); + while (!list.empty()) + ServerInstance->Users.QuitUser(list.front(), quitmsg); + GlobalCulls.Apply(); Modules->UnloadAll(); -- cgit v1.3.1-10-gc9f91