Format source files

This commit is contained in:
2023-02-18 10:37:38 +01:00
parent 76d93bb1cf
commit d09d4d3d92
12 changed files with 793 additions and 850 deletions

View File

@@ -7,57 +7,57 @@
namespace Util
{
unsigned static GetRandomNumber()
{
static std::default_random_engine eng;
static std::uniform_int_distribution<unsigned> valueDist(0u, 8096u);
unsigned static GetRandomNumber()
{
static std::default_random_engine eng;
static std::uniform_int_distribution<unsigned> valueDist(0u, 8096u);
return valueDist(eng);
}
return valueDist(eng);
}
};
namespace Test
{
void Execute(bool (*testFunction)(void), char const * const message)
{
try
{
if(testFunction())
{
std::printf("[PASS] %s\n", message);
}
else
{
std::printf("[FAIL] %s\n", message);
}
}
catch(std::exception & e)
{
std::printf("[FAIL] Exception thrown during execution of <%s>, error: %s\n", message, e.what());
}
}
void Execute(bool (*testFunction)(void), char const * const message)
{
try
{
if(testFunction())
{
std::printf("[PASS] %s\n", message);
}
else
{
std::printf("[FAIL] %s\n", message);
}
}
catch(std::exception & e)
{
std::printf("[FAIL] Exception thrown during execution of <%s>, error: %s\n", message, e.what());
}
}
void Execute(bool (*testFunction)(std::vector<std::string> &), char const * const message)
{
std::vector<std::string> issues;
try
{
if(testFunction(issues))
{
std::printf("[PASS] %s\n", message);
}
else
{
std::printf("[FAIL] %s\n", message);
for(auto & issue : issues)
{
std::printf(" Issue: %s\n", issue.c_str());
}
}
}
catch(std::exception & e)
{
std::printf("[FAIL] Exception thrown during execution of <%s>, error: %s\n", message, e.what());
}
}
void Execute(bool (*testFunction)(std::vector<std::string> &), char const * const message)
{
std::vector<std::string> issues;
try
{
if(testFunction(issues))
{
std::printf("[PASS] %s\n", message);
}
else
{
std::printf("[FAIL] %s\n", message);
for(auto & issue: issues)
{
std::printf(" Issue: %s\n", issue.c_str());
}
}
}
catch(std::exception & e)
{
std::printf("[FAIL] Exception thrown during execution of <%s>, error: %s\n", message, e.what());
}
}
};