Fuck those unit-tests on wine.

This commit is contained in:
momo5502 2016-11-06 14:26:03 +01:00
parent 5710f30376
commit f46f5590ff
3 changed files with 30 additions and 18 deletions

View File

@ -157,6 +157,8 @@ namespace Components
}).detach(); }).detach();
}); });
if (!Utils::IsWineEnvironment())
{
News::Terminate = false; News::Terminate = false;
News::Thread = std::thread([] () News::Thread = std::thread([] ()
{ {
@ -184,6 +186,7 @@ namespace Components
} }
}); });
} }
}
News::~News() News::~News()
{ {

View File

@ -35,4 +35,11 @@ namespace Utils
LocalFree(messageBuffer); LocalFree(messageBuffer);
} }
bool IsWineEnvironment()
{
HMODULE hntdll = GetModuleHandleA("ntdll.dll");
if (!hntdll) return false;
return (GetProcAddress(hntdll, "wine_get_version") != nullptr);
}
} }

View File

@ -4,6 +4,8 @@ namespace Utils
std::string ParseChallenge(std::string data); std::string ParseChallenge(std::string data);
void OutputDebugLastError(); void OutputDebugLastError();
bool IsWineEnvironment();
template <typename T> void Merge(std::vector<T>* target, T* source, size_t length) template <typename T> void Merge(std::vector<T>* target, T* source, size_t length)
{ {
if (source) if (source)