archshift 3f083e0e0e Make Test a template function for easy comparison with values.
Also allows further logging and output in the future.
2014-12-10 20:15:30 -08:00

16 lines
395 B
C++

#pragma once
#include <functional>
// If the condition fails, return false
#define SoftAssert(cond) do { if (!(cond)) { return false; } } while (0)
void PrintSuccess(std::string group, std::string name, bool val);
template <typename T>
bool Test(std::string group, std::string name, T result, T expected)
{
PrintSuccess(group, name, result == expected);
return result == expected;
}