Update testlib

This commit is contained in:
2023-10-31 10:49:03 +01:00
parent 033947b97d
commit 8e1e5ae024
2 changed files with 29 additions and 4 deletions

View File

@@ -12,11 +12,14 @@
#include "testlib.hpp"
#include <type_traits>
static void print_message(std::string msg)
{
if (msg.size() > 0) {
std::cout << "message: " << msg << "\n\n";
} else {
}
else {
std::cout << "\n";
}
}
@@ -30,7 +33,8 @@ void m_assert(bool expr, std::string expr_str, std::string f, std::string file,
if (expr) {
std::cout << "\x1B[32mOK\033[0m\n";
print_message(msg);
} else {
}
else {
std::cout << "\x1B[31mFAIL\033[0m\n";
print_message(msg);
std::cout << file << " " << line << ": Assertion \"" << expr_str