[PATCH v3 09/32] selftests: harness: Always provide "self" and "variant"

Thomas Weißschuh posted 32 patches 10 months ago
There is a newer version of this series
[PATCH v3 09/32] selftests: harness: Always provide "self" and "variant"
Posted by Thomas Weißschuh 10 months ago
Some upcoming changes to the assertion macros need those two symbols
also to be available for tests without fixtures.
Provide them with a NULL value.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 tools/testing/selftests/kselftest_harness.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 905986debbfb0ce8c9659dbd52b6c67c6759cae7..4038ceeb42a870a2b77c6888df8a7bb4c4a258ba 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -173,13 +173,13 @@
 #define TEST_SIGNAL(test_name, signal) __TEST_IMPL(test_name, signal)
 
 #define __TEST_IMPL(test_name, _signal) \
-	static void test_name(struct __test_metadata *_metadata); \
+	static void test_name(struct __test_metadata *_metadata, void *self, const void *variant); \
 	static void wrapper_##test_name( \
 		struct __test_metadata *_metadata, \
 		struct __fixture_variant_metadata __attribute__((unused)) *variant) \
 	{ \
 		if (setjmp(_metadata->env) == 0) \
-			test_name(_metadata); \
+			test_name(_metadata, NULL, NULL); \
 		__test_check_assert(_metadata); \
 	} \
 	static struct __test_metadata _##test_name##_object = \
@@ -193,7 +193,9 @@
 		__register_test(&_##test_name##_object); \
 	} \
 	static void test_name( \
-		struct __test_metadata __attribute__((unused)) *_metadata)
+		struct __test_metadata __attribute__((unused)) *_metadata, \
+		void __attribute__((unused)) *self, \
+		const void __attribute__((unused)) *variant)
 
 /**
  * FIXTURE_DATA() - Wraps the struct name so we have one less

-- 
2.49.0