Skip to content

Commit 3e4cd8e

Browse files
keesshuahkh
authored andcommitted
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]> Cc: Jakub Kicinski <[email protected]> Fixes: 74bc7c9 ("kselftest: add fixture variants") Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent a80d605 commit 3e4cd8e

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
@@ -202,8 +202,9 @@
202202
*
203203
* .. code-block:: c
204204
*
205-
* FIXTURE_DATA(datatype name)
205+
* FIXTURE_DATA(datatype_name)
206206
*
207+
* Almost always, you want just FIXTURE() instead (see below).
207208
* This call may be used when the type of the fixture data
208209
* is needed. In general, this should not be needed unless
209210
* the *self* is being passed to a helper directly.
@@ -218,7 +219,7 @@
218219
*
219220
* .. code-block:: c
220221
*
221-
* FIXTURE(datatype name) {
222+
* FIXTURE(fixture_name) {
222223
* type property1;
223224
* ...
224225
* };
@@ -245,7 +246,7 @@
245246
*
246247
* .. code-block:: c
247248
*
248-
* FIXTURE_SETUP(fixture name) { implementation }
249+
* FIXTURE_SETUP(fixture_name) { implementation }
249250
*
250251
* Populates the required "setup" function for a fixture. An instance of the
251252
* datatype defined with FIXTURE_DATA() will be exposed as *self* for the
@@ -271,7 +272,7 @@
271272
*
272273
* .. code-block:: c
273274
*
274-
* FIXTURE_TEARDOWN(fixture name) { implementation }
275+
* FIXTURE_TEARDOWN(fixture_name) { implementation }
275276
*
276277
* Populates the required "teardown" function for a fixture. An instance of the
277278
* datatype defined with FIXTURE_DATA() will be exposed as *self* for the
@@ -292,7 +293,7 @@
292293
*
293294
* .. code-block:: c
294295
*
295-
* FIXTURE_VARIANT(datatype name) {
296+
* FIXTURE_VARIANT(fixture_name) {
296297
* type property1;
297298
* ...
298299
* };
@@ -312,8 +313,8 @@
312313
*
313314
* .. code-block:: c
314315
*
315-
* FIXTURE_ADD(datatype name) {
316-
* .property1 = val1;
316+
* FIXTURE_VARIANT_ADD(fixture_name, variant_name) {
317+
* .property1 = val1,
317318
* ...
318319
* };
319320
*

0 commit comments

Comments
 (0)