diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-02-20 23:13:37 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-02-20 23:13:37 +0100 |
commit | 409ef997e2ff99b2bbea89ea61d10fc8e26dac96 (patch) | |
tree | 103225ce6af074120731ce9bb3c16a3778687d6c /asl/testing/testing.hpp | |
parent | 6fd19d6dfe2c9780ce268de4205300ede4a16b89 (diff) |
Add customizable assert failure handler
Diffstat (limited to 'asl/testing/testing.hpp')
-rw-r--r-- | asl/testing/testing.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |