1234567891011121314151617181920212223242526272829 |
- #include "Test.hpp"
- Core::HashMap<Core::Test::Internal::FileName, Core::Test::Internal::Result>
- Core::Test::Internal::results;
- void Core::Test::Internal::warn(const char* file, int line, Error e) {
- CORE_LOG_WARNING("#:# | #", Core::Logger::getFileName(file), line, e);
- }
- bool Core::Test::Internal::checkFloat(const char* file, int line, float wanted,
- float actual, float error) {
- float diff = wanted - actual;
- diff = diff < 0.0f ? -diff : diff;
- return check(file, line, wanted, actual, diff <= error);
- }
- void Core::Test::finalize() {
- using namespace Internal;
- for(const auto& e : results) {
- if(e.value.successTests == e.value.tests) {
- CORE_LOG_DEBUG("# - # / # tests succeeded", e.getKey(),
- e.value.successTests, e.value.tests);
- } else {
- CORE_LOG_ERROR("# - # / # tests succeeded", e.getKey(),
- e.value.successTests, e.value.tests);
- }
- }
- results.clear();
- }
|