123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef CORE_TEST_H
- #define CORE_TEST_H
- #include "utils/Logger.h"
- namespace Core {
- class Test final {
- int tests;
- int successTests;
- const char* name;
- public:
- Test(const char* name);
- void finalize();
- template<typename T>
- void checkEqual(const T& wanted, const T& actual, const char* text) {
- tests++;
- if(wanted == actual) {
- successTests++;
- } else {
- (void)text;
- LOG_ERROR("# Test #: # - expected '#' got '#'", name, tests,
- text, wanted, actual)
- }
- }
- void checkEqual(float wanted, float actual, const char* text);
- void checkFloat(float wanted, float actual, float error,
- const char* text);
- void checkTrue(bool actual, const char* text);
- void checkFalse(bool actual, const char* text);
- };
- }
- #endif
|