Fix names in unittests

This commit is contained in:
momo5502 2016-09-16 11:04:28 +02:00
parent 503e071d7e
commit c2931a04e1
56 changed files with 67 additions and 57 deletions

View File

@ -19,5 +19,5 @@
| `--force-minidump-upload` | Upload minidumps even for Debug builds. | | `--force-minidump-upload` | Upload minidumps even for Debug builds. |
| `--disable-bitmessage` | Disable use of BitMessage completely. | | `--disable-bitmessage` | Disable use of BitMessage completely. |
| `--disable-node-log` | Disable debugging messages for Nodes in Debug builds. | | `--disable-node-log` | Disable debugging messages for Nodes in Debug builds. |
| `--disable-base128` | Disable debugging messages for Nodes in Debug builds. | | `--disable-base128` | Disable base128 encoding for minidumps. |
| `--no-new-structure` | Do not use new virtual path structure (separating headers and source files). | | `--no-new-structure` | Do not use new virtual path structure (separating headers and source files). |

View File

@ -80,7 +80,7 @@ newoption {
newoption { newoption {
trigger = "disable-base128", trigger = "disable-base128",
description = "Disable debugging messages for Nodes in Debug builds." description = "Disable base128 encoding for minidumps."
} }
newaction { newaction {

View File

@ -79,7 +79,10 @@ namespace Components
for (auto component : Loader::Components) for (auto component : Loader::Components)
{ {
#ifdef DEBUG #ifdef DEBUG
Logger::Print("Unregistering component: %s\n", component->GetName()); if(!Loader::PerformingUnitTests())
{
Logger::Print("Unregistering component: %s\n", component->GetName());
}
#endif #endif
delete component; delete component;
} }
@ -95,7 +98,7 @@ namespace Components
for (auto component : Loader::Components) for (auto component : Loader::Components)
{ {
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
Logger::Print("Testing '%s'...\n", component->GetName()); Logger::Print("Testing '%s'...\n", component->GetName());
#endif #endif
auto startTime = std::chrono::high_resolution_clock::now(); auto startTime = std::chrono::high_resolution_clock::now();
@ -122,7 +125,10 @@ namespace Components
if (component) if (component)
{ {
#ifdef DEBUG #ifdef DEBUG
Logger::Print("Component registered: %s\n", component->GetName()); if(!Loader::PerformingUnitTests())
{
Logger::Print("Component registered: %s\n", component->GetName());
}
#endif #endif
Loader::Components.push_back(component); Loader::Components.push_back(component);
} }

View File

@ -6,7 +6,7 @@ namespace Components
Component() {}; Component() {};
virtual ~Component() {}; virtual ~Component() {};
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
virtual const char* GetName() { return "Unknown"; }; virtual const char* GetName() { return "Unknown"; };
#endif #endif

View File

@ -11,7 +11,7 @@ namespace Components
AntiCheat(); AntiCheat();
~AntiCheat(); ~AntiCheat();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "AntiCheat"; }; const char* GetName() { return "AntiCheat"; };
#endif #endif

View File

@ -20,7 +20,7 @@ namespace Components
AssetHandler(); AssetHandler();
~AssetHandler(); ~AssetHandler();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "AssetHandler"; }; const char* GetName() { return "AssetHandler"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Auth(); Auth();
~Auth(); ~Auth();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Auth"; }; const char* GetName() { return "Auth"; };
#endif #endif

View File

@ -8,7 +8,7 @@ namespace Components
Bans(); Bans();
~Bans(); ~Bans();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Bans"; }; const char* GetName() { return "Bans"; };
#endif #endif

View File

@ -13,7 +13,7 @@ namespace Components
BitMessage(); BitMessage();
~BitMessage(); ~BitMessage();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "BitMessage"; }; const char* GetName() { return "BitMessage"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Colors(); Colors();
~Colors(); ~Colors();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Colors"; }; const char* GetName() { return "Colors"; };
#endif #endif

View File

@ -26,7 +26,7 @@ namespace Components
Command(); Command();
~Command(); ~Command();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Command"; }; const char* GetName() { return "Command"; };
#endif #endif

View File

@ -5,7 +5,7 @@ namespace Components
public: public:
ConnectProtocol(); ConnectProtocol();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "ConnectProtocol"; }; const char* GetName() { return "ConnectProtocol"; };
#endif #endif

View File

@ -9,7 +9,7 @@ namespace Components
Console(); Console();
~Console(); ~Console();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Console"; }; const char* GetName() { return "Console"; };
#endif #endif

View File

@ -5,7 +5,7 @@ namespace Components
public: public:
D3D9Ex(); D3D9Ex();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "D3D9Ex"; }; const char* GetName() { return "D3D9Ex"; };
#endif #endif

View File

@ -8,7 +8,7 @@ namespace Components
Dedicated(); Dedicated();
~Dedicated(); ~Dedicated();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Dedicated"; }; const char* GetName() { return "Dedicated"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Discovery(); Discovery();
~Discovery(); ~Discovery();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Discovery"; }; const char* GetName() { return "Discovery"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Download(); Download();
~Download(); ~Download();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Download"; }; const char* GetName() { return "Download"; };
#endif #endif

View File

@ -42,7 +42,7 @@ namespace Components
Dvar(); Dvar();
~Dvar(); ~Dvar();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Dvar"; }; const char* GetName() { return "Dvar"; };
#endif #endif

View File

@ -8,7 +8,7 @@ namespace Components
Exception(); Exception();
~Exception(); ~Exception();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Exception"; }; const char* GetName() { return "Exception"; };
#endif #endif
static LPTOP_LEVEL_EXCEPTION_FILTER Hook(); static LPTOP_LEVEL_EXCEPTION_FILTER Hook();

View File

@ -6,7 +6,7 @@ namespace Components
FastFiles(); FastFiles();
~FastFiles(); ~FastFiles();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "FastFiles"; }; const char* GetName() { return "FastFiles"; };
#endif #endif

View File

@ -41,7 +41,7 @@ namespace Components
FileSystem(); FileSystem();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "FileSystem"; }; const char* GetName() { return "FileSystem"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Flags(); Flags();
~Flags(); ~Flags();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Flags"; }; const char* GetName() { return "Flags"; };
#endif #endif

View File

@ -63,7 +63,7 @@ namespace Components
IPCPipe(); IPCPipe();
~IPCPipe(); ~IPCPipe();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "IPCPipe"; }; const char* GetName() { return "IPCPipe"; };
#endif #endif

View File

@ -8,7 +8,7 @@ namespace Components
public: public:
Lean(); Lean();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Lean"; }; const char* GetName() { return "Lean"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Localization(); Localization();
~Localization(); ~Localization();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Localization"; }; const char* GetName() { return "Localization"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Logger(); Logger();
~Logger(); ~Logger();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Logger"; }; const char* GetName() { return "Logger"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Maps(); Maps();
~Maps(); ~Maps();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Maps"; }; const char* GetName() { return "Maps"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Materials(); Materials();
~Materials(); ~Materials();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Materials"; }; const char* GetName() { return "Materials"; };
#endif #endif

View File

@ -9,7 +9,7 @@ namespace Components
Menus(); Menus();
~Menus(); ~Menus();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Menus"; }; const char* GetName() { return "Menus"; };
#endif #endif

View File

@ -36,7 +36,7 @@ namespace Components
class MinidumpUpload : public Component class MinidumpUpload : public Component
{ {
public: public:
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "MinidumpUpload"; }; const char* GetName() { return "MinidumpUpload"; };
#endif #endif
MinidumpUpload(); MinidumpUpload();

View File

@ -6,7 +6,7 @@ namespace Components
ModList(); ModList();
~ModList(); ~ModList();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "ModList"; }; const char* GetName() { return "ModList"; };
#endif #endif

View File

@ -5,6 +5,10 @@ namespace Components
public: public:
ModelSurfs(); ModelSurfs();
~ModelSurfs(); ~ModelSurfs();
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "ModelSurfs"; };
#endif
private: private:
static std::map<void*, IUnknown*> BufferMap; static std::map<void*, IUnknown*> BufferMap;

View File

@ -6,7 +6,7 @@ namespace Components
MusicalTalent(); MusicalTalent();
~MusicalTalent(); ~MusicalTalent();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "MusicalTalent"; }; const char* GetName() { return "MusicalTalent"; };
#endif #endif

View File

@ -56,7 +56,7 @@ namespace Components
Network(); Network();
~Network(); ~Network();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Network"; }; const char* GetName() { return "Network"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
News(); News();
~News(); ~News();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "News"; }; const char* GetName() { return "News"; };
#endif #endif

View File

@ -17,7 +17,7 @@ namespace Components
Node(); Node();
~Node(); ~Node();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Node"; }; const char* GetName() { return "Node"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Party(); Party();
~Party(); ~Party();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Party"; }; const char* GetName() { return "Party"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
PlayerName(); PlayerName();
~PlayerName(); ~PlayerName();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "PlayerName"; }; const char* GetName() { return "PlayerName"; };
#endif #endif

View File

@ -8,7 +8,7 @@ namespace Components
Playlist(); Playlist();
~Playlist(); ~Playlist();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Playlist"; }; const char* GetName() { return "Playlist"; };
#endif #endif

View File

@ -8,7 +8,7 @@ namespace Components
QuickPatch(); QuickPatch();
~QuickPatch(); ~QuickPatch();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "QuickPatch"; }; const char* GetName() { return "QuickPatch"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
RCon(); RCon();
~RCon(); ~RCon();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "RCon"; }; const char* GetName() { return "RCon"; };
#endif #endif

View File

@ -5,7 +5,7 @@ namespace Components
public: public:
RawFiles(); RawFiles();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "RawFiles"; }; const char* GetName() { return "RawFiles"; };
#endif #endif

View File

@ -9,7 +9,7 @@ namespace Components
Renderer(); Renderer();
~Renderer(); ~Renderer();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Renderer"; }; const char* GetName() { return "Renderer"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Script(); Script();
~Script(); ~Script();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Script"; }; const char* GetName() { return "Script"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
ServerInfo(); ServerInfo();
~ServerInfo(); ~ServerInfo();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "ServerInfo"; }; const char* GetName() { return "ServerInfo"; };
#endif #endif

View File

@ -27,7 +27,7 @@ namespace Components
ServerList(); ServerList();
~ServerList(); ~ServerList();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "ServerList"; }; const char* GetName() { return "ServerList"; };
#endif #endif

View File

@ -5,7 +5,7 @@ namespace Components
public: public:
Singleton(); Singleton();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Singleton"; }; const char* GetName() { return "Singleton"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
StringTable(); StringTable();
~StringTable(); ~StringTable();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "StringTable"; }; const char* GetName() { return "StringTable"; };
#endif #endif

View File

@ -24,7 +24,7 @@ namespace Components
StructuredData(); StructuredData();
~StructuredData(); ~StructuredData();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "StructuredData"; }; const char* GetName() { return "StructuredData"; };
#endif #endif

View File

@ -5,7 +5,7 @@ namespace Components
public: public:
Theatre(); Theatre();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Theatre"; }; const char* GetName() { return "Theatre"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
Toast(); Toast();
~Toast(); ~Toast();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Toast"; }; const char* GetName() { return "Toast"; };
#endif #endif

View File

@ -17,7 +17,7 @@ namespace Components
UIFeeder(); UIFeeder();
~UIFeeder(); ~UIFeeder();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "UIFeeder"; }; const char* GetName() { return "UIFeeder"; };
#endif #endif

View File

@ -6,7 +6,7 @@ namespace Components
UIScript(); UIScript();
~UIScript(); ~UIScript();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "UIScript"; }; const char* GetName() { return "UIScript"; };
#endif #endif

View File

@ -5,7 +5,7 @@ namespace Components
public: public:
Weapon(); Weapon();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Weapon"; }; const char* GetName() { return "Weapon"; };
#endif #endif

View File

@ -5,7 +5,7 @@ namespace Components
public: public:
Window(); Window();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "Window"; }; const char* GetName() { return "Window"; };
#endif #endif

View File

@ -73,7 +73,7 @@ namespace Components
ZoneBuilder(); ZoneBuilder();
#ifdef DEBUG #if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* GetName() { return "ZoneBuilder"; }; const char* GetName() { return "ZoneBuilder"; };
#endif #endif