Skip to content

Commit 9d1587a

Browse files
committed
selftests/harness: Clean up kern-doc for fixtures
The FIXTURE*() macro kern-doc examples had the wrong names for the C code examples associated with them. Fix those and clarify that FIXTURE_DATA() usage should be avoided. Cc: Shuah Khan <[email protected]> Fixes: 74bc7c9 ("kselftest: add fixture variants") Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent fe4bfff commit 9d1587a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tools/testing/selftests/kselftest_harness.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,9 @@
195195
*
196196
* .. code-block:: c
197197
*
198-
* FIXTURE_DATA(datatype name)
198+
* FIXTURE_DATA(datatype_name)
199199
*
200+
* Almost always, you want just FIXTURE() instead (see below).
200201
* This call may be used when the type of the fixture data
201202
* is needed. In general, this should not be needed unless
202203
* the *self* is being passed to a helper directly.
@@ -211,7 +212,7 @@
211212
*
212213
* .. code-block:: c
213214
*
214-
* FIXTURE(datatype name) {
215+
* FIXTURE(fixture_name) {
215216
* type property1;
216217
* ...
217218
* };
@@ -238,7 +239,7 @@
238239
*
239240
* .. code-block:: c
240241
*
241-
* FIXTURE_SETUP(fixture name) { implementation }
242+
* FIXTURE_SETUP(fixture_name) { implementation }
242243
*
243244
* Populates the required "setup" function for a fixture. An instance of the
244245
* datatype defined with FIXTURE_DATA() will be exposed as *self* for the
@@ -264,7 +265,7 @@
264265
*
265266
* .. code-block:: c
266267
*
267-
* FIXTURE_TEARDOWN(fixture name) { implementation }
268+
* FIXTURE_TEARDOWN(fixture_name) { implementation }
268269
*
269270
* Populates the required "teardown" function for a fixture. An instance of the
270271
* datatype defined with FIXTURE_DATA() will be exposed as *self* for the
@@ -285,7 +286,7 @@
285286
*
286287
* .. code-block:: c
287288
*
288-
* FIXTURE_VARIANT(datatype name) {
289+
* FIXTURE_VARIANT(fixture_name) {
289290
* type property1;
290291
* ...
291292
* };
@@ -305,8 +306,8 @@
305306
*
306307
* .. code-block:: c
307308
*
308-
* FIXTURE_ADD(datatype name) {
309-
* .property1 = val1;
309+
* FIXTURE_VARIANT_ADD(fixture_name, variant_name) {
310+
* .property1 = val1,
310311
* ...
311312
* };
312313
*

0 commit comments

Comments
 (0)