From 409ef997e2ff99b2bbea89ea61d10fc8e26dac96 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Thu, 20 Feb 2025 23:13:37 +0100 Subject: Add customizable assert failure handler --- asl/testing/testing.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'asl/testing/testing.hpp') diff --git a/asl/testing/testing.hpp b/asl/testing/testing.hpp index b47c416..c3214a5 100644 --- a/asl/testing/testing.hpp +++ b/asl/testing/testing.hpp @@ -9,7 +9,7 @@ struct Test; void register_test(Test*); -void report_failure(const char* msg, const char* file, int line); +void report_failure(const char* msg, const asl::source_location& = asl::source_location{}); using TestFunction = void(); @@ -39,8 +39,8 @@ struct Test #define ASL_TEST_ASSERT(EXPR) \ if (EXPR) {} \ - else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); return; } + else { ::asl::testing::report_failure(#EXPR); return; } #define ASL_TEST_EXPECT(EXPR) \ if (EXPR) {} \ - else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); } + else { ::asl::testing::report_failure(#EXPR); } -- cgit