Update testlib
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user