diff options
author | Mattes D <github@xoft.cz> | 2016-06-19 14:57:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-19 14:57:14 +0200 |
commit | 5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7 (patch) | |
tree | 083bbf9029b971dbf7b74353c9c62c22de9c78c7 /src/SelfTests.cpp | |
parent | Merge pull request #3224 from QUSpilPrgm/master (diff) | |
parent | cNetwork: Fixed possible hang when terminating immediately after init. (diff) | |
download | cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.gz cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.bz2 cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.lz cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.xz cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.zst cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.zip |
Diffstat (limited to 'src/SelfTests.cpp')
-rw-r--r-- | src/SelfTests.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/SelfTests.cpp b/src/SelfTests.cpp deleted file mode 100644 index 7e35e675e..000000000 --- a/src/SelfTests.cpp +++ /dev/null @@ -1,71 +0,0 @@ - -// SelfTests.h - -// Implements the cSelfTests class representing the singleton used for registering self-tests -// This class is only declared if SELF_TEST macro is defined. - -#include "Globals.h" -#include "SelfTests.h" - - - - - -#ifdef SELF_TEST - cSelfTests::cSelfTests(void): - m_AllowRegistering(true) - { - } - - - - - - cSelfTests & cSelfTests::Get(void) - { - static cSelfTests singleton; - return singleton; - } - - - - - - void cSelfTests::Register(cSelfTests::SelfTestFunction a_FnToExecute, const AString & a_TestName) - { - ASSERT(Get().m_AllowRegistering); - Get().m_SelfTests.push_back(std::make_pair(a_FnToExecute, a_TestName)); - } - - - - - - void cSelfTests::ExecuteAll(void) - { - Get().m_AllowRegistering = false; - LOG("--- Performing self-tests ---"); - for (auto & test: Get().m_SelfTests) - { - LOG("Performing self-test: %s", test.second.c_str()); - try - { - test.first(); - } - catch (const std::exception & exc) - { - LOGWARNING("Exception in test %s: %s", test.second.c_str(), exc.what()); - } - catch (...) - { - LOGWARNING("Unknown exception in test %s", test.second.c_str()); - } - } // for test - m_SelfTests[] - LOG("--- Self-tests finished ---"); - } - -#endif // SELF_TEST - - - - |