summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibTest
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-10-17 00:06:11 +0200
committerLinus Groh <mail@linusgroh.de>2022-12-03 23:52:23 +0000
commitd26aabff0401690d6dd1332558b40f5cb64e4428 (patch)
treefd56d0ab5b672814a1a2fb7b8a92fefb01f24e6f /Userland/Libraries/LibTest
parent8639d8bc212dcb45aff80405b4b0f6b1ef1087e7 (diff)
downloadserenity-d26aabff0401690d6dd1332558b40f5cb64e4428.zip
Everywhere: Run clang-format
Diffstat (limited to 'Userland/Libraries/LibTest')
-rw-r--r--Userland/Libraries/LibTest/TestCase.h49
1 files changed, 29 insertions, 20 deletions
diff --git a/Userland/Libraries/LibTest/TestCase.h b/Userland/Libraries/LibTest/TestCase.h
index 18efcccf90..359cffa5f8 100644
--- a/Userland/Libraries/LibTest/TestCase.h
+++ b/Userland/Libraries/LibTest/TestCase.h
@@ -42,34 +42,43 @@ void add_test_case_to_suite(NonnullRefPtr<TestCase> const& test_case);
void set_suite_setup_function(Function<void()> setup);
}
-#define TEST_SETUP \
- static void __setup(); \
- struct __setup_type { \
- __setup_type() { Test::set_suite_setup_function(__setup); } \
- }; \
- static struct __setup_type __setup_type; \
+#define TEST_SETUP \
+ static void __setup(); \
+ struct __setup_type { \
+ __setup_type() \
+ { \
+ Test::set_suite_setup_function(__setup); \
+ } \
+ }; \
+ static struct __setup_type __setup_type; \
static void __setup()
#define __TESTCASE_FUNC(x) __test_##x
#define __TESTCASE_TYPE(x) __TestCase_##x
-#define TEST_CASE(x) \
- static void __TESTCASE_FUNC(x)(); \
- struct __TESTCASE_TYPE(x) { \
- __TESTCASE_TYPE(x) \
- () { add_test_case_to_suite(adopt_ref(*new ::Test::TestCase(#x, __TESTCASE_FUNC(x), false))); } \
- }; \
- static struct __TESTCASE_TYPE(x) __TESTCASE_TYPE(x); \
+#define TEST_CASE(x) \
+ static void __TESTCASE_FUNC(x)(); \
+ struct __TESTCASE_TYPE(x) { \
+ __TESTCASE_TYPE(x) \
+ () \
+ { \
+ add_test_case_to_suite(adopt_ref(*new ::Test::TestCase(#x, __TESTCASE_FUNC(x), false))); \
+ } \
+ }; \
+ static struct __TESTCASE_TYPE(x) __TESTCASE_TYPE(x); \
static void __TESTCASE_FUNC(x)()
#define __BENCHMARK_FUNC(x) __benchmark_##x
#define __BENCHMARK_TYPE(x) __BenchmarkCase_##x
-#define BENCHMARK_CASE(x) \
- static void __BENCHMARK_FUNC(x)(); \
- struct __BENCHMARK_TYPE(x) { \
- __BENCHMARK_TYPE(x) \
- () { add_test_case_to_suite(adopt_ref(*new ::Test::TestCase(#x, __BENCHMARK_FUNC(x), true))); } \
- }; \
- static struct __BENCHMARK_TYPE(x) __BENCHMARK_TYPE(x); \
+#define BENCHMARK_CASE(x) \
+ static void __BENCHMARK_FUNC(x)(); \
+ struct __BENCHMARK_TYPE(x) { \
+ __BENCHMARK_TYPE(x) \
+ () \
+ { \
+ add_test_case_to_suite(adopt_ref(*new ::Test::TestCase(#x, __BENCHMARK_FUNC(x), true))); \
+ } \
+ }; \
+ static struct __BENCHMARK_TYPE(x) __BENCHMARK_TYPE(x); \
static void __BENCHMARK_FUNC(x)()