From c750933c7edd7ae0d5e5fa8fbfe72aca7ec74be2 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 26 Apr 2023 16:37:44 +0200 Subject: [PATCH] Also log when a test passes, and usePLOG macros. --- test/mlpp_tests.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/mlpp_tests.cpp b/test/mlpp_tests.cpp index 85c3ba4..48a09c3 100644 --- a/test/mlpp_tests.cpp +++ b/test/mlpp_tests.cpp @@ -1333,7 +1333,9 @@ void MLPPTests::test_mlpp_vector() { void MLPPTests::is_approx_equalsd(real_t a, real_t b, const String &str) { if (!Math::is_equal_approx(a, b)) { - ERR_PRINT("TEST FAILED: " + str + " Got: " + String::num(a) + " Should be: " + String::num(b)); + PLOG_ERR("TEST FAILED: " + str + " Got: " + String::num(a) + " Should be: " + String::num(b)); + } else { + PLOG_MSG("TEST PASSED: " + str); } } @@ -1348,6 +1350,8 @@ void MLPPTests::is_approx_equals_dvec(const Vector &a, const Vector> &a) { @@ -1416,6 +1420,8 @@ void MLPPTests::is_approx_equals_dmat(const Vector> &a, const Vec } } + PLOG_MSG("TEST PASSED: " + str); + return; IAEDMAT_FAILED: @@ -1427,7 +1433,7 @@ IAEDMAT_FAILED: fail_str += "Should be:\n"; fail_str += vmat_to_str(b); - ERR_PRINT(fail_str); + PLOG_ERR(fail_str); } void MLPPTests::is_approx_equals_mat(Ref a, Ref b, const String &str) { @@ -1452,6 +1458,8 @@ void MLPPTests::is_approx_equals_mat(Ref a, Ref b, const } } + PLOG_MSG("TEST PASSED: " + str); + return; IAEMAT_FAILED: @@ -1463,7 +1471,7 @@ IAEMAT_FAILED: fail_str += "\nShould be:\n"; fail_str += b->to_string(); - ERR_PRINT(fail_str); + PLOG_ERR(fail_str); } void MLPPTests::is_approx_equals_vec(Ref a, Ref b, const String &str) { ERR_FAIL_COND(!a.is_valid()); @@ -1479,6 +1487,8 @@ void MLPPTests::is_approx_equals_vec(Ref a, Ref b, const } } + PLOG_MSG("TEST PASSED: " + str); + return; IAEDVEC_FAILED: @@ -1491,7 +1501,7 @@ IAEDVEC_FAILED: fail_str += b->to_string(); fail_str += "\n."; - ERR_PRINT(fail_str); + PLOG_ERR(fail_str); } MLPPTests::MLPPTests() {