From cf7db48c261ee9c896c813a38ff8c59da5b8fe07 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sun, 26 Jan 2025 00:40:51 +0100 Subject: Fix line endings --- asl/testing/testing.hpp | 92 ++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'asl/testing/testing.hpp') diff --git a/asl/testing/testing.hpp b/asl/testing/testing.hpp index bf8f54e..e23325f 100644 --- a/asl/testing/testing.hpp +++ b/asl/testing/testing.hpp @@ -1,46 +1,46 @@ -#pragma once - -#include "asl/utility.hpp" - -namespace asl::testing -{ - -struct Test; - -void register_test(Test*); - -void report_failure(const char* msg, const char* file, int line); - -using TestFunction = void(); - -struct Test -{ - const char* m_case_name; - TestFunction* m_fn; - Test* m_next{}; - Test* m_prev{}; - - constexpr explicit Test(const char* case_name, TestFunction* fn) - : m_case_name{case_name} - , m_fn{fn} - { - register_test(this); - } -}; - -} // namespace asl::testing - -#define ASL_TEST(CASE) \ - static void asl_test_fn_##CASE(); \ - static ::asl::testing::Test asl_test_##CASE( \ - #CASE, \ - asl_test_fn_##CASE); \ - void asl_test_fn_##CASE() - -#define ASL_TEST_ASSERT(EXPR) \ - if (EXPR) {} \ - else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); return; } - -#define ASL_TEST_EXPECT(EXPR) \ - if (EXPR) {} \ - else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); } +#pragma once + +#include "asl/utility.hpp" + +namespace asl::testing +{ + +struct Test; + +void register_test(Test*); + +void report_failure(const char* msg, const char* file, int line); + +using TestFunction = void(); + +struct Test +{ + const char* m_case_name; + TestFunction* m_fn; + Test* m_next{}; + Test* m_prev{}; + + constexpr explicit Test(const char* case_name, TestFunction* fn) + : m_case_name{case_name} + , m_fn{fn} + { + register_test(this); + } +}; + +} // namespace asl::testing + +#define ASL_TEST(CASE) \ + static void asl_test_fn_##CASE(); \ + static ::asl::testing::Test asl_test_##CASE( \ + #CASE, \ + asl_test_fn_##CASE); \ + void asl_test_fn_##CASE() + +#define ASL_TEST_ASSERT(EXPR) \ + if (EXPR) {} \ + else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); return; } + +#define ASL_TEST_EXPECT(EXPR) \ + if (EXPR) {} \ + else { ::asl::testing::report_failure(#EXPR, __FILE__, __LINE__); } -- cgit